mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] SLUB: use page allocator for PAGE_SIZE requests
@ 2008-11-22 12:32 Vegard Nossum
  2008-11-22 12:35 ` Vegard Nossum
  0 siblings, 1 reply; 3+ messages in thread
From: Vegard Nossum @ 2008-11-22 12:32 UTC (permalink / raw)
  To: Pekka Enberg; +Cc: Mel Gorman, Christoph Lameter, linux-kernel

>From 4d526db4781aaab86cb79ff8135bb0e2bc560598 Mon Sep 17 00:00:00 2001
From: Vegard Nossum <vegard.nossum@gmail.com>
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 <penberg@cs.helsinki.fi>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: Christoph Lameter <cl@linux-foundation.org>
Signed-off-by: Vegard Nossum <vegard.nossum@gmail.com>
---
 include/linux/slub_def.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h
index 2f5c16b..62ce0dc 100644
--- a/include/linux/slub_def.h
+++ b/include/linux/slub_def.h
@@ -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)) {
-- 
1.5.6.5


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] SLUB: use page allocator for PAGE_SIZE requests
  2008-11-22 12:32 [PATCH] SLUB: use page allocator for PAGE_SIZE requests Vegard Nossum
@ 2008-11-22 12:35 ` Vegard Nossum
  2008-11-22 12:37   ` Vegard Nossum
  0 siblings, 1 reply; 3+ messages in thread
From: Vegard Nossum @ 2008-11-22 12:35 UTC (permalink / raw)
  To: Pekka Enberg; +Cc: Mel Gorman, Christoph Lameter, linux-kernel

On Sat, Nov 22, 2008 at 1:32 PM, Vegard Nossum <vegard.nossum@gmail.com> wrote:
> From 4d526db4781aaab86cb79ff8135bb0e2bc560598 Mon Sep 17 00:00:00 2001
> From: Vegard Nossum <vegard.nossum@gmail.com>
> 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

-- 
"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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] SLUB: use page allocator for PAGE_SIZE requests
  2008-11-22 12:35 ` Vegard Nossum
@ 2008-11-22 12:37   ` Vegard Nossum
  0 siblings, 0 replies; 3+ messages in thread
From: Vegard Nossum @ 2008-11-22 12:37 UTC (permalink / raw)
  To: Pekka Enberg; +Cc: Mel Gorman, Christoph Lameter, linux-kernel

On Sat, Nov 22, 2008 at 1:35 PM, Vegard Nossum <vegard.nossum@gmail.com> wrote:
> On Sat, Nov 22, 2008 at 1:32 PM, Vegard Nossum <vegard.nossum@gmail.com> wrote:
>> From 4d526db4781aaab86cb79ff8135bb0e2bc560598 Mon Sep 17 00:00:00 2001
>> From: Vegard Nossum <vegard.nossum@gmail.com>
>> 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.

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

commit 331dc558fa020451ff773973cee855fd721aa88e
Author: Christoph Lameter <clameter@sgi.com>
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

-- 
"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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-11-22 12:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-22 12:32 [PATCH] SLUB: use page allocator for PAGE_SIZE requests Vegard Nossum
2008-11-22 12:35 ` Vegard Nossum
2008-11-22 12:37   ` Vegard Nossum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®