From: ebiederm@xmission.com (Eric W. Biederman)
To: Jarrett Farnitano <jmf@amazon.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
kexec@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] kexec: yield to scheduler when loading kimage segments
Date: Mon, 11 Jun 2018 19:45:35 -0500 [thread overview]
Message-ID: <877en4suhc.fsf@xmission.com> (raw)
In-Reply-To: <1528738546-3328-1-git-send-email-jmf@amazon.com> (Jarrett Farnitano's message of "Mon, 11 Jun 2018 10:35:46 -0700")
Jarrett Farnitano <jmf@amazon.com> writes:
> Without yielding while loading kimage segments, a large initrd
> will block all other work on the CPU performing the load until
> it is completed. For example loading an initrd of 200MB on a
> low power single core system will lock up the system for a few
> seconds.
>
> To increase system responsiveness to other tasks at that time,
> call cond_resched() in both the crash kernel and normal kernel
> segment loading loops.
>
> Signed-off-by: Jarrett Farnitano <jmf@amazon.com>
Reviewed-by: "Eric W. Biederman" <ebiederm@xmission.com>
> ---
> kernel/kexec_core.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c
> index 5616755..8ee07d6 100644
> --- a/kernel/kexec_core.c
> +++ b/kernel/kexec_core.c
> @@ -783,6 +783,8 @@ static int kimage_load_normal_segment(struct kimage *image,
> else
> buf += mchunk;
> mbytes -= mchunk;
> +
> + cond_resched();
> }
> out:
> return result;
> @@ -847,6 +849,8 @@ static int kimage_load_crash_segment(struct kimage *image,
> else
> buf += mchunk;
> mbytes -= mchunk;
> +
> + cond_resched();
> }
> out:
> return result;
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
WARNING: multiple messages have this Message-ID (diff)
From: ebiederm@xmission.com (Eric W. Biederman)
To: Jarrett Farnitano <jmf@amazon.com>
Cc: kexec@lists.infradead.org, linux-kernel@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] kexec: yield to scheduler when loading kimage segments
Date: Mon, 11 Jun 2018 19:45:35 -0500 [thread overview]
Message-ID: <877en4suhc.fsf@xmission.com> (raw)
In-Reply-To: <1528738546-3328-1-git-send-email-jmf@amazon.com> (Jarrett Farnitano's message of "Mon, 11 Jun 2018 10:35:46 -0700")
Jarrett Farnitano <jmf@amazon.com> writes:
> Without yielding while loading kimage segments, a large initrd
> will block all other work on the CPU performing the load until
> it is completed. For example loading an initrd of 200MB on a
> low power single core system will lock up the system for a few
> seconds.
>
> To increase system responsiveness to other tasks at that time,
> call cond_resched() in both the crash kernel and normal kernel
> segment loading loops.
>
> Signed-off-by: Jarrett Farnitano <jmf@amazon.com>
Reviewed-by: "Eric W. Biederman" <ebiederm@xmission.com>
> ---
> kernel/kexec_core.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c
> index 5616755..8ee07d6 100644
> --- a/kernel/kexec_core.c
> +++ b/kernel/kexec_core.c
> @@ -783,6 +783,8 @@ static int kimage_load_normal_segment(struct kimage *image,
> else
> buf += mchunk;
> mbytes -= mchunk;
> +
> + cond_resched();
> }
> out:
> return result;
> @@ -847,6 +849,8 @@ static int kimage_load_crash_segment(struct kimage *image,
> else
> buf += mchunk;
> mbytes -= mchunk;
> +
> + cond_resched();
> }
> out:
> return result;
next prev parent reply other threads:[~2018-06-12 0:45 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-11 17:35 [PATCH] kexec: yield to scheduler when loading kimage segments Jarrett Farnitano
2018-06-11 17:35 ` Jarrett Farnitano
2018-06-11 22:59 ` Eric W. Biederman
2018-06-11 22:59 ` Eric W. Biederman
2018-06-11 23:47 ` Farnitano, Jarrett
2018-06-11 23:47 ` Farnitano, Jarrett
2018-06-12 0:45 ` Eric W. Biederman
2018-06-12 0:45 ` Eric W. Biederman
2018-06-12 0:45 ` Eric W. Biederman [this message]
2018-06-12 0:45 ` Eric W. Biederman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=877en4suhc.fsf@xmission.com \
--to=ebiederm@xmission.com \
--cc=akpm@linux-foundation.org \
--cc=jmf@amazon.com \
--cc=kexec@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.