lkml.org 
[lkml]   [2009]   [Jan]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC, PATCH] kernel/rcu: add kfree_rcu
Paul E. McKenney wrote:
> I would suggest instead using the bottom bit to differentiate between
> these two cases, especially given that your approach makes it impossible
> for callback processing to notice a NULL function pointer. In addition,
> this approach would allow different types of allocators to be specified
> should this later prove to be helpful. You should not have to shift the
> offset because the rcu_head offset should always be a multiple of four
> (or eight on 64-bit architectures).
>
We must be careful: rcu_head might be always aligned, but are function
pointers always aligned?
The x86 hardware allows arbitrary function pointers, I'm not sure what
gcc would do if '--falign-functions=0' is used.
Are there other codepaths that assume that the lowest bit of a function
pointer is never set?

> And we really are running into bugs that are detected by RCU's seeing a
> null function pointer in the rcu_head structure at callback-invocation
> time. So, whatever encoding you choose, please leave a function-pointer
> value of zero as an invalid value!
>
Ok.

>> --- a/kernel/rcutree.c
>> +++ b/kernel/rcutree.c
>> @@ -901,7 +901,7 @@ static void rcu_do_batch(struct rcu_data *rdp)
>> while (list) {
>> next = list->next;
>> prefetch(next);
>> - list->func(list);
>> + rcu_docallback(list);
>>
>
> Good, you got all three of them! ;-)
>
>
The patch was tested against rcutree ;-)

--
Manfred


\
 
 \ /
  Last update: 2009-01-03 16:03    [from the cache]
©2003-2011 Jasper Spaans