Naoya Horiguchi
5dc37642cb
mm hugetlb: add hugepage support to pagemap
This patch enables extraction of the pfn of a hugepage from
/proc/pid/pagemap in an architecture independent manner.
Details
-------
My test program (leak_pagemap) works as follows:
- creat() and mmap() a file on hugetlbfs (file size is 200MB == 100 hugepages,)
- read()/write() something on it,
- call page-types with option -p,
- munmap() and unlink() the file on hugetlbfs
Without my patches
------------------
$ ./leak_pagemap
flags page-count MB symbolic-flags long-symbolic-flags
0x0000000000000000 1 0 __________________________________
0x0000000000000804 1 0 __R________M______________________ referenced,mmap
0x000000000000086c 81 0 __RU_lA____M______________________ referenced,uptodate,lru,active,mmap
0x0000000000005808 5 0 ___U_______Ma_b___________________ uptodate,mmap,anonymous,swapbacked
0x0000000000005868 12 0 ___U_lA____Ma_b___________________ uptodate,lru,active,mmap,anonymous,swapbacked
0x000000000000586c 1 0 __RU_lA____Ma_b___________________ referenced,uptodate,lru,active,mmap,anonymous,swapbacked
total 101 0
The output of page-types don't show any hugepage.
With my patches
---------------
$ ./leak_pagemap
flags page-count MB symbolic-flags long-symbolic-flags
0x0000000000000000 1 0 __________________________________
0x0000000000030000 51100 199 ________________TG________________ compound_tail,huge
0x0000000000028018 100 0 ___UD__________H_G________________ uptodate,dirty,compound_head,huge
0x0000000000000804 1 0 __R________M______________________ referenced,mmap
0x000000000000080c 1 0 __RU_______M______________________ referenced,uptodate,mmap
0x000000000000086c 80 0 __RU_lA____M______________________ referenced,uptodate,lru,active,mmap
0x0000000000005808 4 0 ___U_______Ma_b___________________ uptodate,mmap,anonymous,swapbacked
0x0000000000005868 12 0 ___U_lA____Ma_b___________________ uptodate,lru,active,mmap,anonymous,swapbacked
0x000000000000586c 1 0 __RU_lA____Ma_b___________________ referenced,uptodate,lru,active,mmap,anonymous,swapbacked
total 51300 200
The output of page-types shows 51200 pages contributing to hugepages,
containing 100 head pages and 51100 tail pages as expected.
[akpm@linux-foundation.org: build fix]
Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Wu Fengguang <fengguang.wu@intel.com>
Cc: Hugh Dickins <hugh.dickins@tiscali.co.uk>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: Lee Schermerhorn <lee.schermerhorn@hp.com>
Cc: Andy Whitcroft <apw@canonical.com>
Cc: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-12-15 08:53:24 -08:00
..
2009-11-08 01:50:21 -08:00
2009-12-14 00:26:26 +01:00
2009-12-09 19:52:01 -08:00
2009-12-13 19:21:56 +01:00
2009-11-18 22:19:03 -08:00
2009-11-24 08:18:54 +02:00
2009-12-03 13:23:12 -08:00
2009-11-04 09:50:58 -08:00
2009-11-04 09:50:58 -08:00
2009-11-04 09:50:58 -08:00
2009-11-04 09:50:58 -08:00
2009-12-14 12:49:47 +11:00
2009-12-14 10:22:11 -08:00
2009-10-27 16:47:55 -04:00
2009-12-03 15:58:56 -05:00
2009-11-04 09:50:58 -08:00
2009-11-04 09:50:58 -08:00
2009-09-24 07:21:05 -07:00
2009-12-11 15:34:40 -08:00
2009-10-19 15:55:59 +09:00
2009-09-27 11:39:25 -07:00
2009-12-03 18:01:23 -05:00
2009-09-30 16:12:20 -07:00
2009-10-29 13:59:26 +01:00
2009-11-26 09:16:19 +01:00
2009-12-03 09:24:48 +01:00
2009-10-01 21:19:34 +02:00
2009-11-10 12:31:43 +01:00
2009-11-02 23:39:15 -08:00
2009-11-24 15:06:47 +11:00
2009-12-04 23:41:47 +01:00
2009-12-03 19:28:51 +01:00
2009-10-01 16:11:11 -07:00
2009-12-04 15:39:55 +01:00
2009-11-13 20:46:24 +01:00
2009-12-08 19:28:09 -08:00
2009-11-08 20:57:03 -08:00
2009-12-05 15:32:03 -08:00
2009-11-02 15:47:54 +01:00
2009-12-05 15:32:03 -08:00
2009-11-25 17:57:36 +01:00
2009-12-09 17:09:36 +11:00
2009-11-24 13:33:34 -05:00
2009-12-06 21:10:56 +01:00
2009-10-19 12:58:55 +09:00
2009-12-02 22:07:23 -08:00
2009-12-11 11:24:51 -08:00
2009-11-09 09:40:57 +01:00
2009-12-08 19:26:55 -08:00
2009-11-04 09:50:58 -08:00
2009-11-04 15:20:57 +01:00
2009-10-01 21:17:49 +02:00
2009-10-01 21:17:49 +02:00
2009-11-25 17:57:36 +01:00
2009-10-06 10:35:10 +02:00
2009-11-04 09:50:58 -08:00
2009-12-03 13:18:04 -08:00
2009-12-10 15:02:51 +01:00
2009-11-11 15:22:49 +01:00
2009-12-10 15:02:53 +01:00
2009-12-10 09:34:40 -08:00
2009-12-03 12:14:36 -08:00
2009-11-04 09:50:58 -08:00
2009-10-31 11:40:51 +01:00
2009-12-11 11:24:52 -08:00
2009-12-10 15:02:50 +01:00
2009-11-19 18:12:05 +00:00
2009-11-19 18:11:35 +00:00
2009-11-24 17:00:27 +11:00
2009-12-09 13:55:26 -05:00
2009-10-07 15:52:09 -04:00
2009-10-08 12:16:35 -07:00
2009-11-04 09:50:58 -08:00
2009-11-10 11:50:21 +01:00
2009-12-03 11:58:47 +00:00
2009-12-08 20:30:41 -08:00
2009-10-26 09:40:29 +01:00
2009-11-05 14:08:03 +01:00
2009-12-10 13:08:11 +01:00
2009-12-15 08:53:12 -08:00
2009-12-14 10:10:55 -08:00
2009-12-01 14:47:32 +08:00
2009-11-20 00:25:42 +00:00
2009-12-14 21:17:29 +01:00
2009-11-17 10:16:32 -05:00
2009-12-02 21:58:33 -08:00
2009-11-28 15:05:05 -05:00
2009-11-04 09:50:58 -08:00
2009-11-04 09:50:58 -08:00
2009-11-04 09:50:58 -08:00
2009-11-04 09:50:58 -08:00
2009-11-04 09:50:58 -08:00
2009-11-04 09:50:58 -08:00
2009-11-04 09:50:58 -08:00
2009-12-08 20:42:28 -08:00
2009-11-04 09:50:58 -08:00
2009-11-04 09:50:58 -08:00
2009-11-26 15:53:10 -08:00
2009-11-04 09:50:58 -08:00
2009-11-04 09:50:58 -08:00
2009-11-04 09:50:58 -08:00
2009-11-04 09:50:58 -08:00
2009-11-26 16:00:36 -08:00
2009-11-19 11:08:54 -05:00
2009-11-04 09:50:58 -08:00
2009-12-09 19:43:33 -08:00
2009-11-04 09:50:58 -08:00
2009-12-03 12:14:38 -08:00
2009-11-24 15:06:47 +11:00
2009-10-02 15:42:19 +02:00
2009-11-20 00:52:09 -08:00
2009-12-02 23:38:13 -08:00
2009-11-04 14:22:21 +01:00
2009-12-04 16:36:18 +01:00
2009-11-04 09:50:58 -08:00
2009-09-26 10:17:19 -07:00
2009-10-18 18:52:53 -07:00
2009-12-04 15:39:57 +01:00
2009-10-23 08:28:10 +02:00
2009-11-15 22:23:47 -08:00
2009-12-11 15:18:07 -08:00
2009-09-30 00:32:06 -04:00
2009-11-26 12:59:20 +01:00
2009-12-11 15:18:03 -08:00
2009-10-25 17:31:30 +01:00
2009-12-05 09:50:22 -08:00
2009-09-26 10:17:19 -07:00
2009-12-15 08:53:20 -08:00
2009-12-03 09:32:17 +02:00
2009-12-09 17:14:38 +11:00
2009-12-09 19:42:25 -08:00
2009-10-01 21:17:49 +02:00
2009-11-10 09:33:46 +11:00
2009-12-15 08:53:20 -08:00
2009-12-15 08:53:12 -08:00
2009-12-15 08:53:20 -08:00
2009-09-27 11:39:25 -07:00
2009-12-15 08:53:24 -08:00
2009-09-25 00:32:58 +09:30
2009-10-29 08:56:17 +10:30
2009-11-04 09:50:58 -08:00
2009-11-04 09:50:58 -08:00
2009-12-11 11:24:54 -08:00
2009-11-04 09:50:58 -08:00
2009-12-05 15:22:26 -08:00
2009-12-03 15:59:22 -08:00
2009-11-04 09:50:58 -08:00
2009-11-04 09:50:58 -08:00
2009-12-05 16:08:40 -05:00
2009-12-04 15:55:38 -05:00
2009-09-26 10:17:19 -07:00
2009-12-05 16:08:40 -05:00
2009-11-20 10:05:52 +09:00
2009-11-28 15:05:05 -05:00
2009-11-06 14:32:24 +03:00
2009-12-15 08:53:13 -08:00
2009-12-15 08:53:13 -08:00
2009-12-01 16:15:50 -08:00
2009-12-15 08:53:12 -08:00
2009-10-15 10:58:07 -06:00
2009-10-15 10:58:09 -06:00
2009-12-09 12:12:44 +02:00
2009-12-15 08:53:17 -08:00
2009-12-12 14:27:24 -08:00
2009-11-04 13:06:36 -08:00
2009-12-14 10:11:34 -08:00
2009-12-04 15:56:19 -08:00
2009-10-29 22:34:12 +09:00
2009-12-08 10:02:12 +09:00
2009-11-15 09:51:24 +01:00
2009-12-09 09:48:20 +01:00
2009-09-24 15:38:57 -07:00
2009-11-04 09:50:58 -08:00
2009-11-04 09:50:58 -08:00
2009-12-04 15:39:55 +01:00
2009-12-11 11:24:55 -08:00
2009-12-06 16:17:57 +01:00
2009-12-06 16:17:57 +01:00
2009-10-04 15:05:10 -07:00
2009-12-03 11:43:23 +00:00
2009-10-04 03:23:17 +02:00
2009-12-02 09:55:33 +01:00
2009-12-10 15:02:54 +01:00
2009-09-27 11:39:25 -07:00
2009-10-23 17:26:37 +02:00
2009-11-10 22:26:29 -08:00
2009-11-22 18:58:16 +01:00
2009-11-22 18:58:16 +01:00
2009-11-22 18:58:16 +01:00
2009-10-30 15:06:37 -07:00
2009-10-14 23:28:12 +02:00
2009-10-01 16:11:13 -07:00
2009-11-18 17:09:26 -05:00
2009-12-15 08:53:20 -08:00
2009-11-04 09:50:58 -08:00
2009-11-04 09:50:58 -08:00
2009-12-12 11:34:10 -08:00
2009-11-13 14:23:11 -08:00
2009-11-23 15:53:52 -05:00
2009-10-30 08:27:25 +11:00
2009-11-10 09:33:46 +11:00
2009-11-04 08:44:54 -08:00
2009-12-04 15:39:55 +01:00
2009-10-26 11:01:30 -07:00
2009-11-02 15:43:20 +09:00
2009-11-30 12:02:53 +09:00
2009-12-02 19:57:15 -08:00
2009-12-11 09:17:02 +01:00
2009-12-01 08:20:31 -08:00
2009-12-11 09:17:02 +01:00
2009-09-28 18:00:48 +02:00
2009-11-18 14:52:25 +01:00
2009-10-13 11:48:32 -07:00
2009-10-29 03:00:06 -07:00
2009-11-13 20:53:28 +01:00
2009-11-24 14:41:13 +01:00
2009-10-26 09:40:30 +01:00
2009-10-29 07:39:25 -07:00
2009-11-17 17:40:33 -08:00
2009-12-15 08:53:16 -08:00
2009-11-15 09:03:10 +01:00
2009-12-11 06:44:29 -05:00
2009-12-09 19:43:33 -08:00
2009-12-02 22:07:25 -08:00
2009-11-13 20:46:24 +01:00
2009-11-13 20:46:24 +01:00
2009-12-08 19:30:19 -08:00
2009-10-14 15:02:34 +02:00
2009-10-29 11:17:40 +11:00
2009-12-09 14:05:49 -05:00
2009-11-26 09:04:55 +01:00
2009-09-27 13:35:16 -07:00
2009-12-11 15:18:08 -08:00
2009-11-20 00:52:05 -08:00
2009-11-10 20:54:38 -08:00
2009-12-11 11:55:26 -08:00
2009-12-11 11:55:27 -08:00
2009-12-10 22:55:37 +01:00
2009-11-29 22:03:04 +01:00
2009-09-24 09:57:08 -07:00
2009-12-09 19:50:49 -08:00
2009-10-22 16:39:28 +10:30
2009-10-22 16:39:28 +10:30
2009-10-22 16:39:30 +10:30
2009-10-22 16:39:28 +10:30
2009-10-22 16:39:28 +10:30
2009-10-22 16:39:28 +10:30
2009-12-15 08:53:16 -08:00
2009-11-13 15:54:27 -08:00
2009-11-19 13:43:06 -08:00
2009-11-16 01:09:48 +09:00
2009-12-03 13:54:25 +01:00
2009-11-18 23:30:41 -08:00
2009-11-25 15:48:37 -08:00