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, 12 Apr 2022 11:07:29 +0800
From:   Miaohe Lin <linmiaohe@...wei.com>
To:     "ying.huang@...el.com" <ying.huang@...el.com>
CC:     <songmuchun@...edance.com>, <hch@...radead.org>,
        <willy@...radead.org>, <linux-mm@...ck.org>,
        <linux-kernel@...r.kernel.org>,
        Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH v2 1/9] mm/vmscan: add a comment about MADV_FREE pages
 check in folio_check_dirty_writeback

On 2022/4/11 19:50, ying.huang@...el.com wrote:
> On Sat, 2022-04-09 at 17:34 +0800, Miaohe Lin wrote:
>> The MADV_FREE pages check in folio_check_dirty_writeback is a bit hard to
>> follow. Add a comment to make the code clear.
>>
>> Suggested-by: Huang, Ying <ying.huang@...el.com>
>> Signed-off-by: Miaohe Lin <linmiaohe@...wei.com>
>> ---
>>  mm/vmscan.c | 3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/mm/vmscan.c b/mm/vmscan.c
>> index c77d5052f230..4a76be47bed1 100644
>> --- a/mm/vmscan.c
>> +++ b/mm/vmscan.c
>> @@ -1436,6 +1436,9 @@ static void folio_check_dirty_writeback(struct folio
>> *folio,
>>         /*
>>          * Anonymous pages are not handled by flushers and must be written
>>          * from reclaim context. Do not stall reclaim based on them
>> +        * MADV_FREE anonymous pages are put into inactive file list too.
>> +        * They could be mistakenly treated as file lru. So further anon
>> +        * test is needed.
>>          */
> 
> How about something as follows,
> 
> 	/*
>          * Anonymous pages (including MADV_FREE ones) are not handled
> by	 * flushers and must be written from reclaim context. Do not stall
> 	 * reclaim based on them
> 	 */.
> 

This comment looks good but it seems it doesn't explain the MADV_FREE check logic.
Is this already enough? If so, will change to use this. Thanks!

> Best Regards,
> Huang, Ying
> 
>>         if (!folio_is_file_lru(folio) ||
>>             (folio_test_anon(folio) && !folio_test_swapbacked(folio))) {
> 
> 
> .
> 

Powered by blists - more mailing lists