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: 782610 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:b0:33e:7753:30bd with SMTP id p1csp1691544wrt; Tue, 26 Mar 2024 06:48:01 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUPJZRYrhuHv6hSGS8hZ7sEkEjDJWfyzd3IOX4BMMCmOg1Y93xnCPY0JpkA3d8nbi8t/ki6anj6g2GrdY1uMTxJ X-Google-Smtp-Source: AGHT+IFv1POLeLTP2rIVu1qFN1azHGgHNElYGWsxKyTqU27/us9auPqvFLtgjwg9WiJcamqP5iCr X-Received: by 2002:a05:620a:1441:b0:789:e842:a04e with SMTP id i1-20020a05620a144100b00789e842a04emr9874661qkl.39.1711460881365; Tue, 26 Mar 2024 06:48:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711460881; cv=pass; d=google.com; s=arc-20160816; b=aGcBnCZDuVIGwncq6JlivqVwayjieaUJ/Y+4G1GfdYdMZUrrqnRR8ukCwQmCpZiSuN gsbkPpDIruAi8VpEf0gXNuzZ8UWcT/c3EzjqBhyYreVDWMLrsDz2GlKl87969iuGpOfP Cy68R0fBHfPU7nilqc7jLoj8c9LpzxkHjxwB0FBqYkDxmM1R86ti3MFCnMVjKJGQcE4a qSAM0WjIrbFRD5L6SC9wMQasdvNOWBd2jfIcuf7/3qMz6rH6Jugza/JTJXvN87ild1NM 1EApJ+z8wF9LpP05HefbbVwBDT5CGP982jrPzeR2Nyzw7jt5CiEFEfN4QXzkZKZIgMPt MXRg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=Grevwhqgl9D0hRAnSlMlcshhixvV/mmaGfx88DN1gm8=; fh=GNAnomGb44Vc67//YEj4j5r10Zx6jLxEj1JVNOU+ZEM=; b=WGGCZk7v3XFTxAXf4Bd8L3PTIfRuPCI+dcIyYiFAPKbqGqE9IM7zu62vZd6u21YRYS 4JrlJRfYTyeAa4Nu3HzKICd6toZIYpYbnwN9QUcLfwKr2FpeRG3tCcHLvQkIOnsjEyjO xQhye2Jul0JowWCVitoEi8s0nN6DoQXaIc7ndCw43P9mY44SLMsUIabn4TZQmODB4Cbm bCBv4BhPgoS4ZJuf/WY/EH9YkG9190g2JdJgDbjjLIUX1PcCMpjCG7/BY6qCbMvyVb3u BipUwxyiG6gK0raWNs1zeBmZFhpy4NSGfWrFZQ825LpdGikz1qshP9TfD/q1P1pqjyfX YHBg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uX5D+1Iu; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces+patch=linaro.org@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="libc-alpha-bounces+patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id pe18-20020a05620a851200b0078a00267a7esi7213445qkn.482.2024.03.26.06.48.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 06:48:01 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-bounces+patch=linaro.org@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uX5D+1Iu; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces+patch=linaro.org@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="libc-alpha-bounces+patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EEC15385840A for ; Tue, 26 Mar 2024 13:48:00 +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-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+patch=linaro.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);