[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <7f94da39-4855-46b6-96d3-ab5ddbaed039@default>
Date: Mon, 17 Oct 2011 13:14:23 -0700 (PDT)
From: Dan Magenheimer <dan.magenheimer@...cle.com>
To: Dan Magenheimer <dan.magenheimer@...cle.com>,
Seth Jennings <sjenning@...ux.vnet.ibm.com>, gregkh@...e.de
Cc: cascardo@...oscopio.com, rdunlap@...otime.net,
devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org,
linux-mm@...ck.org, rcj@...ux.vnet.ibm.com,
brking@...ux.vnet.ibm.com
Subject: RE: [PATCH] staging: zcache: remove zcache_direct_reclaim_lock
> From: Dan Magenheimer
> Sent: Wednesday, October 12, 2011 2:39 PM
> To: Seth Jennings; gregkh@...e.de
> Cc: cascardo@...oscopio.com; rdunlap@...otime.net; devel@...verdev.osuosl.org; linux-
> kernel@...r.kernel.org; linux-mm@...ck.org; rcj@...ux.vnet.ibm.com; brking@...ux.vnet.ibm.com
> Subject: RE: [PATCH] staging: zcache: remove zcache_direct_reclaim_lock
>
> > From: Seth Jennings [mailto:sjenning@...ux.vnet.ibm.com]
> > Subject: [PATCH] staging: zcache: remove zcache_direct_reclaim_lock
> >
> > zcache_do_preload() currently does a spin_trylock() on the
> > zcache_direct_reclaim_lock. Holding this lock intends to prevent
> > shrink_zcache_memory() from evicting zbud pages as a result
> > of a preload.
> >
> > However, it also prevents two threads from
> > executing zcache_do_preload() at the same time. The first
> > thread will obtain the lock and the second thread's spin_trylock()
> > will fail (an aborted preload) causing the page to be either lost
> > (cleancache) or pushed out to the swap device (frontswap). It
> > also doesn't ensure that the call to shrink_zcache_memory() is
> > on the same thread as the call to zcache_do_preload().
>
> Yes, this looks to be leftover code from early in kztmem/zcache
> development. Good analysis.
>
> > Additional, there is no need for this mechanism because all
> > zcache_do_preload() calls that come down from cleancache already
> > have PF_MEMALLOC set in the process flags which prevents
> > direct reclaim in the memory manager. If the zcache_do_preload()
>
> Might it be worthwhile to add a BUG/ASSERT for the presence
> of PF_MEMALLOC, or at least a comment in the code?
>
> > call is done from the frontswap path, we _want_ reclaim to be
> > done (which it isn't right now).
> >
> > This patch removes the zcache_direct_reclaim_lock and related
> > statistics in zcache.
> >
> > Based on v3.1-rc8
> >
> > Signed-off-by: Seth Jennings <sjenning@...ux.vnet.ibm.com>
> > Reviewed-by: Dave Hansen <dave@...ux.vnet.ibm.com>
>
> With added code/comment per above...
> Acked-by: Dan Magenheimer <dan.magenheimer@...cle.com>
After Seth's further analysis, ignore my conditional and
consider v1 of this patch:
Acked-by: Dan Magenheimer <dan.magenheimer@...cle.com>
--
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