From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on starla X-Spam-Level: X-Spam-Status: No, score=-1.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 4B79F1F44D for ; Mon, 22 Apr 2024 15:35:36 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=ivq2pPvC; dkim-atps=neutral Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8D1D53858C78 for ; Mon, 22 Apr 2024 15:35:35 +0000 (GMT) Received: from smtp-relay-internal-0.canonical.com (smtp-relay-internal-0.canonical.com [185.125.188.122]) by sourceware.org (Postfix) with ESMTPS id D913B384AB60 for ; Mon, 22 Apr 2024 15:34:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D913B384AB60 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=canonical.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=canonical.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D913B384AB60 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=185.125.188.122 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713800076; cv=none; b=CRP6NIKjvBvcIz9YXsX5ojCDhPvkYqDMstrZU0b6ilC6kloj0w2uTUfJznTeD9oi4ZITdLF4+335ZWDdc+bY8p7ATaM0kIZQBUny+tqyImkFZuzDTcFh32f+SguuRo4cxXiggKKGZXYAGN5eYgDxQcXUdTawEOGNz0hZI2vtklw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713800076; c=relaxed/simple; bh=+mciaJ8Ssk+FBEb00L/ikm5VNYzoY5yw00wFj6rnMBM=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=U9MxAQDjlO8/H10etrkr36+cjtrK18WpPSYF+MCq34cjXUpO7jCyp0GaZekF8U1YWf8nmhxwGjzNuRcwZVxiOelOHXppzvPq4rjWztZuA0EfKt3wdQ+sRKGfkTQH9Dww8M91lIv0PtEbYQwCmnaQXEBvzFzq4PKTn3rIr+YrsWg= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id B4A4A3F16A for ; Mon, 22 Apr 2024 14:58:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1713797921; bh=ZUyls1hYxo7Hbpq1luSFVioDc2Sq3OgLegtsyiOKNOQ=; h=MIME-Version:From:In-Reply-To:References:Date:Message-ID:Subject: To:Cc:Content-Type; b=ivq2pPvCzz24aRDb8qPvV5cSKtrzCVumk67KuN428t+RFwSfiuGv1I2owSqmsXpzQ r4b/mjeIxPOHmREj+sEMI+C3gLO4YTGPF10u7SuK+KvdDWJ4/SGzRr+jiD/NpowR3E aVb3ElLfXTM6NuAZ9EZVHUmp2dZlTiSC2SAXPrAhQvk4jF86qV3hD2hVrKDWoUdndV WqgupQ0fKYqG1SlX/gVMYFKL9yTABUDQ3iAY97RbJn2uricUSHmqw4BNlfpA/uOKpi 4xqFfZ80jZOFPyEwTNfjGIjW3FgiQOjXaxeuhF4PlYEabzhGKHDbxkTSl2zpSaWIR0 V0rVuHd+0kW1g== Received: by mail-pj1-f71.google.com with SMTP id 98e67ed59e1d1-2a4a2cace80so5109412a91.3 for ; Mon, 22 Apr 2024 07:58:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713797920; x=1714402720; h=cc:to:subject:message-id:date:references:in-reply-to:user-agent :from:mime-version:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ZUyls1hYxo7Hbpq1luSFVioDc2Sq3OgLegtsyiOKNOQ=; b=wEkmbkeWnjacuBq9dQHFdYtYfHMPdMhiI9/jqo6LGiMoVtI8FkCJ/RWfuHJGY2uPdM MO53VQ/F6KwtkFSMzieVpnUR9S1zDvHN/8hNz4vwX6GctJLaJ3B0B3zhA4PyhCsH47oV eoUSqtQX1aaXz5E+GHyNRf2opAbvEnEgsZoDABOungClcu0rk2o961HiBnVu3FU/Bi3t FWZF7XTzFrPhTXfmWa3euQ5EJYjnmYeSWmucH010WXnAeKfYZHqp5rJ1DnkVHpuBRrXo RvqDr6Jw5WSFMb0uLsLj2c265IKc/TdVsBSfgUlrfe53J7S8yIiGC6lgi6ceRZptf/+5 e4rw== X-Gm-Message-State: AOJu0YzkSGPzR239IhvDQw4vEsN4zMNTPBlPZLM5XFESniVjGC/lt8eh 1ht1XuBuu5c7ZmGI0Wzsq2eJIJ8pSLaRoqbXBGRwl/dIdxcdmXQfjwlUdsNMhGMCltusU+0enpQ pjqlulzKDiNN5VGbZ76uqziLrRnU9j6cW65jiLCO/IuNXZG7C9IgcNsZIlBwsDu32vO4g4fIbpg v9doLYSC4WyrIlz/EucIB/OnFG1o9YHaQ91YfSOXvPeK+nZB4c X-Received: by 2002:a17:90b:2ed0:b0:2ae:43f:a3e6 with SMTP id ss16-20020a17090b2ed000b002ae043fa3e6mr2419327pjb.38.1713797920350; Mon, 22 Apr 2024 07:58:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFUoxi3FK2ApnklHZcf6MoAVIeyEPWV8x2G1AzpLNWpo2ooWyvvRVjHWFDZqRcMgvJgbXX6au+uGEH+mld3VUI= MIME-Version: 1.0 X-Received: by 2002:a17:90b:2ed0:b0:2ae:43f:a3e6 with SMTP id ss16-20020a17090b2ed000b002ae043fa3e6mr2419306pjb.38.1713797919940; Mon, 22 Apr 2024 07:58:39 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Mon, 22 Apr 2024 07:58:39 -0700 From: Simon Chopin User-Agent: Dodo In-Reply-To: References: <20240326134742.526200-1-adhemerval.zanella@linaro.org> Date: Mon, 22 Apr 2024 07:58:39 -0700 Message-ID: Subject: Re: [PATCH] elf: Do not check for loader mmap on tst-decorate-maps (BZ 31553) To: Adhemerval Zanella Netto Cc: libc-alpha@sourceware.org Content-Type: text/plain; charset="UTF-8" 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+e=80x24.org@sourceware.org On lun. 22 avril 2024 10:11:47, Adhemerval Zanella Netto wrote: > On 22/04/24 07:55, Simon Chopin wrote: > > On mar. 26 mars 2024 10:47:42, Adhemerval Zanella wrote: > >> 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. > > > > Tested in similar conditions. > > Altogether it looks good, I just have one minor whitespace nitpick. > > 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; > > > > OK > > > >> }; > >> > >> 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. */ > > > > Whitespace mixup here? The first line of the comment block appears to be > > using a different indentation to the rest of the block. > > Hum, I used whitespace because it does not really fit for the indentation > of the 'while'. The rest of patch use tab because it then allows it. Fair enough. > > > > > Good call on leaving an explicit comment! > > > >> } > >> 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); > > > > OK > > > >> } > >> > >> /* 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); > > > > OK > > > >> } > >> > >> free (p); > >> -- > >> 2.34.1 > >>