The patch titled Subject: kexec: yield to scheduler when loading kimage segments has been added to the -mm tree. Its filename is kexec-yield-to-scheduler-when-loading-kimage-segments.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/kexec-yield-to-scheduler-when-loading-kimage-segments.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/kexec-yield-to-scheduler-when-loading-kimage-segments.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Jarrett Farnitano <jmf@xxxxxxxxxx> Subject: kexec: yield to scheduler when loading kimage segments 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 did run into a practical problem. Hardware watchdogs on embedded systems can have short timers on the order of seconds. If the system is locked up for a few seconds with only a single core available, the watchdog may not be pet in a timely fashion. If this happens, the hardware watchdog will fire and reset the system. This really only becomes a problem when you are working with a single core, a decently sized initrd, and have a constrained hardware watchdog. Link: http://lkml.kernel.org/r/1528738546-3328-1-git-send-email-jmf@xxxxxxxxxx Signed-off-by: Jarrett Farnitano <jmf@xxxxxxxxxx> Reviewed-by: "Eric W. Biederman" <ebiederm@xxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- kernel/kexec_core.c | 4 ++++ 1 file changed, 4 insertions(+) diff -puN kernel/kexec_core.c~kexec-yield-to-scheduler-when-loading-kimage-segments kernel/kexec_core.c --- a/kernel/kexec_core.c~kexec-yield-to-scheduler-when-loading-kimage-segments +++ a/kernel/kexec_core.c @@ -829,6 +829,8 @@ static int kimage_load_normal_segment(st else buf += mchunk; mbytes -= mchunk; + + cond_resched(); } out: return result; @@ -893,6 +895,8 @@ static int kimage_load_crash_segment(str else buf += mchunk; mbytes -= mchunk; + + cond_resched(); } out: return result; _ Patches currently in -mm which might be from jmf@xxxxxxxxxx are kexec-yield-to-scheduler-when-loading-kimage-segments.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html