[PATCHv2] calculate cyclic buffer size according to info->num_dumpfile
Atsushi Kumagai
kumagai-atsushi at mxc.nes.nec.co.jp
Wed Jul 10 22:45:05 EDT 2013
Hello Maxim,
On Wed, 10 Jul 2013 14:02:05 +0400
Maxim Uvarov <maxim.uvarov at oracle.com> wrote:
> Dump kernel work in limited memory space and makedumpfile buffers
> have to fit to empty memory due to not be killed with OOM-killer.
>
> v2: avoid divide by zero
>
> Signed-off-by: Maxim Uvarov <maxim.uvarov at oracle.com>
Thanks, I'll merge this v2 patch into v1.5.5.
Atsushi Kumagai
> ---
> makedumpfile.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/makedumpfile.c b/makedumpfile.c
> index b42565c..14bacb2 100644
> --- a/makedumpfile.c
> +++ b/makedumpfile.c
> @@ -2997,6 +2997,8 @@ out:
> * Truncate the buffer size to free memory size.
> */
> free_memory = get_free_memory_size();
> + if (info->num_dumpfile > 1)
> + free_memory /= 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 +8550,9 @@ 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 */
> + if (info->num_dumpfile > 1)
> + needed_size /= info->num_dumpfile;
>
> info->bufsize_cyclic = (free_size <= needed_size) ? free_size : needed_size;
>
> --
> 1.7.9.5
More information about the kexec
mailing list