Re: [PATCH tip/core/rcu 0/6] Preview of RCU patches for 2.6.40

Paul E. McKenney
2011-05-02T08:09:16Z

On Mon, May 02, 2011 at 09:49:11AM +1000, Dave Chinner wrote:
> On Sun, May 01, 2011 at 06:21:42AM -0700, Paul E. McKenney wrote:
> > Hello!
> >
> > This patchset introduces RCU_TREE priority boosting, a new "fire and
> > forget" kfree_rcu() API, numerous uses of kfree_rcu(), plus a number
> > of other fixes and improvements. The patches are as follows:
>
> .....
>
> > 34-70. Use kfree_rcu() throughout the kernel. This set of patches has
> > Acked-by's, so will go up -tip.
> >
> > 71-86. Ditto, but lacking Acked-by's.
>
> Any reason why dentry and inode freeing was not converted in this
> series?

>From what I can see, they use kmem_cache_free() rather than kfree(),
so we cannot use kfree_rcu() for them. But there are many tens of RCU
callback functions that just do kmem_cache_free(), so maybe we need
a kmem_cache_free_rcu().

Lai, any thoughts on this? Perhaps a global array of pointers to all the
kmem_caches, so that the low-order bit can say kmem_cache_free() rather
than kfree()? Then the offset can be encoded in the kmem_cache structure,
allowing the ->func field of rcu_head to encode only the index of the
global array of pointers to kmem_cache structures? Or would something
else work better?

Thanx, Paul