Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a5c96d8a1c67f31ef48935a78da2d2076513842b
Commit:     a5c96d8a1c67f31ef48935a78da2d2076513842b
Parent:     ce8c2293be47999584908069e78bf6d94beadc53
Author:     Linus Torvalds <[EMAIL PROTECTED]>
AuthorDate: Thu Jul 19 13:17:15 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Thu Jul 19 13:17:15 2007 -0700

    Fix up non-NUMA SLAB configuration for zero-sized allocations
    
    I suspect Christoph tested his code only in the NUMA configuration, for
    the combination of SLAB+non-NUMA the zero-sized kmalloc's would not work.
    
    Of course, this would only trigger in configurations where those zero-
    sized allocations happen (not very common), so that may explain why it
    wasn't more widely noticed.
    
    Seen by by Andi Kleen under qemu, and there seems to be a report by
    Michael Tsirkin on it too.
    
    Cc: Andi Kleen <[EMAIL PROTECTED]>
    Cc: Roland Dreier <[EMAIL PROTECTED]>
    Cc: Michael S. Tsirkin <[EMAIL PROTECTED]>
    Cc: Pekka Enberg <[EMAIL PROTECTED]>
    Cc: Christoph Lameter <[EMAIL PROTECTED]>
    Cc: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 mm/slab.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/slab.c b/mm/slab.c
index 88bc633..c3feeaa 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -3690,8 +3690,8 @@ static __always_inline void *__do_kmalloc(size_t size, 
gfp_t flags,
         * functions.
         */
        cachep = __find_general_cachep(size, flags);
-       if (unlikely(cachep == NULL))
-               return NULL;
+       if (unlikely(ZERO_OR_NULL_PTR(cachep)))
+               return cachep;
        return __cache_alloc(cachep, flags, caller);
 }
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to