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: Fri, 2 Feb 2024 17:36:34 +0800
From: zhiguojiang <justinjiang@...o.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: linux-mm@...ck.org, linux-kernel@...r.kernel.org,
 opensource.kernel@...o.com, Matthew Wilcox <willy@...radead.org>
Subject: Re: [PATCH v2] mm:vmscan: shrink skip folio mapped by an exiting task



在 2024/2/2 17:22, Andrew Morton 写道:
> On Wed, 31 Jan 2024 21:12:44 +0800 Zhiguo Jiang <justinjiang@...o.com> wrote:
>
>> --- a/mm/rmap.c
>> +++ b/mm/rmap.c
>> @@ -840,6 +840,13 @@ static bool folio_referenced_one(struct folio *folio,
>>   	int referenced = 0;
>>   	unsigned long start = address, ptes = 0;
>>   
>> +	/* Skip this folio if it's mapped by an exiting task */
>> +	if (unlikely(!atomic_read(&vma->vm_mm->mm_users)) ||
>> +		unlikely(test_bit(MMF_OOM_SKIP, &vma->vm_mm->flags))) {
>> +		pra->referenced = -1;
>> +		return false;
>> +	}
> The code comment explains what the code does.  This is, as usual,
> pretty obvious from reading the code!
>
> A better comment is one which explains *why* the code is doing what it
> does.
Yes, thank you for your recognition, and I also appreciate Matthew Wilcox's
professional and patient guidance in patch v1. I will study this 
seriously in the
future.

Best Regards.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ