From: Mel Gorman <mgorman@suse.de>
To: Jeff Layton <jeff.layton@primarydata.com>
Cc: Jerome Marchand <jmarchan@redhat.com>,
Jeff Layton <jlayton@primarydata.com>,
'Linux-MM' <linux-mm@kvack.org>,
'linux-kernel' <linux-kernel@vger.kernel.org>
Subject: Re: swap: nfs: Sleeping function called from an rcu read section in nfs_swap_activate
Date: Tue, 2 Jun 2015 13:14:42 +0100 [thread overview]
Message-ID: <20150602121442.GD26425@suse.de> (raw)
In-Reply-To: <20150528072434.2e7123b1@synchrony.poochiereds.net>
On Thu, May 28, 2015 at 07:24:34AM -0400, Jeff Layton wrote:
> > > 1) this is not done under a lock, so the non-atomic ++/-- is racy if
> > > there are multiple swapons/swapoffs running concurrently on the same
> > > xprt. Shouldn't those use an atomic?
> > >
> >
> > It would be more appropriate to use atomics. It's a long time ago but I
> > doubt I considered the possibility of multiple swapons racing at the
> > time of implementation. Activation is typically a serialised task run
> > from init.
> >
> > > 2) on enable, "swapper" is incremented and memalloc is set on the
> > > socket. Do we need to do xs_set_memalloc every time swapon is called,
> > > or only on a 0->1 swapper transition.
> > >
> >
> > Every time because the static_key_slow_inc call is for the total number
> > of connections.
> >
>
> That still seems wrong. The static_key would still be active even if
> you just did it once per xprt.
>
True. As long as it is active while one swapfile exists then it's good.
--
Mel Gorman
SUSE Labs
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
WARNING: multiple messages have this Message-ID (diff)
From: Mel Gorman <mgorman@suse.de>
To: Jeff Layton <jeff.layton@primarydata.com>
Cc: Jerome Marchand <jmarchan@redhat.com>,
Jeff Layton <jlayton@primarydata.com>,
"'Linux-MM'" <linux-mm@kvack.org>,
"'linux-kernel'" <linux-kernel@vger.kernel.org>
Subject: Re: swap: nfs: Sleeping function called from an rcu read section in nfs_swap_activate
Date: Tue, 2 Jun 2015 13:14:42 +0100 [thread overview]
Message-ID: <20150602121442.GD26425@suse.de> (raw)
In-Reply-To: <20150528072434.2e7123b1@synchrony.poochiereds.net>
On Thu, May 28, 2015 at 07:24:34AM -0400, Jeff Layton wrote:
> > > 1) this is not done under a lock, so the non-atomic ++/-- is racy if
> > > there are multiple swapons/swapoffs running concurrently on the same
> > > xprt. Shouldn't those use an atomic?
> > >
> >
> > It would be more appropriate to use atomics. It's a long time ago but I
> > doubt I considered the possibility of multiple swapons racing at the
> > time of implementation. Activation is typically a serialised task run
> > from init.
> >
> > > 2) on enable, "swapper" is incremented and memalloc is set on the
> > > socket. Do we need to do xs_set_memalloc every time swapon is called,
> > > or only on a 0->1 swapper transition.
> > >
> >
> > Every time because the static_key_slow_inc call is for the total number
> > of connections.
> >
>
> That still seems wrong. The static_key would still be active even if
> you just did it once per xprt.
>
True. As long as it is active while one swapfile exists then it's good.
--
Mel Gorman
SUSE Labs
next prev parent reply other threads:[~2015-06-02 12:14 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-26 13:20 swap: nfs: Sleeping function called from an rcu read section in nfs_swap_activate Jerome Marchand
2015-05-26 13:56 ` Jeff Layton
2015-05-27 1:29 ` Jeff Layton
2015-05-28 8:26 ` Mel Gorman
2015-05-28 8:26 ` Mel Gorman
2015-05-28 11:24 ` Jeff Layton
2015-05-28 11:24 ` Jeff Layton
2015-06-02 12:14 ` Mel Gorman [this message]
2015-06-02 12:14 ` Mel Gorman
2015-05-28 11:53 ` Jeff Layton
2015-05-28 11:53 ` Jeff Layton
2015-05-28 14:20 ` Jerome Marchand
2015-05-28 14:56 ` Trond Myklebust
2015-05-28 14:56 ` Trond Myklebust
2015-05-28 16:35 ` Jeff Layton
2015-05-28 16:35 ` Jeff Layton
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=20150602121442.GD26425@suse.de \
--to=mgorman@suse.de \
--cc=jeff.layton@primarydata.com \
--cc=jlayton@primarydata.com \
--cc=jmarchan@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.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.