From: Xie XiuQi <xiexiuqi@huawei.com>
To: Abbas Raza <abbas_raza@mentor.com>
Cc: <linux-kernel@vger.kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>
Subject: Re: [PATCH] sched: don't wait in kthread_bind for presmp initcalls
Date: Tue, 30 Jul 2013 11:27:37 +0800 [thread overview]
Message-ID: <51F732A9.9060106@huawei.com> (raw)
In-Reply-To: <1375118348-25253-1-git-send-email-abbas_raza@mentor.com>
On 2013/7/30 1:19, Abbas Raza wrote:
> From: Abbas Raza <Abbas_Raza@mentor.com>
>
> wait_task_inactive shouldn't be called in kthread_bind for presmp
> initcalls the same way it is done in !SMP case.
>
> more info here:
> http://permalink.gmane.org/gmane.linux.kernel.embedded/4046
>
> This patch improves boot time for pre-smp initcalls as given below
>
> initcall spawn_ksoftirqd+0x0/0x54 returned 0 after 0 usecs
> initcall init_workqueues+0x0/0x358 returned 0 after 0 usecs
> initcall cpu_stop_init+0x0/0xcc returned 0 after 0 usecs
>
> boot time without this patch:
>
> initcall spawn_ksoftirqd+0x0/0x54 returned 0 after 9765 usecs
> initcall init_workqueues+0x0/0x358 returned 0 after 9765 usecs
> initcall cpu_stop_init+0x0/0xcc returned 0 after 19531 usecs
>
> Signed-off-by: Abbas Raza <Abbas_Raza@mentor.com>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Ingo Molnar <mingo@redhat.com>
>
> ---
> kernel/kthread.c | 13 +++++++++----
> 1 file changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/kernel/kthread.c b/kernel/kthread.c
> index b579af5..80f19b5 100644
> --- a/kernel/kthread.c
> +++ b/kernel/kthread.c
> @@ -221,10 +221,15 @@ EXPORT_SYMBOL(kthread_create_on_node);
> */
> void kthread_bind(struct task_struct *p, unsigned int cpu)
> {
> - /* Must have done schedule() in kthread() before we set_task_cpu */
> - if (!wait_task_inactive(p, TASK_UNINTERRUPTIBLE)) {
> - WARN_ON(1);
> - return;
Hi Abbas, this patch isn't based the current mainline, and kthread_bind()
has been changed since v3.9.
> + if (!((num_online_cpus() == 1) && !cpu)) {
> + /*
> + * Must have done schedule() in kthread() before
> + * we set_task_cpu
> + */
> + if (!wait_task_inactive(p, TASK_UNINTERRUPTIBLE)) {
> + WARN_ON(1);
> + return;
> + }
> }
>
> /* It's safe because the task is inactive. */
>
prev parent reply other threads:[~2013-07-30 3:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-29 17:19 [PATCH] sched: don't wait in kthread_bind for presmp initcalls Abbas Raza
2013-07-30 3:27 ` Xie XiuQi [this message]
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=51F732A9.9060106@huawei.com \
--to=xiexiuqi@huawei.com \
--cc=abbas_raza@mentor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.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.