diff options
author | Ezequiel Garcia <elezegarcia@gmail.com> | 2012-10-22 08:04:31 -0400 |
---|---|---|
committer | Pekka Enberg <penberg@kernel.org> | 2012-10-31 02:53:54 -0400 |
commit | 8cf9864b1382851d90c7c505f8441c8928f1469e (patch) | |
tree | 0636c421980945c29706658d00d045f8089d486e /mm/slob.c | |
parent | 242860a47a75b933a79a30f6a40bf4858f4a3ecc (diff) |
mm/slob: Use free_page instead of put_page for page-size kmalloc allocations
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>
Acked-by: Glauber Costa <glommer@parallels.com>
Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
Diffstat (limited to 'mm/slob.c')
-rw-r--r-- | mm/slob.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -500,7 +500,7 @@ void kfree(const void *block) | |||
500 | unsigned int *m = (unsigned int *)(block - align); | 500 | unsigned int *m = (unsigned int *)(block - align); |
501 | slob_free(m, *m + align); | 501 | slob_free(m, *m + align); |
502 | } else | 502 | } else |
503 | put_page(sp); | 503 | __free_pages(sp, compound_order(sp)); |
504 | } | 504 | } |
505 | EXPORT_SYMBOL(kfree); | 505 | EXPORT_SYMBOL(kfree); |
506 | 506 | ||