All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] makedumpfile: --split: assign fair I/O workloads for each process
@ 2014-03-18  3:09 HATAYAMA Daisuke
  2014-03-25  1:14 ` Atsushi Kumagai
  0 siblings, 1 reply; 5+ messages in thread
From: HATAYAMA Daisuke @ 2014-03-18  3:09 UTC (permalink / raw)
  To: kumagai-atsushi; +Cc: kexec

From: HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>

When --split option is specified, fair I/O workloads should be
assigned for each process to maximize amount of performance
optimization by parallel processing.

However, the current implementation of setup_splitting() in cyclic
mode doesn't care about filtering at all; I/O workloads for each
process could be biased easily.

This patch deals with the issue by implementing the fair I/O workload
assignment as setup_splitting_cyclic().

Note: If --split is specified in cyclic mode, we do filtering three
times: in get_dumpable_pages_cyclic(), in setup_splitting_cyclic() and
in writeout_dumpfile(). Filtering takes about 10 minutes on system
with huge memory according to the benchmark on the past, so it might
be necessary to optimize filtering or setup_filtering_cyclic().

Signed-off-by: HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>
---
 makedumpfile.c | 48 +++++++++++++++++++++++++++++++++++++++++-------
 1 file changed, 41 insertions(+), 7 deletions(-)

diff --git a/makedumpfile.c b/makedumpfile.c
index 0bd8b55..d310891 100644
--- a/makedumpfile.c
+++ b/makedumpfile.c
@@ -7885,26 +7885,60 @@ out:
 		return ret;
 }
 
+static int setup_splitting_cyclic(void)
+{
+	int i;
+	unsigned long long j, pfn_per_dumpfile;
+	unsigned long long start_pfn, end_pfn;
+
+	pfn_per_dumpfile = info->num_dumpable / info->num_dumpfile;
+	start_pfn = end_pfn = 0;
+
+	for (i = 0; i < info->num_dumpfile - 1; i++) {
+		struct cycle cycle;
+
+		start_pfn = end_pfn;
+		j = pfn_per_dumpfile;
+
+		for_each_cycle(start_pfn, info->max_mapnr, &cycle) {
+			if (!exclude_unnecessary_pages_cyclic(&cycle))
+				return FALSE;
+			while (j && end_pfn < cycle.end_pfn) {
+				if (is_dumpable_cyclic(info->partial_bitmap2,
+						       end_pfn, &cycle))
+					j--;
+				end_pfn++;
+			}
+			if (!j)
+				break;
+		}
+
+		SPLITTING_START_PFN(i) = start_pfn;
+		SPLITTING_END_PFN(i) = end_pfn;
+	}
+
+	SPLITTING_START_PFN(info->num_dumpfile - 1) = end_pfn;
+	SPLITTING_END_PFN(info->num_dumpfile - 1) = info->max_mapnr;
+
+	return TRUE;
+}
+
 int
 setup_splitting(void)
 {
 	int i;
 	unsigned long long j, pfn_per_dumpfile;
 	unsigned long long start_pfn, end_pfn;
-	unsigned long long num_dumpable = get_num_dumpable();
 	struct dump_bitmap bitmap2;
 
 	if (info->num_dumpfile <= 1)
 		return FALSE;
 
 	if (info->flag_cyclic) {
-		for (i = 0; i < info->num_dumpfile; i++) {
-			SPLITTING_START_PFN(i) = divideup(info->max_mapnr, info->num_dumpfile) * i;
-			SPLITTING_END_PFN(i)   = divideup(info->max_mapnr, info->num_dumpfile) * (i + 1);
-		}
-		if (SPLITTING_END_PFN(i-1) > info->max_mapnr)
-			SPLITTING_END_PFN(i-1) = info->max_mapnr;
+		return setup_splitting_cyclic();
         } else {
+		unsigned long long num_dumpable = get_num_dumpable();
+
 		initialize_2nd_bitmap(&bitmap2);
 
 		pfn_per_dumpfile = num_dumpable / info->num_dumpfile;
-- 
1.8.5.3



_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-03-27  5:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-18  3:09 [PATCH] makedumpfile: --split: assign fair I/O workloads for each process HATAYAMA Daisuke
2014-03-25  1:14 ` Atsushi Kumagai
2014-03-25  5:52   ` "Hatayama, Daisuke/畑山 大輔"
2014-03-26  5:38     ` HATAYAMA Daisuke
2014-03-27  5:18       ` Atsushi Kumagai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.