All of lore.kernel.org
 help / color / mirror / Atom feed
From: Minchan Kim <minchan@kernel.org>
To: Johannes Weiner <hannes@cmpxchg.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-mm <linux-mm@kvack.org>,
	Suren Baghdasaryan <surenb@google.com>,
	Michal Hocko <mhocko@suse.com>, John Dias <joaodias@google.com>,
	Tim Murray <timmurray@google.com>,
	Matthew Wilcox <willy@infradead.org>,
	Vladimir Davydov <vdavydov.dev@gmail.com>,
	Martin Liu <liumartin@google.com>
Subject: Re: [PATCH v3] mm: don't be stuck to rmap lock on reclaim path
Date: Tue, 10 May 2022 14:44:38 -0700	[thread overview]
Message-ID: <YnrcxjN9SRgHS05s@google.com> (raw)
In-Reply-To: <Ynqr57CVLPOqwhZa@cmpxchg.org>

On Tue, May 10, 2022 at 02:16:07PM -0400, Johannes Weiner wrote:
> Hi Minchan,
> 
> The patch looks reasonable to me, but one thing stands out:
> 
> On Tue, May 10, 2022 at 10:11:00AM -0700, Minchan Kim wrote:
> > @@ -1391,6 +1391,10 @@ static enum page_references folio_check_references(struct folio *folio,
> >  	if (vm_flags & VM_LOCKED)
> >  		return PAGEREF_ACTIVATE;
> >  
> > +	/* page_referenced didn't work due to lock contention */
> > +	if (referenced_ptes == -1)
> > +		return PAGEREF_KEEP;
> > +
> >  	if (referenced_ptes) {
> >  		/*
> >  		 * All mapped folios start out with page table
> 
> This means contended inactive pages get rotated.
> 
> > @@ -2492,7 +2496,7 @@ static void shrink_active_list(unsigned long nr_to_scan,
> >  		}
> >  
> >  		if (folio_referenced(folio, 0, sc->target_mem_cgroup,
> > -				     &vm_flags)) {
> > +				     &vm_flags) > 0) {
> >  			/*
> >  			 * Identify referenced, file-backed active pages and
> >  			 * give them one more trip around the active list. So
> 
> This means contended active pages do NOT get rotated.
> 
> It's a bit of an arbitrary choice what to do with reclaim candidates
> for which you can get no reference information, but staying consistent
> is likely a good idea. My preference would be to just rotate contended
> pages throughout rather than risk dropping the workingset on the floor.
> 
> 		/* Referenced or rmap lock contention: rotate */
> 		if (folio_referenced() != 0) {
> 			...
> 
> What do you think?

Sure, it's good start before adding more heuristic later.

Thanks for the review. I will post v4.


      reply	other threads:[~2022-05-10 21:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-10 17:11 [PATCH v3] mm: don't be stuck to rmap lock on reclaim path Minchan Kim
2022-05-10 18:16 ` Johannes Weiner
2022-05-10 21:44   ` Minchan Kim [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=YnrcxjN9SRgHS05s@google.com \
    --to=minchan@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=joaodias@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=liumartin@google.com \
    --cc=mhocko@suse.com \
    --cc=surenb@google.com \
    --cc=timmurray@google.com \
    --cc=vdavydov.dev@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.