[PATCH -mm 0/6] rcu: introduce kfree_rcu V2

From: Lai Jiangshan
Date: Tue Mar 03 2009 - 08:46:03 EST



There are 23 instances where the rcu callback just does

kfree(containerof(head,struct whatever_struct,rcu_member));

The 23 instances exist because there are 23 'struct whatever_struct' with
their individual rcu_member. These patches creates a generic kfree_rcu()
function that removes the need for these 23 helpers.

The number of this kind of rcu callback will increase, for this is the
most common way to use rcu and define rcu callback.

And kfree_rcu() is also help for unloadable modules, kfree_rcu() does not
queue any function which belong to the module, so a rcu_barrier() can
be avoid when module exit. (If we queue any other function by call_rcu(),
rcu_barrier() is still needed.)

Changed from V1:
1) Implement kfree_rcu() in slab layer.
In V1, the offset from the container struct to the rcu member
is calculated at compile time and stored in head->func instead of the
function pointer. This disarrange rcu's algorithm a little, there is
no bad side effect when we implement kfree_rcu() in slab layer.

2) kfree_rcu() API is changed, use the version that Manfred Spraul designed.
This one allows compiler do more checking.

Signed-off-by: Lai Jiangshan <laijs@xxxxxxxxxxxxxx>
---







--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/