lkml.org 
[lkml]   [2009]   [Jun]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH RFC] fix RCU-callback-after-kmem_cache_destroy problem in sl[aou]b
On Mon, 29 Jun 2009, Matt Mackall wrote:

> This is a reasonable point, and in keeping with the design principle
> 'callers should handle their own special cases'. However, I think it
> would be more than a little surprising for kmem_cache_free() to do the
> right thing, but not kmem_cache_destroy().

kmem_cache_free() must be used carefully when using SLAB_DESTROY_BY_RCU.
The freed object can be accessed after free until the rcu interval
expires (well sortof, it may even be reallocated within the interval).

There are special RCU considerations coming already with the use of
kmem_cache_free().

Adding RCU operations to the kmem_cache_destroy() logic may result in
unnecessary RCU actions for slabs where the coder is ensuring that the
RCU interval has passed by other means.





\
 
 \ /
  Last update: 2009-06-30 01:21    [W:0.071 / U:0.176 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site