diff options
author | Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> | 2016-03-17 14:17:44 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-03-17 15:09:34 -0700 |
commit | 0a71649cb724ab97df26baa7731ac31d2364bfe5 (patch) | |
tree | b315887e4cb6fc8d4beca23b9a8ef8687de5cab6 /fs/proc | |
parent | 832fc1de01aea28255cb11d270679b7f1273f0d7 (diff) | |
download | linux-rpi3-0a71649cb724ab97df26baa7731ac31d2364bfe5.tar.gz linux-rpi3-0a71649cb724ab97df26baa7731ac31d2364bfe5.tar.bz2 linux-rpi3-0a71649cb724ab97df26baa7731ac31d2364bfe5.zip |
/proc/kpageflags: return KPF_SLAB for slab tail pages
Currently /proc/kpageflags returns just KPF_COMPOUND_TAIL for slab tail
pages, which is inconvenient when grasping how slab pages are
distributed (userspace always needs to check which kind of tail pages by
itself). This patch sets KPF_SLAB for such pages.
With this patch:
$ grep Slab /proc/meminfo ; tools/vm/page-types -b slab
Slab: 64880 kB
flags page-count MB symbolic-flags long-symbolic-flags
0x0000000000000080 16220 63 _______S__________________________________ slab
total 16220 63
16220 pages equals to 64880 kB, so returned result is consistent with the
global counter.
Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Reviewed-by: Vladimir Davydov <vdavydov@virtuozzo.com>
Cc: Konstantin Khlebnikov <koct9i@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/proc')
-rw-r--r-- | fs/proc/page.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/proc/page.c b/fs/proc/page.c index 0be626d85331..712f1b9992cc 100644 --- a/fs/proc/page.c +++ b/fs/proc/page.c @@ -160,6 +160,8 @@ u64 stable_page_flags(struct page *page) u |= kpf_copy_bit(k, KPF_LOCKED, PG_locked); u |= kpf_copy_bit(k, KPF_SLAB, PG_slab); + if (PageTail(page) && PageSlab(compound_head(page))) + u |= 1 << KPF_SLAB; u |= kpf_copy_bit(k, KPF_ERROR, PG_error); u |= kpf_copy_bit(k, KPF_DIRTY, PG_dirty); |