lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 26 Sep 2023 15:57:10 +0800
From:   Yajun Deng <yajun.deng@...ux.dev>
To:     David Hildenbrand <david@...hat.com>, akpm@...ux-foundation.org,
        rppt@...nel.org
Cc:     mike.kravetz@...cle.com, muchun.song@...ux.dev,
        willy@...radead.org, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 1/2] mm: pass page count and reserved to
 __init_single_page


On 2023/9/26 15:44, David Hildenbrand wrote:
> On 26.09.23 04:33, Yajun Deng wrote:
>> When we init a single page, we need to mark this page reserved if it
>> does. 
>
> I failed to parse the last part of this sentence.
>
>> And some pages may not need to set page count, such as compound
>> pages.
>
> Usually, the refcount of all tail pages *must* be zero. Otherwise, 
> get_page_unless_zero() would work on tail pages.
>
> Can you elaborate why it should be okay here?
>
>
It means the following code in memmap_init_compound().

-               __init_zone_device_page(page, pfn, zone_idx, nid, pgmap);
+               __init_zone_device_page(page, pfn, zone_idx, nid, pgmap, 0);
                 prep_compound_tail(head, pfn - head_pfn);
                 set_page_count(page, 0);

As we can see, it will reset the page count by 'set_page_count(page, 0)'.

Therefore, we don't need to set page count in __init_zone_device_page(). 
I wasn't clear enough in the commit.

Maybe we can remove the 'set_page_count(page, 0)',  But I didn't do 
that, just to be safe.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ