mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] add gfp_mask to page owner
@ 2005-03-15 20:25 Alexander Nyberg
  0 siblings, 0 replies; only message in thread
From: Alexander Nyberg @ 2005-03-15 20:25 UTC (permalink / raw)
  To: akpm; +Cc: linux-kernel

Hi Andrew

After looking at the recent memory leak thread I think it might have
helped having the gfp mask of the allocated pages. This makes that
available, no changes needed for the user-space sorter, same trace with
different gfp masks will be in separate chunks.

Output looks like:

4819 times:
Page allocated via order 0, mask 0x50
[0xc012b7b9] find_lock_page+25
[0xc012b8c8] find_or_create_page+152
[0xc0147d74] grow_dev_page+36
[0xc0148164] __find_get_block+84
[0xc0147ebc] __getblk_slow+124
[0xc0148164] __find_get_block+84
[0xc01481e7] __getblk+55
[0xc0185d14] do_readahead+100


If you think it might be a good idea then here it is.


Index: linux-2.6.11/fs/proc/proc_misc.c
===================================================================
--- linux-2.6.11.orig/fs/proc/proc_misc.c	2005-03-15 21:13:43.000000000 +0100
+++ linux-2.6.11/fs/proc/proc_misc.c	2005-03-15 21:17:20.000000000 +0100
@@ -571,7 +571,8 @@
 	if (!kbuf)
 		return -ENOMEM;
 
-	ret = snprintf(kbuf, 1024, "Page allocated via order %d\n", page->order);
+	ret = snprintf(kbuf, 1024, "Page allocated via order %d, mask 0x%x\n",
+			page->order, page->gfp_mask);
 
 	for (i = 0; i < 8; i++) {
 		if (!page->trace[i])
Index: linux-2.6.11/mm/page_alloc.c
===================================================================
--- linux-2.6.11.orig/mm/page_alloc.c	2005-03-15 21:13:43.000000000 +0100
+++ linux-2.6.11/mm/page_alloc.c	2005-03-15 21:14:32.000000000 +0100
@@ -1050,6 +1050,7 @@
 	asm ("movl %%ebp, %0" : "=r" (bp) : );
 #endif
 	page->order = (int) order;
+	page->gfp_mask = gfp_mask;
 	__stack_trace(page, &address, bp);
 	}
 #endif /* CONFIG_PAGE_OWNER */
Index: linux-2.6.11/include/linux/mm.h
===================================================================
--- linux-2.6.11.orig/include/linux/mm.h	2005-03-15 21:13:43.000000000 +0100
+++ linux-2.6.11/include/linux/mm.h	2005-03-15 21:14:32.000000000 +0100
@@ -266,6 +266,7 @@
 #endif /* WANT_PAGE_VIRTUAL */
 #ifdef CONFIG_PAGE_OWNER
 	int order;
+	unsigned int gfp_mask;
 	unsigned long trace[8];
 #endif
 };





^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-03-15 19:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-15 20:25 [PATCH] add gfp_mask to page owner Alexander Nyberg

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®