mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] Fix mm regression bug: nommu use compound page in slab allocator
@ 2006-03-31  2:11 Luke Yang
  2006-04-08 16:55 ` Pekka Enberg
  0 siblings, 1 reply; 2+ messages in thread
From: Luke Yang @ 2006-03-31  2:11 UTC (permalink / raw)
  To: Nick Piggin, Andrew Morton, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1161 bytes --]

Hi all,

  The earlier patch to consolidate mmu and nommu page allocation
and refcounting by using compound pages for nommu allocations
had a bug: kmalloc slabs who's pages were initially allocated
by a non-__GFP_COMP allocator could be passed into mm/nommu.c
kmalloc allocations which really wanted __GFP_COMP underlying
pages. Fix that by having nommu pass __GFP_COMP to all higher order
slab allocations.

  Thanks Nick!

Signed-off-by: Luke Yang <luke.adi@gmail.com>
Acked-by: Nick Piggin <npiggin@suse.de>

 slab.c |    4 ++++
1 files changed, 4 insertions(+)

diff --git a/mm/slab.c b/mm/slab.c
index 4cbf8bb..388a6a9 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -1454,7 +1454,11 @@ static void *kmem_getpages(struct kmem_c
        int i;

        flags |= cachep->gfpflags;
+#ifdef CONFIG_MMU
        page = alloc_pages_node(nodeid, flags, cachep->gfporder);
+#else
+       page = alloc_pages_node(nodeid, (flags | __GFP_COMP), cachep->gfporder);
+#endif
        if (!page)
                return NULL;
        addr = page_address(page);

--
Best regards,
Luke Yang,  Kernel for Blackfin maintainer
luke.adi@gmail.com

[-- Attachment #2: nommu_use_compound_page_in_slab.patch --]
[-- Type: text/x-patch, Size: 430 bytes --]

diff --git a/mm/slab.c b/mm/slab.c
index 4cbf8bb..388a6a9 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -1454,7 +1454,11 @@ static void *kmem_getpages(struct kmem_c
 	int i;
 
 	flags |= cachep->gfpflags;
+#ifdef CONFIG_MMU
 	page = alloc_pages_node(nodeid, flags, cachep->gfporder);
+#else
+	page = alloc_pages_node(nodeid, (flags | __GFP_COMP), cachep->gfporder);
+#endif
 	if (!page)
 		return NULL;
 	addr = page_address(page);



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

* Re: [PATCH] Fix mm regression bug: nommu use compound page in slab allocator
  2006-03-31  2:11 [PATCH] Fix mm regression bug: nommu use compound page in slab allocator Luke Yang
@ 2006-04-08 16:55 ` Pekka Enberg
  0 siblings, 0 replies; 2+ messages in thread
From: Pekka Enberg @ 2006-04-08 16:55 UTC (permalink / raw)
  To: Luke Yang; +Cc: Nick Piggin, Andrew Morton, linux-kernel

Hi Luke,

On 3/31/06, Luke Yang <luke.adi@gmail.com> wrote:
>   The earlier patch to consolidate mmu and nommu page allocation
> and refcounting by using compound pages for nommu allocations
> had a bug: kmalloc slabs who's pages were initially allocated
> by a non-__GFP_COMP allocator could be passed into mm/nommu.c
> kmalloc allocations which really wanted __GFP_COMP underlying
> pages. Fix that by having nommu pass __GFP_COMP to all higher order
> slab allocations.

Any reason we are not doing this for CONFIG_MMU as well? We could then
fix the slab callers to not pass __GFP_COMP at all which seems broken
anyway.

                                 Pekka

> Signed-off-by: Luke Yang <luke.adi@gmail.com>
> Acked-by: Nick Piggin <npiggin@suse.de>
>
>  slab.c |    4 ++++
> 1 files changed, 4 insertions(+)
>
> diff --git a/mm/slab.c b/mm/slab.c
> index 4cbf8bb..388a6a9 100644
> --- a/mm/slab.c
> +++ b/mm/slab.c
> @@ -1454,7 +1454,11 @@ static void *kmem_getpages(struct kmem_c
>         int i;
>
>         flags |= cachep->gfpflags;
> +#ifdef CONFIG_MMU
>         page = alloc_pages_node(nodeid, flags, cachep->gfporder);
> +#else
> +       page = alloc_pages_node(nodeid, (flags | __GFP_COMP), cachep->gfporder);
> +#endif
>         if (!page)
>                 return NULL;
>         addr = page_address(page);

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

end of thread, other threads:[~2006-04-08 16:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-03-31  2:11 [PATCH] Fix mm regression bug: nommu use compound page in slab allocator Luke Yang
2006-04-08 16:55 ` Pekka Enberg

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®