Re: [PATCH] rmaplock 2/6 SLAB_DESTROY_BY_RCU

From: Manfred Spraul
Date: Tue Jul 13 2004 - 11:37:11 EST


Hugh Dickins wrote:

It's okay to take anon_vma->lock after it's freed, so long as it remains
a struct anon_vma (its list would become empty, or perhaps reused for an
unrelated anon_vma: but no problem since we always check that the page
located is the right one); but corruption if that memory gets reused for
some other purpose.



An interesting idea:
The slab caches are object caches. If a rcu user only needs a valid object but doesn't care which one then there is no need to wait for a quiescent cycle after free - the quiescent cycle can be delayed until the destructor is called.

But there are two flaws in your patch:
- you must disable poisoning and unmapping if SLAB_DESTROY_BY_RCU is set.
- either delay the dtor calls a well or fail if an object has a non-NULL dtor and SLAB_DESTROY_BY_RCU is set.

--
Manfred
-
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/