Skip to contentSkip to conversation

SLUB: use page allocator for PAGE_SIZE requests

PATCH In review Vegard Nossum 1 participant 3 messages Nov 22, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 SLUB: use page allocator for PAGE_SIZE requests

Quoted 1 line

From 4d526db4781aaab86cb79ff8135bb0e2bc560598 Mon Sep 17 00:00:00 2001

From: Vegard Nossum <[email protected]>
Date: Sat, 22 Nov 2008 13:27:54 +0100
Subject: [PATCH] SLUB: use page allocator for PAGE_SIZE requests

It seems strange that we should use the page allocator for requests of (PAGE_SIZE + 1) bytes or more, and not for requests that are exactly PAGE_SIZE.

Cc Pekka Enberg <[email protected]>
Cc Mel Gorman <[email protected]>
Cc Christoph Lameter <[email protected]>
---
 include/linux/slub_def.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
include/linux/slub_def.h +1 -1
index 2f5c16b..62ce0dc 100644
@@ -212,7 +212,7 @@ static __always_inline void *kmalloc_large(size_t size, gfp_t flags)
 static __always_inline void *kmalloc(size_t size, gfp_t flags)
 {
 	if (__builtin_constant_p(size)) {
-		if (size > PAGE_SIZE)
+		if (size >= PAGE_SIZE)
 			return kmalloc_large(size, flags);
 
 		if (!(flags & SLUB_DMA)) {
Signature · 1 line
1.5.6.5
#1 lore raw
Quoted 8 lines · Vegard Nossum

From 4d526db4781aaab86cb79ff8135bb0e2bc560598 Mon Sep 17 00:00:00 2001
From: Vegard Nossum <[email protected]>
Date: Sat, 22 Nov 2008 13:27:54 +0100
Subject: [PATCH] SLUB: use page allocator for PAGE_SIZE requests

It seems strange that we should use the page allocator for requests of (PAGE_SIZE + 1) bytes or more, and not for requests that are exactly PAGE_SIZE.

Actually, there are some more places that need to be fixed. I think I'll send an updated patch that fixes all of them.

Vegard

Signature · 4 lines
"The animistic metaphor of the bug that maliciously sneaked in while
the programmer was not looking is intellectually dishonest as it
disguises that the error is the programmer's own creation."
	-- E. W. Dijkstra, EWD1036
#2 lore raw
Quoted 6 lines · Vegard Nossum
Quoted 5 lines · Vegard Nossum

From 4d526db4781aaab86cb79ff8135bb0e2bc560598 Mon Sep 17 00:00:00 2001
From: Vegard Nossum <[email protected]>
Date: Sat, 22 Nov 2008 13:27:54 +0100
Subject: [PATCH] SLUB: use page allocator for PAGE_SIZE requests

Quoted 6 lines
Quoted 3 lines

It seems strange that we should use the page allocator for requests of (PAGE_SIZE + 1) bytes or more, and not for requests that are exactly PAGE_SIZE.

Actually, there are some more places that need to be fixed. I think I'll send an updated patch that fixes all of them.

ACTUALLY, please ignore whole thread. I now read the commit message of

commit 331dc558fa020451ff773973cee855fd721aa88e

Author: Christoph Lameter <[email protected]>
Date:   Thu Feb 14 14:28:09 2008 -0800

slub: Support 4k kmallocs again to compensate for page allocator slowness

:-/

Sorry for the noise.

Vegard

Signature · 4 lines
"The animistic metaphor of the bug that maliciously sneaked in while
the programmer was not looking is intellectually dishonest as it
disguises that the error is the programmer's own creation."
	-- E. W. Dijkstra, EWD1036