All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@kernel.org>
Subject: Re: qemu:arm test failure due to commit 8053871d0f7f (smp: Fix smp_call_function_single_async() locking)
Date: Sat, 18 Apr 2015 17:36:32 -0700	[thread overview]
Message-ID: <5532F890.5000800@roeck-us.net> (raw)
In-Reply-To: <CA+55aFz1934X3wu7FdGerwYMJ_BAkrFsajOQFtU3_ogsUX3_eQ@mail.gmail.com>

On 04/18/2015 05:04 PM, Linus Torvalds wrote:
> On Sat, Apr 18, 2015 at 7:40 PM, Guenter Roeck <linux@roeck-us.net> wrote:
>> On Sat, Apr 18, 2015 at 04:23:25PM -0700, Guenter Roeck wrote:
>>>
>>> my qemu test for arm:vexpress fails with the latest upstream kernel. It fails
>>> hard - I don't get any output from the console. Bisect points to commit
>>> 8053871d0f7f ("smp: Fix smp_call_function_single_async() locking").
>>> Reverting this commit fixes the problem.
>
> Hmm. It being qemu, can you look at where it seems to lock?
>
I'll try. It must be very early in the boot process, prior to console
initialization - if I load qemu without -nographic I only get "Guest
has not initialized the display (yet)".

>> Additional observation: The system boots if I add "-smp cpus=4" to the qemu
>> options. It does still hang, however, with "-smp cpus=2" and "-smp cpus=3".
>
> Funky.
>
> That patch still looks obviously correct to me after looking at it
> again, but I guess we need to revert it if somebody can't see what's
> wrong.
>
> It does make async (wait=0) smp_call_function_single() possibly be
> *really* asynchronous, ie the 'csd' ends up being released and can be
> re-used even before the call-single function has completed. That
> should be a good thing, but I wonder if that triggers some ARM bug.
>
> Instead of doing a full revert, what happens if you replace this part:
>
> +               /* Do we wait until *after* callback? */
> +               if (csd->flags & CSD_FLAG_SYNCHRONOUS) {
> +                       func(info);
> +                       csd_unlock(csd);
> +               } else {
> +                       csd_unlock(csd);
> +                       func(info);
> +               }
>
> with just
>
> +               func(info);
> +               csd_unlock(csd);
>
> ie keeping the csd locked until the function has actually completed? I
> guess for completeness, we should do the same thing for the cpu ==
> smp_processor_id() case (see the "We can unlock early" comment).
>
> Now, if that makes a difference, I think it implies a bug in the
> caller, so it's not the right fix, but it would be an interesting
> thing to test.
>
I applied the above. No difference. Applying the same change for the cpu ==
smp_processor_id() case does not make a difference either.

Guenter


  reply	other threads:[~2015-04-19  0:37 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-18 23:23 qemu:arm test failure due to commit 8053871d0f7f (smp: Fix smp_call_function_single_async() locking) Guenter Roeck
2015-04-18 23:40 ` Guenter Roeck
2015-04-19  0:04   ` Linus Torvalds
2015-04-19  0:36     ` Guenter Roeck [this message]
2015-04-19  1:56     ` Guenter Roeck
2015-04-19  3:39       ` Rabin Vincent
2015-04-19  4:03         ` Guenter Roeck
     [not found]         ` <CA+55aFw4FSja+VBuCYJ7wLXKVRQZ7w6vOUaUJ4B=FXyBmNkrUg@mail.gmail.com>
2015-04-19  8:56           ` Linus Torvalds
2015-04-19  9:31             ` Ingo Molnar
2015-04-19 14:08               ` Guenter Roeck
2015-04-19 18:01                 ` Ingo Molnar
2015-04-19 20:34                   ` Linus Torvalds
2015-04-20  5:39                     ` Ingo Molnar
2015-04-20 12:17                       ` Paul E. McKenney
2015-04-20 15:53                       ` Linus Torvalds
2015-04-20 15:41                   ` Rabin Vincent
2015-04-20 10:46                 ` Geert Uytterhoeven
2015-04-20 10:46                   ` Geert Uytterhoeven

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=5532F890.5000800@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=torvalds@linux-foundation.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.