public inbox for kexec@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] makedumpfile: use non-cyclic when possible
@ 2013-08-28 22:08 Cliff Wickman
  2013-08-30  0:39 ` HATAYAMA Daisuke
  0 siblings, 1 reply; 3+ messages in thread
From: Cliff Wickman @ 2013-08-28 22:08 UTC (permalink / raw)
  To: d.hatayama, kumagai-atsushi; +Cc: kexec

From: Cliff Wickman <cpw@sgi.com>

If there is plenty of memory use non-cyclic mode.

Diffed against makedumpfile-1.5.4
Signed-off-by: Cliff Wickman <cpw@sgi.com>
---
 makedumpfile.c |   26 ++++++++++++++++++++++++++

Index: makedumpfile-1.5.4/makedumpfile.c
===================================================================
--- makedumpfile-1.5.4.orig/makedumpfile.c
+++ makedumpfile-1.5.4/makedumpfile.c
@@ -7638,6 +7638,23 @@ writeout_multiple_dumpfiles(void)
 	return ret;
 }
 
+/*
+ * Plenty of memory to do a non-cyclic dump.
+ * Default to non-cyclic in this case.
+ */
+static int
+plenty_of_memory(void)
+{
+	unsigned long free_size;
+	unsigned long needed_size;
+
+	free_size = get_free_memory_size();
+	needed_size = (info->max_mapnr * 2) / BITPERBYTE;
+	if (free_size > (needed_size + (10*1024*1024)))
+		return 1;
+	return 0;
+}
+
 int
 create_dumpfile(void)
 {
@@ -7655,6 +7672,15 @@ create_dumpfile(void)
 
 	print_vtop();
 
+	if (plenty_of_memory()) {
+		if (info->flag_cyclic == TRUE)
+			MSG("Plenty of memory; using non-cyclic mode.\n");
+		info->flag_cyclic = FALSE;
+	} else {
+		if (info->flag_cyclic == TRUE)
+			MSG("Restricted memory; staying in cyclic mode.\n");
+	}
+
 	num_retry = 0;
 retry:
 	if (info->flag_refiltering) {

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

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

* Re: [PATCH] makedumpfile: use non-cyclic when possible
  2013-08-28 22:08 [PATCH] makedumpfile: use non-cyclic when possible Cliff Wickman
@ 2013-08-30  0:39 ` HATAYAMA Daisuke
  2013-09-09  7:55   ` Atsushi Kumagai
  0 siblings, 1 reply; 3+ messages in thread
From: HATAYAMA Daisuke @ 2013-08-30  0:39 UTC (permalink / raw)
  To: Cliff Wickman; +Cc: kexec, kumagai-atsushi

(2013/08/29 7:08), Cliff Wickman wrote:
> From: Cliff Wickman <cpw@sgi.com>
> 
> If there is plenty of memory use non-cyclic mode.
> 

If there is enough memory to use, the number of cycle is 1.
Cyclic mode in 1-cycle is the same as non-cyclic mode in theory.
If slow, it's better to improve cyclic mode implementation.

To be honest, I think the current non-cyclic mode should be implemented as 1-cycle case. Then, makedumpfile can reduce amount of code at the same time.

-- 
Thanks.
HATAYAMA, Daisuke


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

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

* Re: [PATCH] makedumpfile: use non-cyclic when possible
  2013-08-30  0:39 ` HATAYAMA Daisuke
@ 2013-09-09  7:55   ` Atsushi Kumagai
  0 siblings, 0 replies; 3+ messages in thread
From: Atsushi Kumagai @ 2013-09-09  7:55 UTC (permalink / raw)
  To: d.hatayama, cpw; +Cc: kexec

(2013/08/30 9:40), HATAYAMA Daisuke wrote:
> (2013/08/29 7:08), Cliff Wickman wrote:
>> From: Cliff Wickman <cpw@sgi.com>
>>
>> If there is plenty of memory use non-cyclic mode.
>>
> 
> If there is enough memory to use, the number of cycle is 1.
> Cyclic mode in 1-cycle is the same as non-cyclic mode in theory.
> If slow, it's better to improve cyclic mode implementation.
> 
> To be honest, I think the current non-cyclic mode should be implemented as 1-cycle case. 
> Then, makedumpfile can reduce amount of code at the same time. 

Yes, I hope to get rid of non-cyclic mode.
When v1.5.0 was released, I retained non-cyclic mode as just
workaround since cyclic mode has big performance issue.
However, we have done some improvement for cyclic mode and
we will continue it.

So please don't make the code depend on non-cyclic mode and
make efforts to get rid of it.


Thanks
Atsushi Kumagai

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

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

end of thread, other threads:[~2013-09-09  7:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-28 22:08 [PATCH] makedumpfile: use non-cyclic when possible Cliff Wickman
2013-08-30  0:39 ` HATAYAMA Daisuke
2013-09-09  7:55   ` Atsushi Kumagai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox