lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20150602121442.GD26425@suse.de>
Date:	Tue, 2 Jun 2015 13:14:42 +0100
From:	Mel Gorman <mgorman@...e.de>
To:	Jeff Layton <jeff.layton@...marydata.com>
Cc:	Jerome Marchand <jmarchan@...hat.com>,
	Jeff Layton <jlayton@...marydata.com>,
	'Linux-MM' <linux-mm@...ck.org>,
	'linux-kernel' <linux-kernel@...r.kernel.org>
Subject: Re: swap: nfs: Sleeping function called from an rcu read section in
 nfs_swap_activate

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 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

Powered by Openwall GNU/*/Linux Powered by OpenVZ