All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: paulmck@linux.vnet.ibm.com
Cc: Lai Jiangshan <laijs@cn.fujitsu.com>, 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 13:02:09 +0100	[thread overview]
Message-ID: <201103151302.09381.arnd@arndb.de> (raw)
In-Reply-To: <20110315112734.GA2167@linux.vnet.ibm.com>

On Tuesday 15 March 2011, Paul E. McKenney wrote:
> > Another alternative might be to encode the difference between a
> > function pointer and an offset in one of the lower bits of the address.
> 
> We discussed this some time back, and it turned out that there were
> CPUs that could legitimately have any combination of low-order bits
> set -- functions could start at any byte address.
> 
> If this has changed, I would prefer to use the low-order bits, but
> if it has not, we can't.  :-(

Ok, I see.

I just had another idea, which may or may not have new problems:

static inline void *kzalloc_rcu(size_t len, gfp_t flags)
{
	struct rcu_head *head = kzalloc(len + sizeof (struct rcu_head), flags);
	return head + 1;
}

void __kfree_rcu(struct rcu_head *head)
{
	kfree(head);
}

static inline void kfree_rcu(void *p)
{
	struct rcu_head *head = p - sizeof (struct rcu_head);
	call_rcu(head, __kfree_rcu);
}

The only disadvantage I can see right now is that it messes
with the alignment of the structure.

	Arnd

  reply	other threads:[~2011-03-15 12:02 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 [this message]
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
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=201103151302.09381.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=laijs@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manfred@colorfullife.com \
    --cc=mingo@elte.hu \
    --cc=paulmck@linux.vnet.ibm.com \
    /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.