linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@suse.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: Hao Lee <haolee.swjtu@gmail.com>, Linux MM <linux-mm@kvack.org>,
	Johannes Weiner <hannes@cmpxchg.org>,
	vdavydov.dev@gmail.com, Shakeel Butt <shakeelb@google.com>,
	cgroups@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mm: reduce spinlock contention in release_pages()
Date: Mon, 29 Nov 2021 14:39:43 +0100	[thread overview]
Message-ID: <YaTYH67jSNWqYySF@dhcp22.suse.cz> (raw)
In-Reply-To: <YaTUR9WcGoOG4oLo@casper.infradead.org>

On Mon 29-11-21 13:23:19, Matthew Wilcox wrote:
> On Mon, Nov 29, 2021 at 09:39:16AM +0100, Michal Hocko wrote:
> > On Fri 26-11-21 16:26:23, Hao Lee wrote:
> > [...]
> > > I will try Matthew's idea to use semaphore or mutex to limit the number of BE
> > > jobs that are in the exiting path. This sounds like a feasible approach for
> > > our scenario...
> > 
> > I am not really sure this is something that would be acceptable. Your
> > problem is resource partitioning. Papering that over by a lock is not
> > the right way to go. Besides that you will likely hit a hard question on
> > how many tasks to allow to run concurrently. Whatever the value some
> > workload will very likely going to suffer. We cannot assume admin to
> > chose the right value because there is no clear answer for that. Not to
> > mention other potential problems - e.g. even more priority inversions
> > etc.
> 
> I don't see how we get priority inversions.  These tasks are exiting; at
> the point they take the semaphore, they should not be holding any locks.
> They're holding a resource (memory) that needs to be released, but a
> task wanting to acquire memory must already be prepared to sleep.

At least these scenarios come to mind
- a task being blocked by other lower priority tasks slowly tearing down
  their address space - essentially a different incarnation of the same
  problem this is trying to handle
- a huge memory backed task waiting many for smaller ones to finish
- waste of resources on properly partitioned systems. Why should
  somebody block tasks when they are acting on different lruvecs and
  cpus?

-- 
Michal Hocko
SUSE Labs


  reply	other threads:[~2021-11-29 13:40 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-24 15:19 Hao Lee
2021-11-24 15:57 ` Matthew Wilcox
2021-11-25  3:13   ` Hao Lee
2021-11-24 16:31 ` Michal Hocko
2021-11-25  3:24   ` Hao Lee
2021-11-25  3:30     ` Matthew Wilcox
2021-11-25  8:02       ` Hao Lee
2021-11-25 10:01         ` Michal Hocko
2021-11-25 12:31           ` Hao Lee
2021-11-25 14:18             ` Michal Hocko
2021-11-26  6:50               ` Hao Lee
2021-11-26 10:46                 ` Michal Hocko
2021-11-26 16:26                   ` Hao Lee
2021-11-29  8:39                     ` Michal Hocko
2021-11-29 13:23                       ` Matthew Wilcox
2021-11-29 13:39                         ` Michal Hocko [this message]
2021-11-25 18:04         ` Matthew Wilcox
2021-11-26  6:54           ` Hao Lee

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=YaTYH67jSNWqYySF@dhcp22.suse.cz \
    --to=mhocko@suse.com \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=haolee.swjtu@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=shakeelb@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