lkml.org 
[lkml]   [2015]   [Jun]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: call_rcu from trace_preempt
On 6/16/15 10:37 AM, Steven Rostedt wrote:
>>> + kfree(l);
>> >
>> >that's not right, since such thread defeats rcu protection of lookup.
>> >We need either kfree_rcu/call_rcu or synchronize_rcu.
>> >Obviously the former is preferred that's why I'm still digging into it.
>> >Probably a thread that does kfree_rcu would be ok, but we shouldn't
>> >be doing it unconditionally. For all networking programs and 99%
>> >of tracing programs the existing code is fine and I don't want to
>> >slow it down to tackle the corner case.
>> >Extra spin_lock just to add it to the list is also quite costly.
> Use a irq_work() handler to do the kfree_rcu(), and use llist (lockless
> list) to add items to the list.

have been studying irq_work and llist... it will work, but it's quite
costly too. Every kfree_rcu will be replaced with irq_work_queue(),
which is irq_work_claim() with one lock_cmpxchg plus another
lock_cmpxchg in llist_add, plus another lock_cmpxchg for our own llist
of 'to be kfree_rcu-ed htab elements'. That's a lot.
The must be better solution. Need to explore more.



\
 
 \ /
  Last update: 2015-06-17 03:01    [W:0.158 / U:1.344 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site