This is a note to let you know that I've just added the patch titled

    slub: Make CONFIG_DEBUG_PAGE_ALLOC work with new fastpath

to the 2.6.39-stable tree which can be found at:
    
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     slub-make-config_debug_page_alloc-work-with-new-fastpath.patch
and it can be found in the queue-2.6.39 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.


>From 1393d9a1857471f816d0be1ccc1d6433a86050f6 Mon Sep 17 00:00:00 2001
From: Christoph Lameter <[email protected]>
Date: Mon, 16 May 2011 15:26:08 -0500
Subject: slub: Make CONFIG_DEBUG_PAGE_ALLOC work with new fastpath

From: Christoph Lameter <[email protected]>

commit 1393d9a1857471f816d0be1ccc1d6433a86050f6 upstream.

Fastpath can do a speculative access to a page that CONFIG_DEBUG_PAGE_ALLOC may 
have
marked as invalid to retrieve the pointer to the next free object.

Use probe_kernel_read in that case in order not to cause a page fault.

Reported-by: Eric Dumazet <[email protected]>
Signed-off-by: Christoph Lameter <[email protected]>
Signed-off-by: Eric Dumazet <[email protected]>
Signed-off-by: Pekka Enberg <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
 mm/slub.c |   14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

--- a/mm/slub.c
+++ b/mm/slub.c
@@ -261,6 +261,18 @@ static inline void *get_freepointer(stru
        return *(void **)(object + s->offset);
 }
 
+static inline void *get_freepointer_safe(struct kmem_cache *s, void *object)
+{
+       void *p;
+
+#ifdef CONFIG_DEBUG_PAGEALLOC
+       probe_kernel_read(&p, (void **)(object + s->offset), sizeof(p));
+#else
+       p = get_freepointer(s, object);
+#endif
+       return p;
+}
+
 static inline void set_freepointer(struct kmem_cache *s, void *object, void 
*fp)
 {
        *(void **)(object + s->offset) = fp;
@@ -1943,7 +1955,7 @@ redo:
                if (unlikely(!irqsafe_cpu_cmpxchg_double(
                                s->cpu_slab->freelist, s->cpu_slab->tid,
                                object, tid,
-                               get_freepointer(s, object), next_tid(tid)))) {
+                               get_freepointer_safe(s, object), 
next_tid(tid)))) {
 
                        note_cmpxchg_failure("slab_alloc", s, tid);
                        goto redo;


Patches currently in stable-queue which might be from [email protected] are

_______________________________________________
stable mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/stable

Reply via email to