linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/2] mm/slob: Use free_page instead of put_page for page-size kmalloc allocations
@ 2012-10-22 12:04 Ezequiel Garcia
  2012-10-22 12:07 ` Glauber Costa
  0 siblings, 1 reply; 3+ messages in thread
From: Ezequiel Garcia @ 2012-10-22 12:04 UTC (permalink / raw)
  To: linux-mm, linux-kernel
  Cc: Tim Bird, Ezequiel Garcia, Christoph Lameter, Pekka Enberg,
	Matt Mackall, Glauber Costa

When freeing objects, the slob allocator currently free empty pages
calling __free_pages(). However, page-size kmallocs are disposed
using put_page() instead.

It makes no sense to call put_page() for kernel pages that are provided
by the object allocator, so we shouldn't be doing this ourselves.

This is based on:
commit d9b7f22623b5fa9cc189581dcdfb2ac605933bf4
Author: Glauber Costa <glommer@parallels.com>
slub: use free_page instead of put_page for freeing kmalloc allocation

Cc: Christoph Lameter <cl@linux-foundation.org>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Matt Mackall <mpm@selenic.com>
Cc: Glauber Costa <glommer@parallels.com>
Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
---
 mm/slob.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/mm/slob.c b/mm/slob.c
index a65e802..362632d 100644
--- a/mm/slob.c
+++ b/mm/slob.c
@@ -506,7 +506,7 @@ void kfree(const void *block)
 		unsigned int *m = (unsigned int *)(block - align);
 		slob_free(m, *m + align);
 	} else
-		put_page(sp);
+		__free_pages(sp, compound_order(sp));
 }
 EXPORT_SYMBOL(kfree);
 
-- 
1.7.8.6

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [PATCH 2/2] mm/slob: Use free_page instead of put_page for page-size kmalloc allocations
  2012-10-22 12:04 [PATCH 2/2] mm/slob: Use free_page instead of put_page for page-size kmalloc allocations Ezequiel Garcia
@ 2012-10-22 12:07 ` Glauber Costa
  2012-10-31  6:56   ` Pekka Enberg
  0 siblings, 1 reply; 3+ messages in thread
From: Glauber Costa @ 2012-10-22 12:07 UTC (permalink / raw)
  To: Ezequiel Garcia
  Cc: linux-mm, linux-kernel, Tim Bird, Christoph Lameter, Pekka Enberg,
	Matt Mackall

On 10/22/2012 04:04 PM, Ezequiel Garcia wrote:
> When freeing objects, the slob allocator currently free empty pages
> calling __free_pages(). However, page-size kmallocs are disposed
> using put_page() instead.
> 
> It makes no sense to call put_page() for kernel pages that are provided
> by the object allocator, so we shouldn't be doing this ourselves.
> 
> This is based on:
> commit d9b7f22623b5fa9cc189581dcdfb2ac605933bf4
> Author: Glauber Costa <glommer@parallels.com>
Acked-by: Glauber Costa <glommer@parallels.com>

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [PATCH 2/2] mm/slob: Use free_page instead of put_page for page-size kmalloc allocations
  2012-10-22 12:07 ` Glauber Costa
@ 2012-10-31  6:56   ` Pekka Enberg
  0 siblings, 0 replies; 3+ messages in thread
From: Pekka Enberg @ 2012-10-31  6:56 UTC (permalink / raw)
  To: Glauber Costa
  Cc: Ezequiel Garcia, linux-mm, linux-kernel, Tim Bird,
	Christoph Lameter, Matt Mackall

> On 10/22/2012 04:04 PM, Ezequiel Garcia wrote:
>> When freeing objects, the slob allocator currently free empty pages
>> calling __free_pages(). However, page-size kmallocs are disposed
>> using put_page() instead.
>>
>> It makes no sense to call put_page() for kernel pages that are provided
>> by the object allocator, so we shouldn't be doing this ourselves.
>>
>> This is based on:
>> commit d9b7f22623b5fa9cc189581dcdfb2ac605933bf4
>> Author: Glauber Costa <glommer@parallels.com>

On Mon, Oct 22, 2012 at 3:07 PM, Glauber Costa <glommer@parallels.com> wrote:
> Acked-by: Glauber Costa <glommer@parallels.com>

Applied, thanks Ezequiel!

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

end of thread, other threads:[~2012-10-31  6:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-22 12:04 [PATCH 2/2] mm/slob: Use free_page instead of put_page for page-size kmalloc allocations Ezequiel Garcia
2012-10-22 12:07 ` Glauber Costa
2012-10-31  6:56   ` Pekka Enberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).