linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vitaly Kuznetsov <vkuznets@redhat.com>
To: Dexuan Cui <decui@microsoft.com>
Cc: "tglx\@linutronix.de" <tglx@linutronix.de>,
	"riel\@surriel.com" <riel@surriel.com>,
	"jpoimboe\@redhat.com" <jpoimboe@redhat.com>,
	"luto\@kernel.org" <luto@kernel.org>,
	Stephen Hemminger <sthemmin@microsoft.com>,
	Sasha Levin <Alexander.Levin@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	KY Srinivasan <kys@microsoft.com>,
	"linux-kernel\@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Michael Kelley <mikelley@microsoft.com>,
	"marcelo.cerri\@canonical.com" <marcelo.cerri@canonical.com>,
	"apw\@canonical.com" <apw@canonical.com>,
	"olaf\@aepfle.de" <olaf@aepfle.de>,
	"jasowang\@redhat.com" <jasowang@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>
Subject: Re: [PATCH] smp: Do not warn if smp_call_function_single() is doing a self call.
Date: Tue, 16 Apr 2019 13:20:19 +0200	[thread overview]
Message-ID: <87o9562o3w.fsf@vitty.brq.redhat.com> (raw)
In-Reply-To: <20190416093123.GR11158@hirez.programming.kicks-ass.net>

Peter Zijlstra <peterz@infradead.org> writes:

> On Mon, Apr 15, 2019 at 11:39:57PM +0000, Dexuan Cui wrote:
>> > From: Peter Zijlstra <peterz@infradead.org>
>> > Sent: Monday, April 15, 2019 5:21 AM
>> > To: Dexuan Cui <decui@microsoft.com>
>> > 
>> > On Fri, Apr 12, 2019 at 11:53:57PM +0000, Dexuan Cui wrote:
>> > > If smp_call_function_single() is calling the function for itself, it's safe
>> > > to run with irqs_disabled() == true.
>> > >
>> > > I hit the warning because I'm in the below path in the .suspend callback of
>> > > a "syscore_ops" to support hibernation for a VM running on Hyper-V:
>> > >
>> > >   hv_synic_cleanup() ->
>> > >     clockevents_unbind_device() ->
>> > >       clockevents_unbind() ->
>> > >         smp_call_function_single().
>> > >
>> > > When the .suspend callback runs, only CPU0 is online and irqs_disabled() is
>> > > true.
>> > 
>> > Pray tell, how well do you think mutex_lock() works with interrupts
>> > disabled?
>> 
>> Good point. I realized generally speaking this patch makes no sense, so let me
>> try the solution proposed by Vitaly, i.e. fix clockevents_unbind() instead.
>
> That's still not the problem. You're calling clockevents_unbind_device()
> with IRQs disabled, that's not correct. It doesn't matter what
> clockevents_unbind() does thereafter.
>

True. And before we start digging deeper into this, let's step back: why
do we need to do clockevents_unbind_device() on hybernation? Can we just
disable the device and re-enable it back on resume?

Actually, all usages of clockevents_unbind_device() in kernel are
limited to Hyper-V and with Michael's patches moving this out of VMBus
driver I think it can go away completely.

-- 
Vitaly

  reply	other threads:[~2019-04-16 11:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-12 23:53 [PATCH] smp: Do not warn if smp_call_function_single() is doing a self call Dexuan Cui
2019-04-14  6:58 ` Vitaly Kuznetsov
2019-04-15 12:21 ` Peter Zijlstra
2019-04-15 23:39   ` Dexuan Cui
2019-04-16  9:31     ` Peter Zijlstra
2019-04-16 11:20       ` Vitaly Kuznetsov [this message]
2019-04-16 20:13         ` Thomas Gleixner
2019-04-17 23:50           ` Dexuan Cui

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=87o9562o3w.fsf@vitty.brq.redhat.com \
    --to=vkuznets@redhat.com \
    --cc=Alexander.Levin@microsoft.com \
    --cc=apw@canonical.com \
    --cc=decui@microsoft.com \
    --cc=haiyangz@microsoft.com \
    --cc=jasowang@redhat.com \
    --cc=jpoimboe@redhat.com \
    --cc=kys@microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=marcelo.cerri@canonical.com \
    --cc=mikelley@microsoft.com \
    --cc=olaf@aepfle.de \
    --cc=peterz@infradead.org \
    --cc=riel@surriel.com \
    --cc=sthemmin@microsoft.com \
    --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;
as well as URLs for NNTP newsgroup(s).