Commit edfbe2b0038723e5699ab22695ccd62b5542a5c1
Committed by
Linus Torvalds
1 parent
2054606ad6
Exists in
master
and in
4 other branches
[PATCH] count bounce buffer pages in vmstat
This is a patch for counting the number of pages for bounce buffers. It's shown in /proc/vmstat. Currently, the number of bounce pages are not counted anywhere. So, if there are many bounce pages, it seems that there are leaked pages. And it's difficult for a user to imagine the usage of bounce pages. So, it's meaningful to show # of bouce pages. Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Showing 3 changed files with 4 additions and 0 deletions Side-by-side Diff
include/linux/page-flags.h
... | ... | @@ -131,6 +131,7 @@ |
131 | 131 | unsigned long allocstall; /* direct reclaim calls */ |
132 | 132 | |
133 | 133 | unsigned long pgrotated; /* pages rotated to tail of the LRU */ |
134 | + unsigned long nr_bounce; /* pages for bounce buffers */ | |
134 | 135 | }; |
135 | 136 | |
136 | 137 | extern void get_page_state(struct page_state *ret); |
mm/highmem.c
... | ... | @@ -325,6 +325,7 @@ |
325 | 325 | continue; |
326 | 326 | |
327 | 327 | mempool_free(bvec->bv_page, pool); |
328 | + dec_page_state(nr_bounce); | |
328 | 329 | } |
329 | 330 | |
330 | 331 | bio_endio(bio_orig, bio_orig->bi_size, err); |
... | ... | @@ -405,6 +406,7 @@ |
405 | 406 | to->bv_page = mempool_alloc(pool, q->bounce_gfp); |
406 | 407 | to->bv_len = from->bv_len; |
407 | 408 | to->bv_offset = from->bv_offset; |
409 | + inc_page_state(nr_bounce); | |
408 | 410 | |
409 | 411 | if (rw == WRITE) { |
410 | 412 | char *vto, *vfrom; |