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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130128233846.GB4752@blaptop>
Date:	Tue, 29 Jan 2013 08:38:46 +0900
From:	Minchan Kim <minchan@...nel.org>
To:	Seth Jennings <sjenning@...ux.vnet.ibm.com>
Cc:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Dan Magenheimer <dan.magenheimer@...cle.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>,
	Nitin Gupta <ngupta@...are.org>,
	Robert Jennings <rcj@...ux.vnet.ibm.com>, linux-mm@...ck.org,
	devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/4] staging: zsmalloc: add gfp flags to zs_create_pool

On Mon, Jan 28, 2013 at 11:01:28AM -0600, Seth Jennings wrote:
> On 01/27/2013 09:39 PM, Minchan Kim wrote:
> > Hi Seth,
> > 
> > On Fri, Jan 25, 2013 at 11:46:15AM -0600, Seth Jennings wrote:
> >> zs_create_pool() currently takes a gfp flags argument
> >> that is used when growing the memory pool.  However
> >> it is not used in allocating the metadata for the pool
> >> itself.  That is currently hardcoded to GFP_KERNEL.
> >>
> >> zswap calls zs_create_pool() at swapon time which is done
> >> in atomic context, resulting in a "might sleep" warning.
> >>
> >> This patch changes the meaning of the flags argument in
> >> zs_create_pool() to mean the flags for the metadata allocation,
> >> and adds a flags argument to zs_malloc that will be used for
> >> memory pool growth if required.
> > 
> > As I mentioned, I'm not strongly against with this patch but it
> > should be last resort in case of not being able to address
> > frontswap's init routine's dependency with swap_lock.
> > 
> > I sent a patch and am waiting reply of Konrand or Dan.
> > If we can fix frontswap, it would be better rather than
> > changing zsmalloc.
> 
> I agree that moving the call to frontswap_init() out of the swap_lock
> would be a good thing.  However, it doesn't mean that we still
> shouldn't allow the users to control the gfp mask for the allocation
> done by zs_create_pool(). While moving the frontswap_init() outside
> the lock removes the _need_ for this patch, I think that is it good
> API design to allow the user to specify the gfp mask.

I agree but we can do it when we have needs.
If we can remove swap_lock dependency of frontswap, your needs would go away
so we could add gfp argument next time if someone give us their needs.

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

-- 
Kind regards,
Minchan Kim
--
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