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]
Message-ID: <1db60157-9f26-cc09-9a8d-2813a3a3ac95@linux.alibaba.com>
Date:   Fri, 24 Jun 2022 16:41:47 +0800
From:   Baolin Wang <baolin.wang@...ux.alibaba.com>
To:     Matthew Wilcox <willy@...radead.org>
Cc:     akpm@...ux-foundation.org, rppt@...ux.ibm.com, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH v2 1/3] mm: Factor out the pagetable pages account
 into new helper function



On 6/24/2022 12:07 AM, Matthew Wilcox wrote:
> On Wed, Jun 22, 2022 at 04:58:52PM +0800, Baolin Wang wrote:
>> +static inline void pgtable_set_and_inc(struct page *page)
>> +{
>> +	__SetPageTable(page);
>> +	inc_lruvec_page_state(page, NR_PAGETABLE);
>> +}
> 
> I don't like the names.  The accounting is also wrong for non-order-0
> allocations.  It should be
> 
> 	mod_lruvec_page_state(page, NR_PAGETABLE, compound_nr(page))

Yes, seems need another patch to convert using compound_nr().

> 
> but it's probably better to change the API to pass in the number of
> pages instead of recalculating it.

Lots of callers will not calculate the number of pages, so I think we 
can just add the compound_nr() in the API firstly, which also can avoid 
changing lots of callers.

> I can't think of a good name.  What's wrong with just adding
> 
> static inline bool pgtable_pud_page_ctor(struct page *page)
> 
> to go along with the pte and pmd variants?

IMHO that means we will need another function like 
pgtable_kernel_pte_page_ctor/dtor() to account kernel pagetable, however 
they do the same thing. So a common function which only do 
'__SetPageTable' and account pagetable will be more helpful.

So how about pgtable_page_inc()/pgtable_page_dec()?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ