[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <c1c6c6fc-b7a1-4b04-a527-904eb2970340@default>
Date: Fri, 15 Mar 2013 09:54:44 -0700 (PDT)
From: Dan Magenheimer <dan.magenheimer@...cle.com>
To: Seth Jennings <sjenning@...ux.vnet.ibm.com>
Cc: Robert Jennings <rcj@...ux.vnet.ibm.com>,
Bob Liu <bob.liu@...cle.com>, minchan@...nel.org,
Nitin Gupta <nitingupta910@...il.com>,
Konrad Wilk <konrad.wilk@...cle.com>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, Bob Liu <lliubbo@...il.com>,
Luigi Semenzato <semenzato@...gle.com>,
Mel Gorman <mgorman@...e.de>
Subject: RE: zsmalloc limitations and related topics
> From: Seth Jennings [mailto:sjenning@...ux.vnet.ibm.com]
> Subject: Re: zsmalloc limitations and related topics
>
> On 03/14/2013 01:54 PM, Dan Magenheimer wrote:
> >> From: Robert Jennings [mailto:rcj@...ux.vnet.ibm.com]
> >> Subject: Re: zsmalloc limitations and related topics
> >>
> >> * Bob (bob.liu@...cle.com) wrote:
> >>> On 03/14/2013 06:59 AM, Seth Jennings wrote:
> >>>> On 03/13/2013 03:02 PM, Dan Magenheimer wrote:
> >>>>>> From: Robert Jennings [mailto:rcj@...ux.vnet.ibm.com]
> >>>>>> Subject: Re: zsmalloc limitations and related topics
> >>>>>
> >> <snip>
> >>>>> Yes. And add pageframe-reclaim to this list of things that
> >>>>> zsmalloc should do but currently cannot do.
> >>>>
> >>>> The real question is why is pageframe-reclaim a requirement? What
> >>>> operation needs this feature?
> >>>>
> >>>> AFAICT, the pageframe-reclaim requirements is derived from the
> >>>> assumption that some external control path should be able to tell
> >>>> zswap/zcache to evacuate a page, like the shrinker interface. But this
> >>>> introduces a new and complex problem in designing a policy that doesn't
> >>>> shrink the zpage pool so aggressively that it is useless.
> >>>>
> >>>> Unless there is another reason for this functionality I'm missing.
> >>>>.
> >>>
> >>> Perhaps it's needed if the user want to enable/disable the memory
> >>> compression feature dynamically.
> >>> Eg, use it as a module instead of recompile the kernel or even
> >>> reboot the system.
> >
> > It's worth thinking about: Under what circumstances would a user want
> > to turn off compression? While unloading a compression module should
> > certainly be allowed if it makes a user comfortable, in my opinion,
> > if a user wants to do that, we have done our job poorly (or there
> > is a bug).
> >
> >> To unload zswap all that is needed is to perform writeback on the pages
> >> held in the cache, this can be done by extending the existing writeback
> >> code.
> >
> > Actually, frontswap supports this directly. See frontswap_shrink.
>
> frontswap_shrink() is a best-effort attempt to fault in all the pages
> stored in the backend. However, if there is not enough RAM to hold all
> the pages, then it can not completely evacuate the backend.
>
> Module exit functions must return void, so there is no way to fail a
> module unload. If you implement an exit function for your module, you
> must insure that it can always complete successfully. For this reason
> frontswap_shrink() is unsuitable for module unloading. You'd need to
> use a mechanism like writeback that could surely evacuate the backend
> (baring I/O failures).
A single call to frontswap_shrink may be unsuitable... multiple
calls (do while zcache/zswap is not empty) may work fine.
Writeback-until-empty should also work fine.
In any case, it's a good point that module exit must succeed,
and that if there is already heavy memory pressure when zcache/zswap
module exit is invoked, module exit may be very very slow and cause
many many swap disk writes, so the system may become unresponsive
(and may even OOM).
So if someone implements zcache/zswap module unload, a thorough
test plan would be good.
--
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