[PATCH] record last user if malloc request is exact 4k

From: Olaf Hering
Date: Mon Jan 30 2006 - 12:47:41 EST


Is there a reason why a 4096 malloc is not recorded?
untested patch below.


allow SLAB_STORE_USER also with an exact 4k request.

Signed-off-by: Olaf Hering <olh@xxxxxxx>

mm/slab.c | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6.16-rc1-olh/mm/slab.c
===================================================================
--- linux-2.6.16-rc1-olh.orig/mm/slab.c
+++ linux-2.6.16-rc1-olh/mm/slab.c
@@ -1637,7 +1637,7 @@ kmem_cache_create (const char *name, siz
* above the next power of two: caches with object sizes just above a
* power of two have a significant amount of internal fragmentation.
*/
- if ((size < 4096
+ if ((size <= 4096
|| fls(size - 1) == fls(size - 1 + 3 * BYTES_PER_WORD)))
flags |= SLAB_RED_ZONE | SLAB_STORE_USER;
if (!(flags & SLAB_DESTROY_BY_RCU))

--
short story of a lazy sysadmin:
alias appserv=wotan
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/