Skip to contentSkip to conversation

makedumpfile: skip multiple pages filtered as free pages

PATCH In review HATAYAMA Daisuke 2 participants 2 messages Mar 14, 2013 – Mar 15, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 makedumpfile: skip multiple pages filtered as free pages

If buddy page has order n, (2^n) pages are filtered at the same time. Then, next (2^n) pages are already filterd, so we can skip the (2^n) pages for free.

By this, on 32GB memory system, there's the following improvement:

- with mmap() on /proc/vmcore from 0.594421 seconds to 0.496517 seconds, and
- with normal read() from 1.533796 seconds to 0.750935 seconds.

Note that the two improvements are measured on the same /proc/vmcore.

Note also that amount of the improvement depends on amount of free pages, though it's obvious.

---
 makedumpfile.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
makedumpfile.c +5 -2
index 7acbf72..9075f38 100644
@@ -4303,9 +4303,9 @@ __exclude_unnecessary_pages(unsigned long mem_map,
 		    && info->flag_cyclic
 		    && info->page_is_buddy
 		    && info->page_is_buddy(flags, _mapcount, private, _count)) {
-			int i;
+			int i, nr_pages = 1 << private;
 
-			for (i = 0; i < (1 << private); ++i) {
+			for (i = 0; i < nr_pages; ++i) {
 				/*
 				 * According to combination of
 				 * MAX_ORDER and size of cyclic
@@ -4318,6 +4318,9 @@ __exclude_unnecessary_pages(unsigned long mem_map,
 				clear_bit_on_2nd_bitmap_for_kernel(pfn + i);
 			}
 			pfn_free += i;
+
+			pfn += nr_pages - 1;
+			mem_map += (nr_pages - 1) * SIZE(page);
 		}
 		/*
 		 * Exclude the cache page without the private page.
Signature · 8 lines
1.8.1.4



_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
#1 lore raw
Quoted 10 lines · On Fri, 15 Mar 2013 00:36:35 +0900 (JST) HATAYAMA Daisuke…

If buddy page has order n, (2^n) pages are filtered at the same time. Then, next (2^n) pages are already filterd, so we can skip the (2^n) pages for free.

By this, on 32GB memory system, there's the following improvement:

- with mmap() on /proc/vmcore from 0.594421 seconds to 0.496517 seconds, and
- with normal read() from 1.533796 seconds to 0.750935 seconds.

Quoted 6 lines

Note that the two improvements are measured on the same /proc/vmcore.

Note also that amount of the improvement depends on amount of free pages, though it's obvious.

Good ! Applied.

Thanks
Atsushi Kumagai

Quoted 39 lines
---
 makedumpfile.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
makedumpfile.c +5 -2
index 7acbf72..9075f38 100644
@@ -4303,9 +4303,9 @@ __exclude_unnecessary_pages(unsigned long mem_map,
 		    && info->flag_cyclic
 		    && info->page_is_buddy
 		    && info->page_is_buddy(flags, _mapcount, private, _count)) {
-			int i;
+			int i, nr_pages = 1 << private;
 
-			for (i = 0; i < (1 << private); ++i) {
+			for (i = 0; i < nr_pages; ++i) {
 				/*
 				 * According to combination of
 				 * MAX_ORDER and size of cyclic
@@ -4318,6 +4318,9 @@ __exclude_unnecessary_pages(unsigned long mem_map,
 				clear_bit_on_2nd_bitmap_for_kernel(pfn + i);
 			}
 			pfn_free += i;
+
+			pfn += nr_pages - 1;
+			mem_map += (nr_pages - 1) * SIZE(page);
 		}
 		/*
 		 * Exclude the cache page without the private page.
Signature · 8 lines
1.8.1.4



_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec