From: ebiederm@xmission.com (Eric W. Biederman)
To: Jarrett Farnitano <jmf@amazon.com>
Cc: 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 17:59:38 -0500 [thread overview]
Message-ID: <87po0xszdx.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.
I remember years ago something like this was proposed and there was a
reason we did not include it. I don't remember what that reason is
right now. But I am reluctant to ack this until I remember.
Is there a practical problem with unresponsiveness? You are talking
an embedded machine and rarely are there people in front of embedded
computers these days.
Eric
> Signed-off-by: Jarrett Farnitano <jmf@amazon.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-11 23:00 UTC|newest]
Thread overview: 5+ 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 22:59 ` Eric W. Biederman [this message]
2018-06-11 23:47 ` Farnitano, Jarrett
2018-06-12 0:45 ` Eric W. Biederman
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=87po0xszdx.fsf@xmission.com \
--to=ebiederm@xmission.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox