From: Peter Zijlstra <peterz@infradead.org>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@kernel.org>,
Steven Rostedt <rostedt@goodmis.org>,
Will Deacon <will@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
"Paul E . McKenney" <paulmck@kernel.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org
Subject: Re: [PATCH 4/8] mm/swap: Use local_lock for protection
Date: Wed, 20 May 2020 12:53:22 +0200 [thread overview]
Message-ID: <20200520105322.GG317569@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20200519201912.1564477-5-bigeasy@linutronix.de>
On Tue, May 19, 2020 at 10:19:08PM +0200, Sebastian Andrzej Siewior wrote:
> diff --git a/mm/swap.c b/mm/swap.c
> index bf9a79fed62d7..03c97d15fcd69 100644
> --- a/mm/swap.c
> +++ b/mm/swap.c
> @@ -44,8 +44,14 @@
> /* How many pages do we try to swap or page in/out together? */
> int page_cluster;
>
> -static DEFINE_PER_CPU(struct pagevec, lru_add_pvec);
> +
> +/* Protecting lru_rotate_pvecs */
> +static DEFINE_LOCAL_LOCK(rotate_lock);
> static DEFINE_PER_CPU(struct pagevec, lru_rotate_pvecs);
> +
> +/* Protecting the following struct pagevec */
> +DEFINE_LOCAL_LOCK(swapvec_lock);
> +static DEFINE_PER_CPU(struct pagevec, lru_add_pvec);
> static DEFINE_PER_CPU(struct pagevec, lru_deactivate_file_pvecs);
> static DEFINE_PER_CPU(struct pagevec, lru_deactivate_pvecs);
> static DEFINE_PER_CPU(struct pagevec, lru_lazyfree_pvecs);
So personally I'd prefer to have this look like:
struct lru_vecs {
struct local_lock lock;
struct pagevec add;
struct pagevec rotate;
struct pagevec deact_file;
struct pagevec deact;
struct pagevec lazyfree;
#ifdef CONFIG_SMP
struct pagevec active;
#endif
};
DEFINE_PER_CPU(struct lru_pvec, lru_pvec);
or something, but I realize that is a lot of churn (although highly
automated), so I'll leave that to the mm folks.
next prev parent reply other threads:[~2020-05-20 10:53 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20200519201912.1564477-1-bigeasy@linutronix.de>
2020-05-19 20:19 ` [PATCH 4/8] mm/swap: Use local_lock for protection Sebastian Andrzej Siewior
2020-05-19 23:58 ` Andrew Morton
2020-05-20 2:17 ` Matthew Wilcox
2020-05-20 10:53 ` Peter Zijlstra [this message]
2020-05-19 20:19 ` [PATCH 8/8] mm/zswap: Use local lock to protect per-CPU data Sebastian Andrzej Siewior
2020-05-19 21:46 ` Song Bao Hua
2020-05-20 10:26 ` Sebastian Andrzej Siewior
2020-05-20 11:13 ` Song Bao Hua
2020-05-20 11:57 ` Sebastian Andrzej Siewior
2020-05-20 12:01 ` Song Bao Hua
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=20200520105322.GG317569@hirez.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=akpm@linux-foundation.org \
--cc=bigeasy@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mingo@kernel.org \
--cc=paulmck@kernel.org \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--cc=will@kernel.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).