linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: Zhiguo Jiang <justinjiang@vivo.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Cc: opensource.kernel@vivo.com
Subject: Re: [PATCH] mm/rmap: vm_flags including VM_EXEC can exit timely
Date: Tue, 24 Oct 2023 17:51:47 +0200	[thread overview]
Message-ID: <a1357e75-986a-4e00-a987-9d8c767a42a5@redhat.com> (raw)
In-Reply-To: <20231024144913.421-1-justinjiang@vivo.com>

On 24.10.23 16:49, Zhiguo Jiang wrote:
> When pra->vm_flags include VM_EXEC flag and folio is file detected in
> folio_referenced_one(), the folio referenced traversal process can be
> exited timely to reduce the detecting folio referenced time.
> 

Can you further elaborate what the logic behind that is?

Why can we stop here if we're dealing with a pagecache folio in an 
executable VMA?

> Signed-off-by: Zhiguo Jiang <justinjiang@vivo.com>
> ---
>   mm/rmap.c | 2 ++
>   1 file changed, 2 insertions(+)
>   mode change 100644 => 100755 mm/rmap.c
> 
> diff --git a/mm/rmap.c b/mm/rmap.c
> index 7a27a2b41802..932f3b7e8521
> --- a/mm/rmap.c
> +++ b/mm/rmap.c
> @@ -884,6 +884,8 @@ static bool folio_referenced_one(struct folio *folio,
>   	if (referenced) {
>   		pra->referenced++;
>   		pra->vm_flags |= vma->vm_flags & ~VM_LOCKED;
> +		if ((pra->vm_flags | VM_EXEC) && folio_is_file_lru(folio))
> +			return false;
>   	}
>   
>   	if (!pra->mapcount)

-- 
Cheers,

David / dhildenb



       reply	other threads:[~2023-10-24 15:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20231024144913.421-1-justinjiang@vivo.com>
2023-10-24 15:51 ` David Hildenbrand [this message]
     [not found]   ` <d1c01214-4548-414d-be84-21c38cfe3ede@vivo.com>
     [not found]     ` <d2d78a5b-fa57-4e46-950d-e8e48bb020be@vivo.com>
2023-10-25 15:04       ` David Hildenbrand

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=a1357e75-986a-4e00-a987-9d8c767a42a5@redhat.com \
    --to=david@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=justinjiang@vivo.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=opensource.kernel@vivo.com \
    /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