diff options
author | Alex Chiang <achiang@hp.com> | 2009-12-14 20:57:54 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-15 11:53:11 -0500 |
commit | bb86a7338b7a864c03e1736a8d370b10254b0300 (patch) | |
tree | d671c0725c2332df2a2180b64a7b5957aef7b59b /Documentation | |
parent | 9fdcd886ab407dbe3f854579417e6b036222a468 (diff) |
page-types: exit early when invoked with -d|--describe
On a system with large amount of memory (256GB), invoking page-types can
take quite a long time, which is unreasonable considering the user only
wants a description of the flags:
# time ./page-types -d 0x10
0x0000000000000010 ____D_____________________________ dirty
real 0m34.285s
user 0m1.966s
sys 0m32.313s
This is because we still walk the entire address range.
Exiting early seems like a reasonble solution:
# time ./page-types -d 0x10
0x0000000000000010 ____D_____________________________ dirty
real 0m0.007s
user 0m0.001s
sys 0m0.005s
Signed-off-by: Alex Chiang <achiang@hp.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Haicheng Li <haicheng.li@intel.com>
Acked-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/vm/page-types.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Documentation/vm/page-types.c b/Documentation/vm/page-types.c index 19ca23c773a6..7a7d9bab32ef 100644 --- a/Documentation/vm/page-types.c +++ b/Documentation/vm/page-types.c | |||
@@ -940,9 +940,8 @@ int main(int argc, char *argv[]) | |||
940 | parse_bits_mask(optarg); | 940 | parse_bits_mask(optarg); |
941 | break; | 941 | break; |
942 | case 'd': | 942 | case 'd': |
943 | opt_no_summary = 1; | ||
944 | describe_flags(optarg); | 943 | describe_flags(optarg); |
945 | break; | 944 | exit(0); |
946 | case 'l': | 945 | case 'l': |
947 | opt_list = 1; | 946 | opt_list = 1; |
948 | break; | 947 | break; |