2010-04-01 09:31:15

by Yanmin Zhang

[permalink] [raw]
Subject: [PATCH]slub: fix bad scope checking

Function init_kmem_cache_nodes is incorrect when checking upper limitation
of kmalloc_caches.

The patch against latest tip/master fixes it.

From: Zhang, Yanmin <[email protected]>

---

--- linux-2.6/mm/slub.c 2010-04-01 17:01:21.091999999 +0800
+++ linux-2.6_slub/mm/slub.c 2010-04-01 17:04:34.876000010 +0800
@@ -2153,7 +2153,7 @@ static int init_kmem_cache_nodes(struct
int local_node;

if (slab_state >= UP && (s < kmalloc_caches ||
- s > kmalloc_caches + KMALLOC_CACHES))
+ s >= kmalloc_caches + KMALLOC_CACHES))
local_node = page_to_nid(virt_to_page(s));
else
local_node = 0;


2010-04-01 16:00:21

by Christoph Lameter

[permalink] [raw]
Subject: Re: [PATCH]slub: fix bad scope checking

On Thu, 1 Apr 2010, Zhang, Yanmin wrote:

> Function init_kmem_cache_nodes is incorrect when checking upper limitation
> of kmalloc_caches.

True.

Acked-by: Christoph Lameter <[email protected]>

2010-04-02 07:03:59

by Pekka Enberg

[permalink] [raw]
Subject: Re: [PATCH]slub: fix bad scope checking

Christoph Lameter wrote:
> On Thu, 1 Apr 2010, Zhang, Yanmin wrote:
>
>> Function init_kmem_cache_nodes is incorrect when checking upper limitation
>> of kmalloc_caches.
>
> True.
>
> Acked-by: Christoph Lameter <[email protected]>

Applied, thanks!