All pastes #2065953 Raw Edit

Stuff

public text v1 · immutable
#2065953 ·published 2011-05-20 19:06 UTC
rendered paste body
18:05 < nbd> so the idea is still using a wrapper rcupdate.h
18:05 < nbd> to backport this we'd need to add compat wrappers for all functions that are used that take a struct rcu_head
18:06 < nbd> so when using the wrapper, first define a struct compat_rcu_head, which contains a struct rcu_head field
18:06 < nbd> and an int offset
18:07 < nbd> then use a #define to change all rcu_head to compat_rcu_head
18:07 < nbd> then add a compat_call_rcu (along with a #define for changing call_rcu to it)
18:08 < nbd> that can be an inline function that calls the original call_rcu by pointing it at the struct rcu_head field of the wrapper data structure
18:08 < nbd> for kfree_rcu you write a reclaim function in compat-2.6.40.c, which uses container_of to go from rcu_head to compat_rcu_head
18:09 < nbd> then subtracts offset from the pointer
18:09 < nbd> and runs kfree on it
18:09 < nbd> you assign that reclaim function to the func field of the rcu_head in kfree_rcu*(
18:09 < nbd> that way it should be safe and it should work without code modifications