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:   Mon, 12 Jul 2021 19:16:47 +0800
From:   Miaohe Lin <linmiaohe@...wei.com>
To:     Michal Hocko <mhocko@...e.com>
CC:     <akpm@...ux-foundation.org>, <hannes@...xchg.org>,
        <vbabka@...e.cz>, <axboe@...nel.dk>, <iamjoonsoo.kim@....com>,
        <alexs@...nel.org>, <apopple@...dia.com>, <willy@...radead.org>,
        <minchan@...nel.org>, <david@...hat.com>, <shli@...com>,
        <hillf.zj@...baba-inc.com>, <linux-mm@...ck.org>,
        <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 5/5] mm/vmscan: fix misleading comment in
 isolate_lru_pages()

On 2021/7/12 15:28, Michal Hocko wrote:
> On Sat 10-07-21 18:03:29, Miaohe Lin wrote:
>> We couldn't know whether the page is being freed elsewhere until we failed
>> to increase the page count.
> 
> This is moving a hard to understand comment from one place to another.

If get_page_unless_zero failed, the page could have been freed elsewhere. I think
this looks straightforward but doesn't help a lot. Are you preferring to just
remove this comment ?

Thank you.

> If anything this would benefit from what that elsewhere might be
> typically or simply drop the comment altogether.
> 
>>
>> Signed-off-by: Miaohe Lin <linmiaohe@...wei.com>
>> ---
>>  mm/vmscan.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/mm/vmscan.c b/mm/vmscan.c
>> index a74760c48bd8..6e26b3c93242 100644
>> --- a/mm/vmscan.c
>> +++ b/mm/vmscan.c
>> @@ -1891,7 +1891,6 @@ static unsigned long isolate_lru_pages(unsigned long nr_to_scan,
>>  		 */
>>  		scan += nr_pages;
>>  		if (!__isolate_lru_page_prepare(page, mode)) {
>> -			/* It is being freed elsewhere */
>>  			list_move(&page->lru, src);
>>  			continue;
>>  		}
>> @@ -1901,6 +1900,7 @@ static unsigned long isolate_lru_pages(unsigned long nr_to_scan,
>>  		 * page release code relies on it.
>>  		 */
>>  		if (unlikely(!get_page_unless_zero(page))) {
>> +			/* It is being freed elsewhere. */
>>  			list_move(&page->lru, src);
>>  			continue;
>>  		}
>> -- 
>> 2.23.0
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ