[PATCH] calculate cyclic buffer size according to info->num_dumpfile

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dump kernel work in limited memory space and makedumpfile buffers
have to fit to empty memory due to not be killed with OOM-killer.
Signed-off-by: Maxim Uvarov <maxim.uvarov at oracle.com>
---
 makedumpfile.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/makedumpfile.c b/makedumpfile.c
index b42565c..52606ab 100644
--- a/makedumpfile.c
+++ b/makedumpfile.c
@@ -2996,7 +2996,7 @@ out:
 			/*
 			 * Truncate the buffer size to free memory size.
 			 */
-			free_memory = get_free_memory_size();
+			free_memory = (get_free_memory_size() / info->num_dumpfile);
 			if (info->bufsize_cyclic > free_memory) {
 				MSG("Specified buffer size is larger than free memory.\n");
 				MSG("The buffer size for the cyclic mode will ");
@@ -8548,6 +8548,8 @@ calculate_cyclic_buffer_size(void) {
 	 */
 	free_size = get_free_memory_size() * 0.4;
 	needed_size = (info->max_mapnr * 2) / BITPERBYTE;
+	/* if --split was specified cyclic buffer allocated per dump file */
+	needed_size /= info->num_dumpfile;
 
 	info->bufsize_cyclic = (free_size <= needed_size) ? free_size : needed_size;
 
-- 
1.7.9.5




[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux