lkml.org 
[lkml]   [2009]   [Dec]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] page-types: kernel pageflags mode
On Fri, 04 Dec 2009 14:29:48 -0700 Alex Chiang wrote:

> An earlier commit taught page-types the -d|--describe argument, which
> allows the user to describe page flags passed on the command line:
>
> # ./Documentation/vm/page-types -d 0x4000
> 0x0000000000004000 ______________b___________________ swapbacked
>
> In -d mode, page-types expects the page flag bits in the order generated
> by the kernel function get_uflags().
>
> However, those bits are rearranged compared to what is actually stored
> in struct page->flags. A kernel developer dumping a page's flags
> using printk, e.g., may get misleading results in -d mode.
>
> Teach page-types the -k mode, which parses and describes the bits in
> the internal kernel order:
>
> # ./Documentation/vm/page-types -k 0x4000
> 0x0000000000004000 ______________H_________ compound_head
>
> Note that the recommended way to build page-types is from the top-level
> kernel source directory. This ensures that it will get the same CONFIG_*
> defines used to build the kernel source.
>
> # make Documentation/vm/
>
> The implication is that attempting to use page-types -k on a kernel
> with different CONFIG_* settings may lead to surprising and misleading
> results. To retain sanity, always use the page-types built out of the
> kernel tree you are actually testing.
>
> Cc: fengguang.wu@intel.com
> Cc: Haicheng Li <haicheng.li@intel.com>
> Cc: Andi Kleen <andi@firstfloor.org>
> Cc: Randy Dunlap <randy.dunlap@oracle.com>
> Signed-off-by: Alex Chiang <achiang@hp.com>
> ---
>
> Applies on top of mmotm.
>
> Documentation/vm/Makefile | 2 +
> Documentation/vm/page-types.c | 117 +++++++++++++++++++++++++++++++++++++++--
> 2 files changed, 113 insertions(+), 6 deletions(-)
>
> diff --git a/Documentation/vm/Makefile b/Documentation/vm/Makefile
> index 5bd269b..1bebc43 100644
> --- a/Documentation/vm/Makefile
> +++ b/Documentation/vm/Makefile
> @@ -1,6 +1,8 @@
> # kbuild trick to avoid linker error. Can be omitted if a module is built.
> obj- := dummy.o
>
> +HOSTCFLAGS_page-types.o += $(LINUXINCLUDE)
> +
> # List of programs to build
> hostprogs-y := slabinfo page-types

I can ack the Makefile part. Thanks for the patch.

Not that I expect this patch to change for this, but I think that we
need to move tools (like this one) from Documentation/ to tools/ and
possibly move examples from Documentation/ to samples/ or tools/.



---
~Randy


\
 
 \ /
  Last update: 2009-12-04 23:21    [W:1.835 / U:0.424 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site