From patchwork Wed Jun 7 17:39:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 1791875 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=soMZbcVQ; dkim-atps=neutral Received: from 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 (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QbvkV5Gcpz20Ty for ; Thu, 8 Jun 2023 03:40:18 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B46DC38582BD for ; Wed, 7 Jun 2023 17:40:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B46DC38582BD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1686159616; bh=kUF/e0VgaR3x4LprbnjzecXGq0UYyYtpSYA+gubo5c4=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=soMZbcVQsaK0qJJudy4M4EICHb6ZIOWU6ZeCJo1aN4mwd3nL3fQaFnoeWpnZtP8HM zJoX5rtzIxBaRne9+pSm2qzaCMVGSYbZZXKS3RIv80oxghGxBKuwl4828QO11ADXYI ayo4/YLNMGGGHCzBd4t8KuXVW/mAdsMniUTe3x6A= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-ot1-x32c.google.com (mail-ot1-x32c.google.com [IPv6:2607:f8b0:4864:20::32c]) by sourceware.org (Postfix) with ESMTPS id AE87C3858C54 for ; Wed, 7 Jun 2023 17:40:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AE87C3858C54 Received: by mail-ot1-x32c.google.com with SMTP id 46e09a7af769-6b291d55f52so1589608a34.2 for ; Wed, 07 Jun 2023 10:40:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686159599; x=1688751599; 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=kUF/e0VgaR3x4LprbnjzecXGq0UYyYtpSYA+gubo5c4=; b=PN69dM6tsfxVQvOKhMytQSv9pISL9ZtXqsA7jFKqplSrjBAyjIHp/KAjS4lGXONOAs BLs31mswqVMlMbHwZo+XCptYeqTEWum2mcIshnOmc2hnLuhPfBvcXY7PZ8j6/7e5wge3 rgBUkmRIJLNRSqKiCfLup35AdbefGbhNtq/eDWTf65d9TjQ0ixvZ4R63Jzx0XTSsItl5 Q+Z2SgkD8gSZYOUIhbgzHa55v3owySYVgt0qRMN3iyjqW2BLW6gjjKPaIzu2EgXXvZz3 sHcX1n5RQvVaPEFCkyV+L0EA7pMy+EowSrzOLiHCjf1El1FeDNCcR6bffoecuwyNYnNv ORxw== X-Gm-Message-State: AC+VfDykEIPBGmWkBfmhCbpXM1qF6yQWRWG3ygqguljnZT1o3Zz8pRqf W/01y7aMYQu0KWrNpR8Vx6HiUecA1ZdTPqaoah3xSg== X-Google-Smtp-Source: ACHHUZ50ciNxNEjFUrO8osUsZbJtj7GTmiXBH1GPbKw2DeB9jr8mmknRZor4Kv5E+ClkEN+0sCdFdQ== X-Received: by 2002:a9d:4b09:0:b0:6af:a47b:28b4 with SMTP id q9-20020a9d4b09000000b006afa47b28b4mr4205379otf.2.1686159599392; Wed, 07 Jun 2023 10:39:59 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c1:fe49:e315:48d1:a728:2e0a]) by smtp.gmail.com with ESMTPSA id n25-20020a9d4d19000000b006af78565d64sm3191849otf.46.2023.06.07.10.39.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jun 2023 10:39:58 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH] malloc: Decrease resource usage for malloc tests Date: Wed, 7 Jun 2023 14:39:55 -0300 Message-Id: <20230607173955.2696730-1-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-12.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org Sender: "Libc-alpha" The tst-mallocfork2 and tst-mallocfork3 create large number of subprocesss, around 11k for former and 20k for latter, to check for malloc async-signal-safeness on both fork and _Fork. However they do not really exercise allocation patterns different than other tests fro malloc itself, and the spawned process just exit without any extra computation. The tst-malloc-tcache-leak is similar, but creates 100k threads and already checks the resulting with mallinfo. These tests are also very sensitive to system load (since they estresss heavy the kernel resource allocation), and adding them on THP tunable and mcheck tests increase the pressure even more. For THP the fork tests do not add any more coverage than other tests. The mcheck is also not enable for tst-malloc-tcache-leak. Checked on x86_64-linux-gnu. Reviewed-by: Carlos O'Donell --- malloc/Makefile | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/malloc/Makefile b/malloc/Makefile index ce6ebcf1b3..c1db3347d8 100644 --- a/malloc/Makefile +++ b/malloc/Makefile @@ -74,7 +74,10 @@ test-srcs = tst-mtrace # with MALLOC_CHECK_=3 because they expect a specific failure. tests-exclude-malloc-check = tst-malloc-check tst-malloc-usable \ tst-mxfast tst-safe-linking \ - tst-compathooks-off tst-compathooks-on tst-memalign-2 tst-memalign-3 + tst-compathooks-off tst-compathooks-on tst-memalign-2 tst-memalign-3 \ + tst-mallocfork2 \ + tst-mallocfork3 \ + tst-malloc-tcache-leak # Run all tests with MALLOC_CHECK_=3 tests-malloc-check = $(filter-out $(tests-exclude-malloc-check) \ @@ -92,7 +95,10 @@ tests-exclude-hugetlb1 = \ tst-interpose-static-thread \ tst-malloc-usable \ tst-malloc-usable-tunables \ - tst-mallocstate + tst-mallocstate \ + tst-malloc-tcache-leak \ + tst-mallocfork2 \ + tst-mallocfork3 # The tst-free-errno relies on the used malloc page size to mmap an # overlapping region. tests-exclude-hugetlb2 = \ @@ -121,7 +127,9 @@ tests-exclude-mcheck = tst-mallocstate \ tst-compathooks-off tst-compathooks-on \ tst-memalign-2 \ tst-memalign-3 \ - tst-mxfast + tst-mxfast \ + tst-mallocfork2 \ + tst-mallocfork3 tests-mcheck = $(filter-out $(tests-exclude-mcheck) $(tests-static), $(tests)) endif @@ -182,14 +190,10 @@ $(objpfx)tst-malloc-fork-deadlock-malloc-check: $(shared-thread-library) $(objpfx)tst-malloc-stats-cancellation-malloc-check: $(shared-thread-library) $(objpfx)tst-malloc-thread-exit-malloc-hugetlb1: $(shared-thread-library) $(objpfx)tst-malloc-thread-fail-malloc-hugetlb1: $(shared-thread-library) -$(objpfx)tst-mallocfork2-malloc-hugetlb1: $(shared-thread-library) -$(objpfx)tst-mallocfork3-malloc-hugetlb1: $(shared-thread-library) $(objpfx)tst-malloc-fork-deadlock-malloc-hugetlb1: $(shared-thread-library) $(objpfx)tst-malloc-stats-cancellation-malloc-hugetlb1: $(shared-thread-library) $(objpfx)tst-malloc-thread-exit-malloc-hugetlb2: $(shared-thread-library) $(objpfx)tst-malloc-thread-fail-malloc-hugetlb2: $(shared-thread-library) -$(objpfx)tst-mallocfork2-malloc-hugetlb2: $(shared-thread-library) -$(objpfx)tst-mallocfork3-malloc-hugetlb2: $(shared-thread-library) $(objpfx)tst-malloc-fork-deadlock-malloc-hugetlb2: $(shared-thread-library) $(objpfx)tst-malloc-stats-cancellation-malloc-hugetlb2: $(shared-thread-library) @@ -344,14 +348,9 @@ $(objpfx)tst-dynarray-fail-mem.out: $(objpfx)tst-dynarray-fail.out $(objpfx)tst-malloc-tcache-leak: $(shared-thread-library) $(objpfx)tst-malloc_info: $(shared-thread-library) $(objpfx)tst-mallocfork2: $(shared-thread-library) -$(objpfx)tst-malloc-tcache-leak-mcheck: $(shared-thread-library) $(objpfx)tst-malloc_info-mcheck: $(shared-thread-library) -$(objpfx)tst-mallocfork2-mcheck: $(shared-thread-library) -$(objpfx)tst-malloc-tcache-leak-malloc-check: $(shared-thread-library) $(objpfx)tst-malloc_info-malloc-check: $(shared-thread-library) $(objpfx)tst-mallocfork2-malloc-check: $(shared-thread-library) -$(objpfx)tst-malloc-tcache-leak-malloc-hugetlb1: $(shared-thread-library) -$(objpfx)tst-malloc-tcache-leak-malloc-hugetlb2: $(shared-thread-library) $(objpfx)tst-malloc_info-malloc-hugetlb1: $(shared-thread-library) $(objpfx)tst-malloc_info-malloc-hugetlb2: $(shared-thread-library) $(objpfx)tst-memalign-3: $(shared-thread-library)