On Tue, Apr 14, 2009 at 12:22:31PM +0800, Wu Fengguang wrote: > Export the following page flags in /proc/kpageflags, > just in case they will be useful to someone: > > - PG_swapcache > - PG_swapbacked > - PG_mappedtodisk > - PG_reserved > - PG_private > - PG_private_2 > - PG_owner_priv_1 > > - PG_head > - PG_tail > - PG_compound > > - PG_unevictable > - PG_mlocked > > - PG_poison > > Also add the following two pseudo page flags: > > - PG_MMAP: whether the page is memory mapped > - PG_NOPAGE: whether the page is present > > This increases the total number of exported page flags to 25. And here are two simple tools utilizing the exported page flags: # ./page-types flags page-count MB symbolic-flags long-symbolic-flags 0x000000 472521 1845 _________________________ 0x000020 1 0 _____l___________________ lru 0x000028 2516 9 ___U_l___________________ uptodate,lru 0x00002c 5209 20 __RU_l___________________ referenced,uptodate,lru 0x000068 234 0 ___U_lA__________________ uptodate,lru,active 0x00006c 981 3 __RU_lA__________________ referenced,uptodate,lru,active 0x000228 49 0 ___U_l___x_______________ uptodate,lru,reclaim 0x000400 547 2 __________B______________ buddy 0x000804 1 0 __R________m_____________ referenced,mmap 0x000828 1073 4 ___U_l_____m_____________ uptodate,lru,mmap 0x00082c 318 1 __RU_l_____m_____________ referenced,uptodate,lru,mmap 0x000868 235 0 ___U_lA____m_____________ uptodate,lru,active,mmap 0x00086c 822 3 __RU_lA____m_____________ referenced,uptodate,lru,active,mmap 0x000880 1510 5 _______S___m_____________ slab,mmap 0x0008c0 49 0 ______AS___m_____________ active,slab,mmap 0x002078 1 0 ___UDlA______b___________ uptodate,dirty,lru,active,swapbacked 0x00207c 17 0 __RUDlA______b___________ referenced,uptodate,dirty,lru,active,swapbacked 0x002808 10 0 ___U_______m_b___________ uptodate,mmap,swapbacked 0x002868 3296 12 ___U_lA____m_b___________ uptodate,lru,active,mmap,swapbacked 0x00286c 25 0 __RU_lA____m_b___________ referenced,uptodate,lru,active,mmap,swapbacked 0x002878 2 0 ___UDlA____m_b___________ uptodate,dirty,lru,active,mmap,swapbacked 0x008000 19247 75 _______________r_________ reserved 0x080000 15 0 ___________________H_____ head 0x080014 1 0 __R_D______________H_____ referenced,dirty,head 0x080880 915 3 _______S___m_______H_____ slab,mmap,head 0x0808c0 60 0 ______AS___m_______H_____ active,slab,mmap,head 0x100000 4309 16 ____________________T____ tail 0x100014 4 0 __R_D_______________T____ referenced,dirty,tail total 513968 2007 To show the compound tail pages: # ./page-areas 0x100000 offset len KB 3089 3 12KB 487441 7 28KB 487449 7 28KB 487457 7 28KB 487465 7 28KB 487473 7 28KB 487481 7 28KB 487489 7 28KB 487497 7 28KB 487505 7 28KB 487513 7 28KB 487521 7 28KB 487529 7 28KB 487537 7 28KB 487545 7 28KB 487553 7 28KB 487561 7 28KB 487569 7 28KB 487577 7 28KB 487585 7 28KB 487593 7 28KB 487617 7 28KB 487627 1 4KB 487629 1 4KB 487633 7 28KB 487641 7 28KB 487649 7 28KB 487657 7 28KB 487665 7 28KB 487673 7 28KB 487681 7 28KB 487689 7 28KB 487697 7 28KB 487705 7 28KB 487713 7 28KB 487721 7 28KB 487729 7 28KB 487737 7 28KB 487745 7 28KB 487753 7 28KB 487761 7 28KB 487769 7 28KB 487777 7 28KB 487785 7 28KB 487793 7 28KB 487801 7 28KB 487809 7 28KB 487817 7 28KB 487825 7 28KB 487853 3 12KB 487865 7 28KB 487873 3 12KB 487893 3 12KB 487897 3 12KB 487901 3 12KB 487905 3 12KB 487909 3 12KB 487929 7 28KB 487937 7 28KB 487945 7 28KB 493569 3 12KB 493573 1 4KB 493575 1 4KB 493585 7 28KB 493593 3 12KB 493597 3 12KB 493601 7 28KB 493609 7 28KB 493617 7 28KB 493625 1 4KB 493633 7 28KB 493641 3 12KB 493645 3 12KB [snip] Thanks, Fengguang