linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org, tglx@linutronix.de, frederic@kernel.org,
	Christoph Lameter <cl@linux.com>,
	anna-maria@linutronix.de
Subject: Re: [PATCH 0/4 v2] mm/swap: Add locking for pagevec
Date: Fri, 26 Apr 2019 10:00:54 +0200	[thread overview]
Message-ID: <20190426080054.6ngpnz2plqr4mwt2@linutronix.de> (raw)
In-Reply-To: <20190424121552.GD19031@bombadil.infradead.org>

On 2019-04-24 05:15:52 [-0700], Matthew Wilcox wrote:
> On Wed, Apr 24, 2019 at 01:12:04PM +0200, Sebastian Andrzej Siewior wrote:
> > The swap code synchronizes its access to the (four) pagevec struct
> > (which is allocated per-CPU) by disabling preemption. This works and the
> > one struct needs to be accessed from interrupt context is protected by
> > disabling interrupts. This was manually audited and there is no lockdep
> > coverage for this.
> > There is one case where the per-CPU of a remote CPU needs to be accessed
> > and this is solved by started a worker on the remote CPU and waiting for
> > it to finish.
> > 
> > In v1 [0] it was attempted to add per-CPU spinlocks for the access to
> > struct. This would add lockdep coverage and access from a remote CPU so
> > the worker wouldn't be required.
> 
> >From my point of view, what is missing from this description is why we
> want to be able to access these structs from a remote CPU.  It's explained
> a little better in the 4/4 changelog, but I don't see any numbers that
> suggest what kinds of gains we might see (eg "reduces power consumption
> by x% on a particular setup", or even "average length of time in idle
> extended from x ms to y ms").

Pulling out a CPU from idle or userland computation looks bad. In the
first series I had numbers how long it takes to compute the loop for all
per-CPU data from one CPU vs the workqueue. Somehow the uncontended lock
was bad as per krobot report while I never got stable numbers from that
test.
The other motivation is RT where we need proper locking and can't use
that preempt-disable based locking.

Sebastian


  reply	other threads:[~2019-04-26  8:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-24 11:12 Sebastian Andrzej Siewior
2019-04-24 11:12 ` [PATCH 1/4] mm/page_alloc: Split drain_local_pages() Sebastian Andrzej Siewior
2019-04-24 11:12 ` [PATCH 2/4] mm/swap: Add static key dependent pagevec locking Sebastian Andrzej Siewior
2019-04-24 11:12 ` [PATCH 3/4] mm/swap: Access struct pagevec remotely Sebastian Andrzej Siewior
2019-04-24 11:12 ` [PATCH 4/4] mm/swap: Enable "use_pvec_lock" nohz_full dependent Sebastian Andrzej Siewior
2019-04-24 12:15 ` [PATCH 0/4 v2] mm/swap: Add locking for pagevec Matthew Wilcox
2019-04-26  8:00   ` Sebastian Andrzej Siewior [this message]
2020-06-16 16:55   ` Marcelo Tosatti

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=20190426080054.6ngpnz2plqr4mwt2@linutronix.de \
    --to=bigeasy@linutronix.de \
    --cc=anna-maria@linutronix.de \
    --cc=cl@linux.com \
    --cc=frederic@kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=tglx@linutronix.de \
    --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