linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Minchan Kim <minchan@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: 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>,
	Johannes Weiner <hannes@cmpxchg.org>
Subject: Re: [PATCH v4] mm: don't be stuck to rmap lock on reclaim path
Date: Thu, 12 May 2022 12:55:16 -0700	[thread overview]
Message-ID: <Yn1mJEjP3LH8rl3t@google.com> (raw)
In-Reply-To: <20220511190523.7d159b2e9caccbf13469e74e@linux-foundation.org>

On Wed, May 11, 2022 at 07:05:23PM -0700, Andrew Morton wrote:
> On Wed, 11 May 2022 15:57:09 -0700 Minchan Kim <minchan@kernel.org> wrote:
> 
> > > 
> > > Could we burn much CPU time pointlessly churning though the LRU?  Could
> > > it mess up aging decisions enough to be performance-affecting in any
> > > workload?
> > 
> > Yes, correct. However, we are already churning LRUs by several
> > ways. For example, isolate and putback from LRU list for page
> > migration from several sources(typical example is compaction)
> > and trylock_page and sc->gfp_mask not allowing page to be
> > reclaimed in shrink_page_list.
> 
> Well.  "we're already doing a risky thing so it's OK to do more of that
> thing"?

I meant the aging is not rocket science.


> 
> > > 
> > > Something else?
> > 
> > One thing I am worry about was the granularity of the churning.
> > Example above was page granuarity churning so might be execuse
> > but this one is address space's churning, especically for file LRU
> > (i_mmap_rwsem) which might cause too many rotating and live-lock
> > in the end(keey rotating in small LRU with heavy memory pressure).
> > 
> > If it could be a problem, maybe we use sc->priority to stop
> > the skipping on a certain level of memory pressure.
> > 
> > Any thought? Do we really need it?
> 
> Are we able to think of a test which might demonstrate any worst case? 
> Whip that up and see what the numbers say?

Yeah, let me create a worst test case to see how it goes.

A thread keep reading a file-backed vma with 2xRAM file but other threads
keep changing other vmas mapped at the same file so heavy i_mmap_rwsem
contention in aging path.

> 
> It's a bit of a drag, but if we don't do it, our users surely will ;)

      reply	other threads:[~2022-05-12 19:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-10 21:54 [PATCH v4] mm: don't be stuck to rmap lock on reclaim path Minchan Kim
2022-05-10 22:26 ` Johannes Weiner
2022-05-11 22:33 ` Andrew Morton
2022-05-11 22:57   ` Minchan Kim
2022-05-12  2:05     ` Andrew Morton
2022-05-12 19:55       ` 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=Yn1mJEjP3LH8rl3t@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).