All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Lai Jiangshan <laijs@cn.fujitsu.com>
Cc: Arnd Bergmann <arnd@arndb.de>, Ingo Molnar <mingo@elte.hu>,
	LKML <linux-kernel@vger.kernel.org>,
	Manfred Spraul <manfred@colorfullife.com>
Subject: Re: [PATCH V4 1/1] rcu: introduce kfree_rcu()
Date: Tue, 15 Mar 2011 21:38:17 -0700	[thread overview]
Message-ID: <20110316043817.GH2273@linux.vnet.ibm.com> (raw)
In-Reply-To: <4D802746.3020509@cn.fujitsu.com>

On Wed, Mar 16, 2011 at 10:58:14AM +0800, Lai Jiangshan wrote:
> On 03/15/2011 09:07 PM, Arnd Bergmann wrote:
> > On Tuesday 15 March 2011, Paul E. McKenney wrote:
> >> And it makes use of statically allocated structures a bit clunky.
> > 
> > How do statically allocated structures relate to this? I would
> > expect that you never call kfree_rcu on them, so it shouldn't
> > matter.
> > 
> >> Yet another approach is to use the low-order bit of the rcu_head pointer,
> >> given that the rcu_head structure does have to be aligned.  If this bit
> >> is set, then the function pointer could be interpreted as an offset.
> >> This approach might also allow a slab_free_rcu() to be constructed, given
> >> that the full 32 bits of the function pointer would be available.
> >> For example, if the upper 16 bits are zero, the low-order 16 bits are
> >> the offset.  If the upper 16 bits are 0x1, then the low-order 16 bits
> >> might be an index that selects the desired slab cache.
> > 
> > This solution sounds like a clear improvement over the patch that Lai
> > Jiangshan posted, without any downsides.
> 
> This solution is good, but it changes too much code, I think we will switch to
> this solution until my posted solution can't work under some real bad situation
> happened.

Indeed, the bit patterns are totally internal to this patch, so we can
change as needed -- for example, if we later want to apply this same
technique to slab_free() as well as kfree().

							Thanx, Paul

  reply	other threads:[~2011-03-16  4:38 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-15  9:46 [PATCH V4 1/1] rcu: introduce kfree_rcu() Lai Jiangshan
2011-03-15 10:15 ` Arnd Bergmann
2011-03-15 11:27   ` Paul E. McKenney
2011-03-15 12:02     ` Arnd Bergmann
2011-03-15 12:19       ` Paul E. McKenney
2011-03-15 13:07         ` Arnd Bergmann
2011-03-16  2:58           ` Lai Jiangshan
2011-03-16  4:38             ` Paul E. McKenney [this message]
2011-03-16  4:02           ` Paul E. McKenney
2011-03-18  3:15             ` [PATCH V5 " Lai Jiangshan
2011-03-18  8:14               ` Arnd Bergmann
2011-03-16  2:23   ` [PATCH V4 " Lai Jiangshan
2011-03-15 11:30 ` Paul E. McKenney
2011-03-16  2:50   ` Lai Jiangshan
2011-03-16  4:29     ` Paul E. McKenney
2011-03-15 13:11 ` Eric Dumazet
2011-03-16  4:03   ` Paul E. McKenney
2011-03-17  9:28     ` Lai Jiangshan
2011-03-17 17:50       ` Paul E. McKenney

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=20110316043817.GH2273@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=arnd@arndb.de \
    --cc=laijs@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manfred@colorfullife.com \
    --cc=mingo@elte.hu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.