From: Andrew Morton <akpm@osdl.org>
To: Christoph Lameter <clameter@sgi.com>
Cc: linux-kernel@vger.kernel.org, penberg@cs.helsinki.fi,
marcelo@kvack.org, paulmck@us.ibm.com, nickpiggin@yahoo.com.au,
tytso@mit.edu, dgc@sgi.com, ak@suse.de
Subject: Re: [RFC 0/4] Object reclaim via the slab allocator V1
Date: Wed, 28 Jun 2006 20:09:42 -0700 [thread overview]
Message-ID: <20060628200942.6eea8ae5.akpm@osdl.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0606281741380.24393@schroedinger.engr.sgi.com>
On Wed, 28 Jun 2006 17:47:17 -0700 (PDT)
Christoph Lameter <clameter@sgi.com> wrote:
> On Wed, 28 Jun 2006, Andrew Morton wrote:
>
> > > 2. A destructor was provided during kmem_cache_create().
> > > If SLAB_DTOR_FREE is passed in the flags of the destructor
> > > then a best effort attempt will be made to free that object.
> > >
> >
> > It would be better to make the higher-level code register callbacks for
> > this sort of thing. That code knows how to determine if an object is
> > freeable, can manage aging info, etc.
>
> The destructor is such a callback.
I was, of course, referring to the unpleasant requirement that the object
layout start with an atomic_t.
> > > For slab we check all the objects in the slab. If all object have
> > > a refcount of one then we free all the objects and return the pages of the
> > > object to the page allocator.
> >
> > That seems like quite a drawback. A single refcount=2 object on the page
> > means that nothing gets freed from that page at all. It'd be easy
> > (especially with dcache) to do tons of work without achieving anything.
>
> We will always reclaim a few object from each page. See the patch.
I read the description.
> Single refcount=2 objects could also be detected and we could try to free
> them.
>
> > a) compact dentries by copying them around or, perhaps,
>
> Since we free some dentries in each block they will be effectively be
> moved because they get reallocated in a current slab block.
By performing a disk read. That is not compaction - it is eviction.
> > b) make dentry reclaim be guided by the dcache tree: do a bottom-up
> > reclaim, or a top-down reclaim when we hit a directory, etc. Something
> > which understands the graph rather than the plain global LRU.
>
> The callback can make that determination and could trigger these events.
> The callback notifies the higher layers that it would be advantageous to
> free this element. The higher layers can then analyze the situation and
> either free or give up.
How do you propose handling the locking? dcache is passed a bare pointer
and no locks are held, but it is guaranteed that the object won't be freed
while it's playing with it?
If so, take dcache_lock and then validate the object's current state in
some manner?
next prev parent reply other threads:[~2006-06-29 3:10 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-19 18:46 Christoph Lameter
2006-06-19 18:46 ` [RFC 1/4] slab freeing consolidation Christoph Lameter
2006-06-22 19:18 ` Pekka J Enberg
2006-06-22 19:38 ` Christoph Lameter
2006-06-19 18:47 ` [RFC 2/4] Remove empty destructor from drivers/usb/mon/mon_text.c Christoph Lameter
2006-06-22 19:22 ` Pekka J Enberg
2006-06-19 18:47 ` [RFC 3/4] Add checks to current destructor uses Christoph Lameter
2006-06-22 19:24 ` Pekka J Enberg
2006-06-22 19:40 ` Christoph Lameter
2006-06-19 18:47 ` [PATCH 4/4] Slab Reclaim logic Christoph Lameter
2006-06-19 18:53 ` Christoph Lameter
2006-06-22 19:34 ` Pekka J Enberg
2006-06-22 19:42 ` Christoph Lameter
2006-06-22 19:46 ` Pekka J Enberg
2006-06-22 19:49 ` Christoph Lameter
2006-06-22 19:41 ` Pekka J Enberg
2006-06-22 19:44 ` Christoph Lameter
2006-06-22 19:46 ` Pekka J Enberg
2006-06-22 19:49 ` Pekka J Enberg
2006-06-22 19:52 ` Christoph Lameter
2006-06-19 20:50 ` [RFC 0/4] Object reclaim via the slab allocator V1 Andi Kleen
2006-06-29 0:43 ` Andrew Morton
2006-06-29 0:47 ` Christoph Lameter
2006-06-29 3:09 ` Andrew Morton [this message]
2006-06-29 17:20 ` Christoph Lameter
2006-07-03 0:44 ` Marcelo Tosatti
2006-07-03 18:10 ` Christoph Lameter
2006-07-03 23:11 ` Marcelo Tosatti
2006-07-04 1:46 ` Christoph Lameter
2006-07-04 2:07 ` Marcelo Tosatti
2006-07-04 2:37 ` Christoph Lameter
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=20060628200942.6eea8ae5.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=ak@suse.de \
--cc=clameter@sgi.com \
--cc=dgc@sgi.com \
--cc=linux-kernel@vger.kernel.org \
--cc=marcelo@kvack.org \
--cc=nickpiggin@yahoo.com.au \
--cc=paulmck@us.ibm.com \
--cc=penberg@cs.helsinki.fi \
--cc=tytso@mit.edu \
/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
all inboxes | Powered by JetHome®