[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150602123623.GE26425@suse.de>
Date: Tue, 2 Jun 2015 13:36:23 +0100
From: Mel Gorman <mgorman@...e.de>
To: Jeff Layton <jlayton@...chiereds.net>
Cc: trond.myklebust@...marydata.com, linux-nfs@...r.kernel.org,
linux-mm@...ck.org, linux-kernel@...r.kernel.org,
Jerome Marchand <jmarchan@...hat.com>
Subject: Re: [PATCH 1/4] sunrpc: keep a count of swapfiles associated with
the rpc_clnt
On Sat, May 30, 2015 at 08:03:10AM -0400, Jeff Layton wrote:
> Jerome reported seeing a warning pop when working with a swapfile on
> NFS. The nfs_swap_activate can end up calling sk_set_memalloc while
> holding the rcu_read_lock and that function can sleep.
>
> To fix that, we need to take a reference to the xprt while holding the
> rcu_read_lock, set the socket up for swapping and then drop that
> reference. But, xprt_put is not exported and having NFS deal with the
> underlying xprt is a bit of layering violation anyway.
>
> Fix this by adding a set of activate/deactivate functions that take a
> rpc_clnt pointer instead of an rpc_xprt, and have nfs_swap_activate and
> nfs_swap_deactivate call those.
>
> Also, add a per-rpc_clnt atomic counter to keep track of the number of
> active swapfiles associated with it. When the counter does a 0->1
> transition, we enable swapping on the xprt, when we do a 1->0 transition
> we disable swapping on it.
>
> This also allows us to be a bit more selective with the RPC_TASK_SWAPPER
> flag. If non-swapper and swapper clnts are sharing a xprt, then we only
> need to flag the tasks from the swapper clnt with that flag.
>
> Cc: Mel Gorman <mgorman@...e.de>
> Reported-by: Jerome Marchand <jmarchan@...hat.com>
> Signed-off-by: Jeff Layton <jeff.layton@...marydata.com>
Acked-by: Mel Gorman <mgorman@...e.de>
--
Mel Gorman
SUSE Labs
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists