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] [day] [month] [year] [list]
Date:   Sat, 11 Nov 2023 18:57:24 +0800
From:   Kefeng Wang <wangkefeng.wang@...wei.com>
To:     Matthew Wilcox <willy@...radead.org>
CC:     Andrew Morton <akpm@...ux-foundation.org>,
        <linux-kernel@...r.kernel.org>, <linux-mm@...ck.org>,
        David Hildenbrand <david@...hat.com>,
        Gregory Price <gregory.price@...verge.com>
Subject: Re: [PATCH v2 5/7] mm: task_mmu: use a folio in smaps_account()



On 2023/11/11 2:29, Matthew Wilcox wrote:
> On Fri, Nov 10, 2023 at 11:33:22AM +0800, Kefeng Wang wrote:
>> Replace seven implicit calls to compound_head() with one page_folio().
> 
> You're so focused on trying to accomplish your goal (killing off the
> page_idle and page_young functions) that you're doing a poor job thinkig
> about the conversions you're doing along the way.
> 
>> +++ b/fs/proc/task_mmu.c
>> @@ -445,23 +445,25 @@ static void smaps_account(struct mem_size_stats *mss, struct page *page,
>>   {
>>   	int i, nr = compound ? compound_nr(page) : 1;
>>   	unsigned long size = nr * PAGE_SIZE;
>> +	struct folio *folio = page_folio(page);
> 
> Stop right here.  The use of compound_nr() should give you pause.
> 
> After looking at how smaps_account() is used, it seems to me that the
> two callers should each pass in PAGE_SIZE or PMD_SIZE instead of doing
> this calculation.

Yes,this will save extra calculation

> 
> More generally, step back from this series.  Do a good job of
> transforming fs/proc/task_mmu.c to use folios.  Once you've done
> that, you can approach the young/idle work again.
> 
Thanks for you advise,will try this firstly.
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ