mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Sodagudi Prasad <psodagud@codeaurora.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	isaacm@codeaurora.org, matt@codeblueprint.co.uk,
	mingo@kernel.org, linux-kernel@vger.kernel.org,
	gregkh@linuxfoundation.org, pkondeti@codeaurora.org,
	stable@vger.kernel.org
Subject: Re: [PATCH] stop_machine: Disable preemption after queueing stopper threads
Date: Mon, 30 Jul 2018 23:07:28 +0200	[thread overview]
Message-ID: <20180730210728.GQ2494@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <109d0e70606ccd34861a80525d6d11aa@codeaurora.org>

On Mon, Jul 30, 2018 at 10:12:43AM -0700, Sodagudi Prasad wrote:
> How about including below change as well?  Currently, there is no way to
> identify thread migrations completed or not.  When we observe this issue,
> the symptom was work queue lock up. It is better to have some timeout here
> and induce the bug_on.

You'd trigger the soft-lockup or hung-task detector I think. And if not,
we ought to look at making it trigger at least one of those.

> There is no way to identify the migration threads stuck or not.

Should be pretty obvious from the splat generated by the above, no?

> --- a/kernel/stop_machine.c
> +++ b/kernel/stop_machine.c
> @@ -290,6 +290,7 @@ int stop_two_cpus(unsigned int cpu1, unsigned int cpu2,
> cpu_stop_fn_t fn, void *
>         struct cpu_stop_done done;
>         struct cpu_stop_work work1, work2;
>         struct multi_stop_data msdata;
> +       int ret;
> 
>         msdata = (struct multi_stop_data){
>                 .fn = fn,
> @@ -312,7 +313,10 @@ int stop_two_cpus(unsigned int cpu1, unsigned int cpu2,
> cpu_stop_fn_t fn, void *
>         if (cpu_stop_queue_two_works(cpu1, &work1, cpu2, &work2))
>                 return -ENOENT;
> 
> -       wait_for_completion(&done.completion);
> +       ret = wait_for_completion_timeout(&done.completion,
> msecs_to_jiffies(1000));
> +       if (!ret)
> +               BUG_ON(1);
> +

That's a random timeout, which if you spuriously trigger it, will take
down your machine. That seems like a cure worse than the disease.

  parent reply	other threads:[~2018-07-30 21:07 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-17 19:35 Isaac J. Manjarres
2018-07-24  1:13 ` isaacm
2018-07-24  6:23   ` Sebastian Andrzej Siewior
2018-07-25  4:15     ` isaacm
2018-07-30 10:20     ` Thomas Gleixner
2018-07-30 11:21       ` Peter Zijlstra
2018-07-30 12:41         ` Thomas Gleixner
2018-07-30 17:12           ` Sodagudi Prasad
2018-07-30 17:16             ` Thomas Gleixner
2018-07-30 21:07             ` Peter Zijlstra [this message]
2018-08-01  8:07               ` Sodagudi Prasad
2018-08-06  8:37                 ` Pavan Kondeti
2018-08-02 12:06         ` [tip:sched/core] stop_machine: Reflow cpu_stop_queue_two_works() tip-bot for Peter Zijlstra
2018-08-02 13:27         ` tip-bot for Peter Zijlstra
2018-07-25 14:21 ` [tip:sched/core] stop_machine: Disable preemption after queueing stopper threads tip-bot for Isaac J. Manjarres

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=20180730210728.GQ2494@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=bigeasy@linutronix.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=isaacm@codeaurora.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matt@codeblueprint.co.uk \
    --cc=mingo@kernel.org \
    --cc=pkondeti@codeaurora.org \
    --cc=psodagud@codeaurora.org \
    --cc=stable@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /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

Powered by JetHome