From: Lai Jiangshan <laijs@cn.fujitsu.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Ingo Molnar <mingo@elte.hu>,
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
LKML <linux-kernel@vger.kernel.org>,
Manfred Spraul <manfred@colorfullife.com>
Subject: Re: [PATCH V4 1/1] rcu: introduce kfree_rcu()
Date: Wed, 16 Mar 2011 10:23:54 +0800 [thread overview]
Message-ID: <4D801F3A.4000303@cn.fujitsu.com> (raw)
In-Reply-To: <201103151115.54426.arnd@arndb.de>
On 03/15/2011 06:15 PM, Arnd Bergmann wrote:
> On Tuesday 15 March 2011 10:46:20 Lai Jiangshan wrote:
>> +static __always_inline bool __is_kfree_rcu_offset(unsigned long offset)
>> +{
>> + return offset < 4096;
>> +}
>
> So this relies on the assumptions that
>
> a) the rcu_head is within the first 4 KB of the data structure to be freed
> b) no callback ever gets called in the first 4 KB of virtual address space
>
> It's probably a reasonable assumption, but I think it should be documented
> more explicitly, especially the first one. It's entirely possible that
> an RCU managed data structure is larger than 4 KB.
The first one is not a problem nor assumption, if an rcu_head offset is larger
than 4096, the BUILD_BUG_ON() will be triggered, and the user can use the original
call_rcu() instead.
b) is not a problem, the TEXT section is no at the first 4 KB of virtual address space.
> Another alternative might be to encode the difference between a
> function pointer and an offset in one of the lower bits of the address.
>
> Arnd
>
next prev parent reply other threads:[~2011-03-16 2:22 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
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 ` Lai Jiangshan [this message]
2011-03-15 11:30 ` [PATCH V4 " 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=4D801F3A.4000303@cn.fujitsu.com \
--to=laijs@cn.fujitsu.com \
--cc=arnd@arndb.de \
--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.