[RFC/PATCH 2/2] mm, slob: Save real allocated size in page->private

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



As documented in slob.c header, page->private field is used to return
accurately the allocated size, through ksize().
Therefore, if one allocates a contiguous set of pages the available size
is PAGE_SIZE << order, instead of the requested size.

Cc: Pekka Enberg <penberg@xxxxxxxxxx>
Cc: Christoph Lameter <cl@xxxxxxxxx>
Cc: Glauber Costa <glommer@xxxxxxxxxxxxx>
Signed-off-by: Ezequiel Garcia <elezegarcia@xxxxxxxxx>
---
 mm/slob.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/mm/slob.c b/mm/slob.c
index 686e98b..4c89b7d 100644
--- a/mm/slob.c
+++ b/mm/slob.c
@@ -459,7 +459,7 @@ void *__kmalloc_node(size_t size, gfp_t gfp, int node)
 			return NULL;
 
 		page = virt_to_page(ret);
-		page->private = size;
+		page->private = PAGE_SIZE << order;
 
 		trace_kmalloc_node(_RET_IP_, ret,
 				   size, PAGE_SIZE << order, gfp, node);
-- 
1.7.8.6

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


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]