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=-0.1 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,RCVD_IN_SORBS_WEB,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 670B61F44D for ; Mon, 22 Apr 2024 10:55:38 +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=BlsbJh5s; dkim-atps=neutral Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EAB28385840F for ; Mon, 22 Apr 2024 10:55:36 +0000 (GMT) Received: from smtp-relay-internal-1.canonical.com (smtp-relay-internal-1.canonical.com [185.125.188.123]) by sourceware.org (Postfix) with ESMTPS id 7C19F3858D38 for ; Mon, 22 Apr 2024 10:55:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7C19F3858D38 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 7C19F3858D38 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=185.125.188.123 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713783318; cv=none; b=c7h6f/F6pQjs/7XGPiSnlSSk8qUWoY/k5XDF5vvJ4RrII/IFVIE8Lka5XQmjtdFqDRDqtlRgrS4MIKq+K9hAmQoshYweZCRvAixFoWKAtjn/a6mH9vWxO3Gfi1yqRixJzHXDjoRfIaJCXfHUtur+CHQUJvRkDqmebrVQ1IUkmnw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713783318; c=relaxed/simple; bh=RBDjF/+toUIfmtC9YYHC6fKl70UVEQEKOEBUamLpZrI=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=r3cU6+PZEs9Snr+kLiWCCneLSqItvT++l7Sr8IqHoEXMsXe/o2AJFIQOaNI3WC3Dfrm5IW4Z5DdWaW2LTJTfw3paBDwypPTPOEjs//J3L1YJbmn3w5ZpZ/6/KwVO2gC6WXjLCnQxzJPM+mcb/gwjqdp59Hzo5TdcOLFsdvDQRBQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from mail-oa1-f72.google.com (mail-oa1-f72.google.com [209.85.160.72]) (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-1.canonical.com (Postfix) with ESMTPS id 82A223F626 for ; Mon, 22 Apr 2024 10:55:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1713783315; bh=+SFKKM0qSG8Ru3dFDn2syi8YyvHc+pYEDWl1hmb0m+A=; h=MIME-Version:From:In-Reply-To:References:Date:Message-ID:Subject: To:Cc:Content-Type; b=BlsbJh5swKvxcXFHg37lrSkp0d3fF9JlOjrWiWf4eDyLyaF30r/vlDu/j3Q+CQKRQ kd9NuQZfMxxxZwEASg2m1FEWP2GQaw6GaWH3IVgnS2bScM0idFAywB4BUvfVWsTDA4 gCfPncnLxXJ+qPakO7pjVDgtL38HF2RFS4FsFK4IE+2hiPfnueVNKUS+fBGwJkqTaZ +ODk3IwuZFcvWvcmx4faT0DGHSq6WZMQipN0yFxlWqsizVwNa7c3apCht+cI+3rccK ELR4willFML+jfaMUPmu7HVBdjJANhZdkMsdNuE35HXyM97oQ+gfaB5YWxjDDyaV8D uz02MwK2DgbDQ== Received: by mail-oa1-f72.google.com with SMTP id 586e51a60fabf-22ed3aaf340so4025971fac.2 for ; Mon, 22 Apr 2024 03:55:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713783314; x=1714388114; 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=+SFKKM0qSG8Ru3dFDn2syi8YyvHc+pYEDWl1hmb0m+A=; b=a1YF/E98eNpfEvVZAP8UwXn+s9tGkVJqMjMFU3ln6kJEGikoAg5+ZT1HwH5ZP5IFfe lIQP849DuMSn3ns1G/LewOI0rHTAqqw/Ix7cFnYS56yGwe4ta+AjI+MdTB2gV6aXfK/I WTyjqryHNABhMF2SyBThs+03sYJn7NjAz0oc26USHDB1tpCFLwxxQHJ2k0Y0IRlqz6jD /J4ZSK/uMrMIxf/4fAlFE88UjewpWKPOeKGByzWT1g86aZlMaBK/Bfq5x3F8PcyveDok 9y5D6elPpD4CP2w/NCKk7+poRRPNYwNB782C0wGfdF6lVaKQ+VuqoBIhSYRG6N8yQSrq t4TA== X-Gm-Message-State: AOJu0YyV7rYSUwHcb82XBQvS5Q2+KfcsCoaVdvtVWc3IW49EJX73oWSz ScXUpQZF04OCPljtScuxm+LWazAZAY2lFc2uWkOLyEVshJmizPEQsOo3Tds3G3CFWyaPejS8ou0 L1M+mhkAK/JSYU51Nk4WYx9T6WyB8yIySKz1ZxhjeyIyMAcxIPuZPmYjfANlMBQIkTV2iyal+GW 3etadvXqSDNpb5PUm3THBa7rso39CTmFmyVFfz9NvvMb7eajPQrthoZ0rG X-Received: by 2002:a05:6870:7b48:b0:233:b5dd:471c with SMTP id ji8-20020a0568707b4800b00233b5dd471cmr11179177oab.51.1713783313944; Mon, 22 Apr 2024 03:55:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGQPuoFQVIVc9LY4rFr9ySE4d33h9hGGT3MOI2aEiGWSMTCJJsu0mh9qQWCyIg1uvrtHkoVWjmNCOl5asxoMRA= MIME-Version: 1.0 X-Received: by 2002:a05:6870:7b48:b0:233:b5dd:471c with SMTP id ji8-20020a0568707b4800b00233b5dd471cmr11179169oab.51.1713783313689; Mon, 22 Apr 2024 03:55:13 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Mon, 22 Apr 2024 06:55:12 -0400 From: Simon Chopin User-Agent: Dodo In-Reply-To: <20240326134742.526200-1-adhemerval.zanella@linaro.org> References: <20240326134742.526200-1-adhemerval.zanella@linaro.org> Date: Mon, 22 Apr 2024 06:55:12 -0400 Message-ID: Subject: RE: [PATCH] elf: Do not check for loader mmap on tst-decorate-maps (BZ 31553) To: Adhemerval Zanella 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 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. > --- > 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. 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 >