[PATCH] makedumpfile: show needed memory

Atsushi Kumagai kumagai-atsushi at mxc.nes.nec.co.jp
Thu Sep 12 23:00:08 EDT 2013


Hello Cliff,

(2013/08/29 7:08), Cliff Wickman wrote:
> From: Cliff Wickman <cpw at sgi.com>
> 
> If there is not enough memory available to run in cyclic mode display
> how much more would be needed to do so.
> 
> Diffed against makedumpfile-1.5.4
> Signed-off-by: Cliff Wickman <cpw at sgi.com>

This patch depends on your "use non-cyclic when possible"
and it was rejected, I'll reject this patch too.


Thanks
Atsushi Kumagai

> ---
>   makedumpfile.c |    8 ++++++--
>   1 file changed, 6 insertions(+), 2 deletions(-)
> 
> Index: makedumpfile-1.5.4/makedumpfile.c
> ===================================================================
> --- makedumpfile-1.5.4.orig/makedumpfile.c
> +++ makedumpfile-1.5.4/makedumpfile.c
> @@ -7778,11 +7778,15 @@ plenty_of_memory(void)
>   {
>   	unsigned long free_size;
>   	unsigned long needed_size;
> +	long slack = 10; /* 10M extra */
> +	long meg = 1024*1024;
>   
>   	free_size = get_free_memory_size();
> -	needed_size = (info->max_mapnr * 2) / BITPERBYTE;
> -	if (free_size > (needed_size + (10*1024*1024)))
> +	needed_size = ((info->max_mapnr * 2) / BITPERBYTE) + (slack * meg);
> +	if (free_size > needed_size)
>   		return 1;
> +	PROGRESS_MSG("Need %ldM more memory to use noncyclic mode.\n",
> +		(needed_size - free_size)/meg);
>   	return 0;
>   }



More information about the kexec mailing list