public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Matt Mackall <mpm@selenic.com>
To: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: David Miller <davem@davemloft.net>,
	clameter@sgi.com, akpm@linux-foundation.org,
	linux-kernel@vger.kernel.org
Subject: Re: + fix-spellings-of-slab-allocator-section-in-init-kconfig.patch added to -mm tree
Date: Tue, 8 May 2007 21:56:35 -0500	[thread overview]
Message-ID: <20070509025634.GC11115@waste.org> (raw)
In-Reply-To: <46412BB5.1060605@yahoo.com.au>

On Wed, May 09, 2007 at 12:02:29PM +1000, Nick Piggin wrote:
> BTW, we _really_ should be doing RCU properly in slob, because you
> technically can't noop RCU on UP (even though the current users may be
> safe...).

Thanks. Hugh was pretty convinced it was unneeded:

http://marc.info/?l=linux-mm&m=116413907023393&w=2

And since I didn't care much about the SMP case, I didn't pursue it.

This almost looks reasonable. I think HW_ALIGN | RCU is going to make
it break though:

> +	if (unlikely(c->flags & SLAB_DESTROY_BY_RCU))
> +		b += sizeof(struct slob_rcu);
> +

That could be dealt with by putting the slob_rcu at the end of the
object and having the RCU helper function use ->size to work backward
to the actual pointer.

>  void kmem_cache_free(struct kmem_cache *c, void *b)
>  {
>  	if (c->dtor)
>  		c->dtor(b, c, 0);

I think if we want RCU to actually work, we want to run ->dtor in
__kmem_cache_free?

> -	if (c->size < PAGE_SIZE)
> -		slob_free(b, c->size);
> -	else
> -		free_pages((unsigned long)b, find_order(c->size));
> +	if (unlikely(c->flags & SLAB_DESTROY_BY_RCU)) {
> +		struct slob_rcu *slob_rcu;
> +		b -= sizeof(struct slob_rcu);
> +		slob_rcu = b;
> +		slob_rcu->size = c->size;

Which means just store c in the header^Wfooter, then we can retrieve the size
and the dtor in the RCU helper.

We might as well add slab_is_available and make the damn thing work on
sparsemem again too.

-- 
Mathematics is the supreme nostalgia of our time.

  reply	other threads:[~2007-05-09  2:57 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200705082302.l48N2KrZ004229@shell0.pdx.osdl.net>
2007-05-09  0:23 ` + fix-spellings-of-slab-allocator-section-in-init-kconfig.patch added to -mm tree Matt Mackall
2007-05-09  0:32   ` Alan Cox
2007-05-09  0:33     ` Matt Mackall
2007-05-09  0:43       ` Christoph Lameter
2007-05-09  0:51   ` Christoph Lameter
2007-05-09  1:27     ` Matt Mackall
2007-05-09  1:32       ` Christoph Lameter
2007-05-09  1:51         ` David Miller
2007-05-09  1:53           ` Christoph Lameter
2007-05-09  1:55             ` David Miller
2007-05-09  1:57               ` Christoph Lameter
2007-05-09  2:06                 ` David Miller
2007-05-09  2:10                   ` Nick Piggin
2007-05-09  2:20                     ` Christoph Lameter
2007-05-09  2:02           ` Nick Piggin
2007-05-09  2:56             ` Matt Mackall [this message]
2007-05-09  3:18               ` Nick Piggin
2007-05-09  3:27                 ` Christoph Lameter
2007-05-09  3:47                 ` Nick Piggin
2007-05-10  0:42             ` Andrew Morton
2007-05-10  1:00               ` Nick Piggin
2007-05-10  2:27                 ` Matt Mackall
2007-05-09  2:19         ` Matt Mackall
2007-05-09  2:24           ` Christoph Lameter
2007-05-09  2:43             ` Nick Piggin
2007-05-09  2:57               ` Christoph Lameter
2007-05-09  3:04                 ` Nick Piggin
2007-05-09  3:08                   ` Christoph Lameter
2007-05-09  3:25                 ` Matt Mackall
2007-05-09  3:16             ` Matt Mackall
2007-05-09  3:24               ` 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=20070509025634.GC11115@waste.org \
    --to=mpm@selenic.com \
    --cc=akpm@linux-foundation.org \
    --cc=clameter@sgi.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nickpiggin@yahoo.com.au \
    /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