login
Login
/
Register
Search
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2008
»
November
»
13
Re: [PATCH] slab: document SLAB_DESTROY_BY_RCU
view
thread
!MAILaRCHIVE_VOTE_RePLACE
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From:
Paul E. McKenney <paulmck@...>
To: Peter Zijlstra <peterz@...>
Cc: Andrew Morton <akpm@...>, linux-kernel <linux-kernel@...>, hugh <hugh@...>, Jens Axboe <jens.axboe@...>, Eric Dumazet <dada1@...>
Subject:
Re: [PATCH] slab: document SLAB_DESTROY_BY_RCU
Date: Thursday, November 13, 2008 - 1:32 pm
On Thu, Nov 13, 2008 at 03:28:29PM +0100, Peter Zijlstra wrote:
quoted text
> Subject: slab: document SLAB_DESTROY_BY_RCU > From: Peter Zijlstra <a.p.zijlstra@chello.nl> > Date: Wed, 02 Apr 2008 14:13:42 +0200 > > Explain this SLAB_DESTROY_BY_RCU thing...
With Hugh's suggested change, Re-acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
quoted text
> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> > Acked-by: Jens Axboe <jens.axboe@oracle.com> > Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> > --- > include/linux/slab.h | 26 ++++++++++++++++++++++++++ > 1 file changed, 26 insertions(+) > > Index: linux-2.6/include/linux/slab.h > =================================================================== > --- linux-2.6.orig/include/linux/slab.h > +++ linux-2.6/include/linux/slab.h > @@ -23,6 +23,32 @@ > #define SLAB_CACHE_DMA 0x00004000UL /* Use GFP_DMA memory */ > #define SLAB_STORE_USER 0x00010000UL /* DEBUG: Store the last owner for bug hunting */ > #define SLAB_PANIC 0x00040000UL /* Panic if kmem_cache_create() fails */ > +/* > + * SLAB_DESTROY_BY_RCU - **WARNING** READ THIS! > + * > + * This delays freeing the SLAB page by a grace period, it does _NOT_ > + * delay object freeing. This means that if you do kmem_cache_free() > + * that memory location is free to be reused at any time. Thus it may > + * be possible to see another object there in the same RCU grace period. > + * > + * This feature only ensures the memory location backing the object > + * stays valid, the trick to using this is relying on an independent > + * object validation pass. Something like: > + * > + * rcu_read_lock() > + * again: > + * obj = lockless_lookup(key); > + * if (obj) { > + * if (!try_get_ref(obj)) // might fail for free objects > + * goto again; > + * > + * if (obj->key != key) { // not the object we expected > + * put_ref(obj); > + * goto again; > + * } > + * } > + * rcu_read_unlock(); > + */ > #define SLAB_DESTROY_BY_RCU 0x00080000UL /* Defer freeing slabs to RCU */ > #define SLAB_MEM_SPREAD 0x00100000UL /* Spread some memory over cpuset */ > #define SLAB_TRACE 0x00200000UL /* Trace allocations and frees */ >
--
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[PATCH] slab: document SLAB_DESTROY_BY_RCU
, Peter Zijlstra
, (Thu Nov 13, 10:28 am)
Re: [PATCH] slab: document SLAB_DESTROY_BY_RCU
, Paul E. McKenney
, (Thu Nov 13, 1:32 pm)
Re: [PATCH] slab: document SLAB_DESTROY_BY_RCU
, Hugh Dickins
, (Thu Nov 13, 12:33 pm)
Re: [PATCH] slab: document SLAB_DESTROY_BY_RCU
, Pekka Enberg
, (Thu Nov 13, 2:23 pm)
Re: [PATCH] slab: document SLAB_DESTROY_BY_RCU
, Peter Zijlstra
, (Thu Nov 13, 1:05 pm)
Re: [PATCH] slab: document SLAB_DESTROY_BY_RCU
, Pekka Enberg
, (Thu Nov 13, 10:57 am)
Re: [PATCH] slab: document SLAB_DESTROY_BY_RCU
, Christoph Lameter
, (Thu Nov 13, 1:25 pm)
Re: [PATCH] slab: document SLAB_DESTROY_BY_RCU
, Pekka Enberg
, (Thu Nov 13, 1:31 pm)
Re: [PATCH] slab: document SLAB_DESTROY_BY_RCU
, Peter Zijlstra
, (Thu Nov 13, 1:50 pm)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Greg Kroah-Hartman
[PATCH 005/196] Chinese: add translation of SubmittingDrivers
Nick Piggin
[patch] my mmu notifier sample driver
Sean
Re: [AppArmor 39/45] AppArmor: Profile loading and manipulation, pathname matching
Arjan van de Ven
[Patch v2] Make PCI extended config space (MMCONFIG) a driver opt-in
git
:
linux-netdev
:
Antonio Almeida
HTB accuracy for high speed
Gerrit Renker
[PATCH 0/37] dccp: Feature negotiation - last call for comments
Jens Axboe
Re: [BUG] New Kernel Bugs
Jarek Poplawski
[PATCH] pkt_sched: Destroy gen estimators under rtnl_lock().
openbsd-misc
:
Colocation donated by:
Who's online
There are currently
9 users
and
771 guests
online.
Online users
chester2009
roatanbeachhou
consignmentiwow
MarlousManifest
cheapairpurirp
jkola199
stanleygivins86
cilove22
macesprayiabjy
Syndicate