Re: [RFC PATCH] rcu: introduce kfree_rcu()

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Manfred Spraul
Date: Thursday, September 18, 2008 - 9:52 am

Andrew Morton wrote:
__rcu_reclaim either treats head->func as an offset for kfree or as a 
function pointer.


Here it's used:
the softirq that is called after the grace period calls kfree directly 
instead of calling a wrapper function around kfree.

What about offset_of? the computation is known at compile time.
I'd try to make that a compile time error. Is that possible? perhaps 
with some __builtin_constant_p (head-ptr) or something like that. Or 
with offset_of.

__rcu_reclaim() knows that function pointers < 4096 are actually offsets 
for kfree.


I like the idea:
- the call to list->func() is probably very difficult to predict for a 
branch target predictor.
- it's just a waste not to call kfree directly.
- I'm not sure about the implementation.

--
    Manfred
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[RFC PATCH] rcu: introduce kfree_rcu(), Lai Jiangshan, (Wed Sep 17, 9:18 pm)
Re: [RFC PATCH] rcu: introduce kfree_rcu(), Andrew Morton, (Wed Sep 17, 9:37 pm)
Re: [RFC PATCH] rcu: introduce kfree_rcu(), Paul E. McKenney, (Wed Sep 17, 11:44 pm)
Re: [RFC PATCH] rcu: introduce kfree_rcu(), Lai Jiangshan, (Thu Sep 18, 1:59 am)
Re: [RFC PATCH] rcu: introduce kfree_rcu(), Manfred Spraul, (Thu Sep 18, 9:52 am)
Re: [RFC PATCH] rcu: introduce kfree_rcu(), Manfred Spraul, (Thu Sep 18, 9:56 am)
Re: [RFC PATCH] rcu: introduce kfree_rcu(), Paul E. McKenney, (Thu Sep 18, 10:15 am)
Re: [RFC PATCH] rcu: introduce kfree_rcu(), Paul E. McKenney, (Thu Sep 18, 10:46 am)
Re: [RFC PATCH] rcu: introduce kfree_rcu(), Lai Jiangshan, (Thu Sep 18, 6:04 pm)
Re: [RFC PATCH] rcu: introduce kfree_rcu(), Lai Jiangshan, (Thu Sep 18, 7:31 pm)
Re: [RFC PATCH] rcu: introduce kfree_rcu(), Paul E. McKenney, (Thu Sep 18, 8:58 pm)
Re: [RFC PATCH] rcu: introduce kfree_rcu(), Manfred Spraul, (Fri Sep 19, 9:03 am)