From patchwork Tue Mar 26 13:47:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 1916174 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=uX5D+1Iu; 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 4V3rjN6vp3z1yWv for ; Wed, 27 Mar 2024 00:48:08 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 26BD43858417 for ; Tue, 26 Mar 2024 13:48:07 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) by sourceware.org (Postfix) with ESMTPS id EF60A3858C56 for ; Tue, 26 Mar 2024 13:47:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EF60A3858C56 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org EF60A3858C56 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::42d ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711460870; cv=none; b=k32XIcjBgTSbkLGA8d5m7yjjzU6J6U2juS1c5L9AgXLxvqgOUztTc7JwHDhlCoqW5xI+XhTxVA0W1C+IANOaQYRSEey1it4VbmhMF5ouKiKQCH+aTRanZ/b3digFv3RQBm5+GNDaABrceF0KD2Em6pyMN6WiPh0EdYDdibJGUNk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711460870; c=relaxed/simple; bh=lXTHmT2LjTqE2H+HTVw45T6tknuxXpt0fZXcBS2ER6Y=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=FW29RjqYp10ZB/g0ISmJYz3jTeBNq+r8mff8+d2awwAJ+29KaVdlZrwy1wg3z+TMJX6LkM+4+EC8t9HJ1vrSPR1+6JpUhMGR2REQz8j9zzABlbZ/twUF8kb1oKca5wlUDKsd0afoqayDlGOYzhKRM78c9HjqVNH87ZQXqJIIIFU= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-6ea8ee55812so3190099b3a.0 for ; Tue, 26 Mar 2024 06:47:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711460867; x=1712065667; darn=sourceware.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Grevwhqgl9D0hRAnSlMlcshhixvV/mmaGfx88DN1gm8=; b=uX5D+1IuNiP+UyqB/CqKQg6x/nQzPcvLlC6NACFSlS/rSsjn5S8/hJnDvA4XK7G1IG dho8QUCrt9l6GvPngS0zPLZeTRffTq9Ur82o4d3EmjZ5d1VyAbbYJ4w1SndUh2lNHbjM Y/eBJeUP0Ivlh2aCRfL81Qz542Erctr1c8l+G0DKhv3qg74SvBje/y3/Q2DJ3OHEAasY pkpTjF64pPAlXDs+jlKI9zjalpRtFgYp7OtArxkmpfagLNVQS5MEwpLrrtI7VV0WSscm G66nEu9vdaJXFGJ2Rc/HOm6nmZ1Vq1E0gzsttdU2Reb8aZ5zUaRP8FkQgnkf4zFyFXmV 0ErQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711460867; x=1712065667; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Grevwhqgl9D0hRAnSlMlcshhixvV/mmaGfx88DN1gm8=; b=sSEUWiGKj9mAYLq2oTwm4h2OnQk8Aai0K4kOCm0q9YUg98hXSSmyxrbvwrKqvy/w2Y ejsoskjxFP2DhaU+G0nGI0M2ofLHZnmUlfeoTXXsb5hjoytTSzc5tit/QSnpoZv8Wdf3 0sVEO3kEuODNoj+aGFCwDkbR52RAz4/zKahnjoD6gTh5qbTP3jDslOOyrK9YkXGIDevb Mdv6F/VLJB3ckwyWq3d/8Z4GxYJ9qHR373Qt3ey4SfkFfaSYl6G9K0g96yT0atrUce/z 0C7t3VbiSPJnVOHgJ6XnClFb2Nc5xOe8fHhlJJJ+EygFSszMaiS3nthy5wCUhBe8Q9jb WBdw== X-Gm-Message-State: AOJu0YzsU4Xo7+li1PjcC6w3CuNLMrYA1vIqwP0G+KS1xkeW50Un7FnQ C86yPLCFIu1ryIf1cu0DdsR5BeWIqz2DPNN/BWhHe+IVyJZNeDja94ewGzUaFv0JydQm5BjE+Go j X-Google-Smtp-Source: AGHT+IHXlBTIlSS1xEy1sxYFLOJbVHe+IUfl+3/uG1ye5K4nBehTjJ0WxYuGcDNXLJHPxc4FkNXOgQ== X-Received: by 2002:a05:6a00:22cc:b0:6ea:8b0c:584 with SMTP id f12-20020a056a0022cc00b006ea8b0c0584mr12207786pfj.9.1711460867364; Tue, 26 Mar 2024 06:47:47 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c3:1d04:5d3e:8d94:107e:980f]) by smtp.gmail.com with ESMTPSA id r24-20020aa78458000000b006e47e57d976sm5936055pfn.166.2024.03.26.06.47.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 06:47:46 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: Simon Chopin Subject: [PATCH] elf: Do not check for loader mmap on tst-decorate-maps (BZ 31553) Date: Tue, 26 Mar 2024 10:47:42 -0300 Message-Id: <20240326134742.526200-1-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-12.8 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 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 On some architectures and depending on the page size, the loader can also allocate some memory during dependencies loading and it will be marked as 'loader malloc'. However, if the system page size is large enough, the initial data page will be enough for all required allocation and there will be no extra loader mmap. To avoid false negatives, the test does not check for such pages. Checked on powerpc64le-linux-gnu with 64k pagesize. Reviewed-by: Simon Chopin --- elf/tst-decorate-maps.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/elf/tst-decorate-maps.c b/elf/tst-decorate-maps.c index 85ba5ce939..6d04344ba2 100644 --- a/elf/tst-decorate-maps.c +++ b/elf/tst-decorate-maps.c @@ -56,7 +56,6 @@ struct proc_maps_t int n_user_threads; int n_arenas; int n_malloc_mmap; - int n_loader_malloc_mmap; }; static struct proc_maps_t @@ -82,8 +81,12 @@ read_proc_maps (void) r.n_arenas++; else if (strstr (line, "[anon: glibc: malloc]") != NULL) r.n_malloc_mmap++; - else if (strstr (line, "[anon: glibc: loader malloc]") != NULL) - r.n_loader_malloc_mmap++; + /* On some architectures and depending on the page size, the loader can + also allocate some memory during dependencies loading and it will be + marked as 'loader malloc'. However, if the system page size is large + enough, the initial data page will be enough for all required + allocation and there will be no extra loader mmap. To avoid false + negatives, the test does not check for such pages. */ } free (line); xfclose (f); @@ -148,8 +151,6 @@ do_test_threads (bool set_guard) TEST_COMPARE (r.n_user_threads, num_user_threads); TEST_COMPARE (r.n_arenas, expected_n_arenas); TEST_COMPARE (r.n_malloc_mmap, 1); - /* On some architectures the loader might use more than one page. */ - TEST_VERIFY (r.n_loader_malloc_mmap >= 1); } /* Let the threads finish. */ @@ -164,7 +165,6 @@ do_test_threads (bool set_guard) TEST_COMPARE (r.n_user_threads, 0); TEST_COMPARE (r.n_arenas, expected_n_arenas); TEST_COMPARE (r.n_malloc_mmap, 1); - TEST_VERIFY (r.n_loader_malloc_mmap >= 1); } free (p);