diff options
author | Joonsoo Kim <iamjoonsoo.kim@lge.com> | 2016-07-26 18:23:52 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-07-26 19:19:19 -0400 |
commit | 371376750fce0abb09b1aa3fd8ae7025813a3488 (patch) | |
tree | 7729f3a2a18f682dc72a7285f97d7a2408daa5c2 /tools/vm | |
parent | a9627bc5e34e79ae80a33241b8a1501cc498e191 (diff) |
tools/vm/page_owner: increase temporary buffer size
Page owner will be changed to store more deep stacktrace so current
temporary buffer size isn't enough. Increase it.
Link: http://lkml.kernel.org/r/1464230275-25791-5-git-send-email-iamjoonsoo.kim@lge.com
Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Alexander Potapenko <glider@google.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Michal Hocko <mhocko@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'tools/vm')
-rw-r--r-- | tools/vm/page_owner_sort.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/vm/page_owner_sort.c b/tools/vm/page_owner_sort.c index 77147b42d598..f1c055f3c243 100644 --- a/tools/vm/page_owner_sort.c +++ b/tools/vm/page_owner_sort.c | |||
@@ -79,12 +79,12 @@ static void add_list(char *buf, int len) | |||
79 | } | 79 | } |
80 | } | 80 | } |
81 | 81 | ||
82 | #define BUF_SIZE 1024 | 82 | #define BUF_SIZE (128 * 1024) |
83 | 83 | ||
84 | int main(int argc, char **argv) | 84 | int main(int argc, char **argv) |
85 | { | 85 | { |
86 | FILE *fin, *fout; | 86 | FILE *fin, *fout; |
87 | char buf[BUF_SIZE]; | 87 | char *buf; |
88 | int ret, i, count; | 88 | int ret, i, count; |
89 | struct block_list *list2; | 89 | struct block_list *list2; |
90 | struct stat st; | 90 | struct stat st; |
@@ -107,6 +107,11 @@ int main(int argc, char **argv) | |||
107 | max_size = st.st_size / 100; /* hack ... */ | 107 | max_size = st.st_size / 100; /* hack ... */ |
108 | 108 | ||
109 | list = malloc(max_size * sizeof(*list)); | 109 | list = malloc(max_size * sizeof(*list)); |
110 | buf = malloc(BUF_SIZE); | ||
111 | if (!list || !buf) { | ||
112 | printf("Out of memory\n"); | ||
113 | exit(1); | ||
114 | } | ||
110 | 115 | ||
111 | for ( ; ; ) { | 116 | for ( ; ; ) { |
112 | ret = read_block(buf, BUF_SIZE, fin); | 117 | ret = read_block(buf, BUF_SIZE, fin); |