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: <20121119142516.b2936a7c.akpm@linux-foundation.org>
Date:	Mon, 19 Nov 2012 14:25:16 -0800
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Bob Liu <lliubbo@...il.com>
Cc:	Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>,
	sjenning@...ux.vnet.ibm.com, dan.magenheimer@...cle.com,
	devel@...uxdriverproject.org, linux-kernel@...r.kernel.org,
	linux-mm@...ck.org, ngupta@...are.org, minchan@...nel.org,
	mgorman@...e.de, fschmaus@...il.com, andor.daam@...glemail.com,
	ilendir@...glemail.com
Subject: Re: [PATCH 2/8] mm: frontswap: lazy initialization to allow tmem
 backends to build/run as modules

On Mon, 19 Nov 2012 08:53:46 +0800
Bob Liu <lliubbo@...il.com> wrote:

> On Sat, Nov 17, 2012 at 7:16 AM, Andrew Morton
> <akpm@...ux-foundation.org> wrote:
> > On Wed, 14 Nov 2012 13:57:06 -0500
> > Konrad Rzeszutek Wilk <konrad.wilk@...cle.com> wrote:
> >
> >> From: Dan Magenheimer <dan.magenheimer@...cle.com>
> >>
> >> With the goal of allowing tmem backends (zcache, ramster, Xen tmem) to be
> >> built/loaded as modules rather than built-in and enabled by a boot parameter,
> >> this patch provides "lazy initialization", allowing backends to register to
> >> frontswap even after swapon was run. Before a backend registers all calls
> >> to init are recorded and the creation of tmem_pools delayed until a backend
> >> registers or until a frontswap put is attempted.
> >>
> >>
> >> ...
> >>
> >> --- a/mm/frontswap.c
> >> +++ b/mm/frontswap.c
> >> @@ -80,6 +80,18 @@ static inline void inc_frontswap_succ_stores(void) { }
> >>  static inline void inc_frontswap_failed_stores(void) { }
> >>  static inline void inc_frontswap_invalidates(void) { }
> >>  #endif
> >> +
> >> +/*
> >> + * When no backend is registered all calls to init are registered and
> >
> > What is "init"?  Spell it out fully, please.
> >
> 
> I think it's frontswap_init().
> swapon will call frontswap_init() and in it we need to call init
> function of backends with some parameters
> like swap_type.

Well, let's improve that comment please.

> >> + * remembered but fail to create tmem_pools. When a backend registers with
> >> + * frontswap the previous calls to init are executed to create tmem_pools
> >> + * and set the respective poolids.
> >
> > Again, seems really hacky.  Why can't we just change callers so they
> > call things in the correct order?
> >
> 
> I don't think so, because it asynchronous.
> 
> The original idea was to make backends like zcache/tmem modularization.
> So that it's more convenient and flexible to use and testing.
> 
> But currently callers like swapon only invoke frontswap_init() once,
> it fail if backend not registered.
> We have no way to notify swap to call frontswap_init() again when
> backend registered in some random time
>  in future.

We could add such a way?

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