linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: zhiguojiang <justinjiang@vivo.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	opensource.kernel@vivo.com, Matthew Wilcox <willy@infradead.org>
Subject: Re: [PATCH v2] mm:vmscan: shrink skip folio mapped by an exiting task
Date: Fri, 2 Feb 2024 17:36:34 +0800	[thread overview]
Message-ID: <0f8d2f71-c77b-4804-b762-cc40f23f88cd@vivo.com> (raw)
In-Reply-To: <20240202012251.1aa5afbfdf2f8b3a862bced3@linux-foundation.org>



在 2024/2/2 17:22, Andrew Morton 写道:
> On Wed, 31 Jan 2024 21:12:44 +0800 Zhiguo Jiang <justinjiang@vivo.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.



      reply	other threads:[~2024-02-02  9:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-31 13:12 Zhiguo Jiang
2024-02-02  9:22 ` Andrew Morton
2024-02-02  9:36   ` zhiguojiang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0f8d2f71-c77b-4804-b762-cc40f23f88cd@vivo.com \
    --to=justinjiang@vivo.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=opensource.kernel@vivo.com \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox