From patchwork Tue Jul 16 15:14:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Miguel_Mart=C3=ADn?= X-Patchwork-Id: 1961128 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=aWe8Dhc2; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WNjLc4pdKz1xqc for ; Wed, 17 Jul 2024 01:15:36 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D1956384A432 for ; Tue, 16 Jul 2024 15:15:34 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id CF6013846068 for ; Tue, 16 Jul 2024 15:15:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CF6013846068 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org CF6013846068 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1721142913; cv=none; b=AsJNZjs9jQ4Fgy0ejwyqcDW/kxQ52lQug9zAJN64714gBH17luTXrRUGSjK8IimadXkwyhDSYKRLz5LLBurT0igdaCRb3Khd8+k7Xt4lRQnbh1FsoX7ZpDYHCKNM+tu8B9M1bR32GURQfs1/TpB22We+tXq6bdmx8Ht8h10WlnI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1721142913; c=relaxed/simple; bh=H8Bmkyo2lWgAX3DxGDwEB5FhEy5YGVyMPpgv0gOEE24=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=tHCWT3UGwrTc2RIS4+aTffV+i5GvscF6oA4jbjwDQzyhKhEOOHwYvA2mq0nNR6yScMZQFFQRSklvhv6GYUkqYhfMkAgVHeC5RZ9BF2WbWxVThcVInrmx2CLf6Oev2UHQxsYMbiDtNgY6vQvp+WDf5Mdyp1Ezxj7Nc1+suPmJlb4= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1721142911; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6Quk96SpzK7OSHwshv9bxmdcPjTgTrQUGjD5s1NK9Jg=; b=aWe8Dhc2zFCpH2m63KkTxf66FmNtxrcG6KY2UbEU/0xelW/X2T/S2W0NE+JHUCdlwHS+0m O8+sfCVN5MbB6FXsU2doJxMJ48J2/qUGrpBW0YPeSNkM28onmjE+NumViyFxQdIprh1/M9 iO9mkXUqqEVvvXdRsRNruaaWYmW2Bu8= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-601-8x4BPcNWM1SRtBEbM4d4_w-1; Tue, 16 Jul 2024 11:15:08 -0400 X-MC-Unique: 8x4BPcNWM1SRtBEbM4d4_w-1 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-36793373454so3787043f8f.1 for ; Tue, 16 Jul 2024 08:15:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721142907; x=1721747707; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=6Quk96SpzK7OSHwshv9bxmdcPjTgTrQUGjD5s1NK9Jg=; b=OaKPZqEad2Cb/eWO5poSd+aD+4JhOCuYwoirDrSY1CJE5wLO+GkVDZKIb9g/21I4Tk ZL5oONLbRpwXvpuCbOBRRpbYgGR2xBWKU4d84MzrZwJD+feabox9qjWpTupW/ywzCN5M 2+KpPaTZgEwN2Ki3V5+KtgEYM9NH90t4FSH2GbbJV4lD3qYvGILjRQEfXnnP+sezb9Fg GFjvSzyxKyD0QhDGl2+ByL3p/K1sidY8ktRDBFhxJlfn3J1AGtYezXKDgiaAu9EJqCnL +kikMOIaxEJuhAXOCLym3uT9zUs728/q1bGoJVwetFmABzMHJdjQ3XRnePEvHUoZc+cd wHpg== X-Gm-Message-State: AOJu0YxA+4XufCUhTnQDHpf6nsXHodXDVlxLpbkBkYrhMU9n2l18kLVy zzMQOeaiQNyhg6dwS8CKxsUv+W03g3VaL51c8d5pXSeMG0vergEEinLLMSMsf53vwdY061s61ZJ STmgSz4kQ0HUgx1u/HTnAeKWuoFefE2ilE7NukKAK9Qd8Uy6UTKrVdc/5ifMz7I5QPjdXPRRUbM 4Cayekp4aQkt0FkAIyle+QzlVChrVxKP2HHbbDtkGGqcvh X-Received: by 2002:a05:6000:4597:b0:367:89d3:6581 with SMTP id ffacd0b85a97d-36826105d6amr1567530f8f.17.1721142907333; Tue, 16 Jul 2024 08:15:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGfpHRN1P95ncslv2hNsnBS06T50asFcqJwXbPM9DEPZa89PV0IGmOIgKmWGOa5gUjb74n//Q== X-Received: by 2002:a05:6000:4597:b0:367:89d3:6581 with SMTP id ffacd0b85a97d-36826105d6amr1567514f8f.17.1721142906816; Tue, 16 Jul 2024 08:15:06 -0700 (PDT) Received: from lenovo-p1.mamux.org ([82.213.230.188]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3680dab3f13sm9401185f8f.4.2024.07.16.08.15.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jul 2024 08:15:06 -0700 (PDT) From: =?utf-8?q?Miguel_Mart=C3=ADn?= To: libc-alpha@sourceware.org Subject: [PATCH v3 0/2] malloc: add multi-threaded tests for aligned_alloc/calloc/malloc Date: Tue, 16 Jul 2024 17:14:55 +0200 Message-ID: X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org Improve aligned_alloc/calloc/malloc test coverage by adding multi-threaded tests with random memory allocations and with/without cross-thread memory deallocations. Modify the existing DSO used for random memory allocations to avoid getting global locks in the allocation process. The new tests are added to tests-exclude-mcheck as they don't seem to play well with mcheck and I have not been able to find any problem with the tests themselves. Happy to fix anything and/or file an issue in mcheck for further investigation. Changes from v2: - Rephrased some sentences and fixed some typos. - Removed unneeded checks. - Changed the distribution of sizes in random memory allocations. Miguel Martín (2): malloc: avoid global locks in tst-aligned_alloc-lib.c malloc: add multi-threaded tests for aligned_alloc/calloc/malloc malloc/Makefile | 8 + .../tst-aligned-alloc-random-thread-cross.c | 19 +++ malloc/tst-aligned-alloc-random-thread.c | 145 ++++++++++++++++++ malloc/tst-aligned_alloc-lib.c | 39 ++--- 4 files changed, 192 insertions(+), 19 deletions(-) create mode 100644 malloc/tst-aligned-alloc-random-thread-cross.c create mode 100644 malloc/tst-aligned-alloc-random-thread.c