From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Bob Liu <lliubbo@gmail.com>,
sjenning@linux.vnet.ibm.com, dan.magenheimer@oracle.com,
devel@linuxdriverproject.org, linux-kernel@vger.kernel.org,
linux-mm@kvack.org, ngupta@vflare.org, minchan@kernel.org,
mgorman@suse.de, fschmaus@gmail.com, andor.daam@googlemail.com,
ilendir@googlemail.com
Subject: Re: [PATCH 2/8] mm: frontswap: lazy initialization to allow tmem backends to build/run as modules
Date: Tue, 27 Nov 2012 16:26:17 -0500 [thread overview]
Message-ID: <20121127212617.GA13890@phenom.dumpdata.com> (raw)
In-Reply-To: <20121119142516.b2936a7c.akpm@linux-foundation.org>
On Mon, Nov 19, 2012 at 02:25:16PM -0800, Andrew Morton wrote:
> On Mon, 19 Nov 2012 08:53:46 +0800
> Bob Liu <lliubbo@gmail.com> wrote:
>
> > On Sat, Nov 17, 2012 at 7:16 AM, Andrew Morton
> > <akpm@linux-foundation.org> wrote:
> > > On Wed, 14 Nov 2012 13:57:06 -0500
> > > Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> wrote:
> > >
> > >> From: Dan Magenheimer <dan.magenheimer@oracle.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?
Hey Andrew,
Sorry for the late email. Right at as you posted your questions I went on vacation :-)
Let me respond to your email and rebase the patch per your comments/ideas this week.
--
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>
next prev parent reply other threads:[~2012-11-27 21:26 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-14 18:57 [PATCH v2] enable all tmem backends to be built and loaded as modules Konrad Rzeszutek Wilk
2012-11-14 18:57 ` [PATCH 1/8] mm: cleancache: lazy initialization to allow tmem backends to build/run " Konrad Rzeszutek Wilk
2012-11-16 23:10 ` Andrew Morton
2013-01-30 15:57 ` Konrad Rzeszutek Wilk
2012-11-14 18:57 ` [PATCH 2/8] mm: frontswap: " Konrad Rzeszutek Wilk
2012-11-16 23:16 ` Andrew Morton
2012-11-19 0:53 ` Bob Liu
2012-11-19 22:25 ` Andrew Morton
2012-11-27 21:26 ` Konrad Rzeszutek Wilk [this message]
2013-01-30 15:55 ` Konrad Rzeszutek Wilk
2012-11-14 18:57 ` [PATCH 3/8] frontswap: Make frontswap_init use a pointer for the ops Konrad Rzeszutek Wilk
2012-11-14 18:57 ` [PATCH 4/8] cleancache: Make cleancache_init " Konrad Rzeszutek Wilk
2012-11-14 18:57 ` [PATCH 5/8] staging: zcache2+ramster: enable ramster to be built/loaded as a module Konrad Rzeszutek Wilk
2012-11-14 18:57 ` [PATCH 6/8] staging: zcache2+ramster: enable zcache2 " Konrad Rzeszutek Wilk
2012-11-14 18:57 ` [PATCH 7/8] xen: tmem: enable Xen tmem shim " Konrad Rzeszutek Wilk
2012-11-14 18:57 ` [PATCH 8/8] xen/tmem: Remove the subsys call Konrad Rzeszutek Wilk
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=20121127212617.GA13890@phenom.dumpdata.com \
--to=konrad.wilk@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=andor.daam@googlemail.com \
--cc=dan.magenheimer@oracle.com \
--cc=devel@linuxdriverproject.org \
--cc=fschmaus@gmail.com \
--cc=ilendir@googlemail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lliubbo@gmail.com \
--cc=mgorman@suse.de \
--cc=minchan@kernel.org \
--cc=ngupta@vflare.org \
--cc=sjenning@linux.vnet.ibm.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).