diff options
author | Christoph Lameter <clameter@sgi.com> | 2007-05-06 17:50:17 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-07 15:12:57 -0400 |
commit | 4f104934591ed98534b3a4c3d17d972b790e9c42 (patch) | |
tree | 149d7ba5ab6b9b7f8a82eb3ce41cb36f28bccaf9 /mm/slub.c | |
parent | 50953fe9e00ebbeffa032a565ab2f08312d51a87 (diff) |
slab allocators: Remove SLAB_CTOR_ATOMIC
SLAB_CTOR atomic is never used which is no surprise since I cannot imagine
that one would want to do something serious in a constructor or destructor.
In particular given that the slab allocators run with interrupts disabled.
Actions in constructors and destructors are by their nature very limited
and usually do not go beyond initializing variables and list operations.
(The i386 pgd ctor and dtors do take a spinlock in constructor and
destructor..... I think that is the furthest we go at this point.)
There is no flag passed to the destructor so removing SLAB_CTOR_ATOMIC also
establishes a certain symmetry.
Signed-off-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/slub.c')
-rw-r--r-- | mm/slub.c | 10 |
1 files changed, 2 insertions, 8 deletions
@@ -802,14 +802,8 @@ static void setup_object(struct kmem_cache *s, struct page *page, | |||
802 | init_tracking(s, object); | 802 | init_tracking(s, object); |
803 | } | 803 | } |
804 | 804 | ||
805 | if (unlikely(s->ctor)) { | 805 | if (unlikely(s->ctor)) |
806 | int mode = SLAB_CTOR_CONSTRUCTOR; | 806 | s->ctor(object, s, SLAB_CTOR_CONSTRUCTOR); |
807 | |||
808 | if (!(s->flags & __GFP_WAIT)) | ||
809 | mode |= SLAB_CTOR_ATOMIC; | ||
810 | |||
811 | s->ctor(object, s, mode); | ||
812 | } | ||
813 | } | 807 | } |
814 | 808 | ||
815 | static struct page *new_slab(struct kmem_cache *s, gfp_t flags, int node) | 809 | static struct page *new_slab(struct kmem_cache *s, gfp_t flags, int node) |