[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <KL1P15301MB0006F8A3E876E7BEB5973B94BF630@KL1P15301MB0006.APCP153.PROD.OUTLOOK.COM>
Date: Thu, 31 May 2018 21:01:34 +0000
From: Dexuan Cui <decui@...rosoft.com>
To: "Michael Kelley (EOSG)" <Michael.H.Kelley@...rosoft.com>,
'Lorenzo Pieralisi' <lorenzo.pieralisi@....com>,
'Bjorn Helgaas' <bhelgaas@...gle.com>,
"'linux-pci@...r.kernel.org'" <linux-pci@...r.kernel.org>,
KY Srinivasan <kys@...rosoft.com>,
Stephen Hemminger <sthemmin@...rosoft.com>,
"'olaf@...fle.de'" <olaf@...fle.de>,
"'apw@...onical.com'" <apw@...onical.com>,
"'jasowang@...hat.com'" <jasowang@...hat.com>
CC: "'linux-kernel@...r.kernel.org'" <linux-kernel@...r.kernel.org>,
"'driverdev-devel@...uxdriverproject.org'"
<driverdev-devel@...uxdriverproject.org>,
Haiyang Zhang <haiyangz@...rosoft.com>,
"'vkuznets@...hat.com'" <vkuznets@...hat.com>,
"'marcelo.cerri@...onical.com'" <marcelo.cerri@...onical.com>
Subject: RE: [PATCH] PCI: hv: Do not wait forever on a device that has
disappeared
> From: Michael Kelley (EOSG)
> Sent: Thursday, May 31, 2018 09:41
> >
> > IMO we can disable the per-channel tasklet to exclude the race:
> > This way, when we exit the loop, we're sure hv_pci_onchannelcallback() can
> > not run anymore. What do you think of this?
>
> I've stared at this and the tasklet code over a couple of days now. Adding the
> call to tasklet_disable() solves the immediate problem of preventing
> hv_pci_onchannelcallback() from calling complete() against a completion
> packet
> that has been popped off the stack. But in doing so, it simply pushes the core
> problem further down the road and leaves it unresolved.
>
> tasklet_disable() does not prevent the tasklet from being scheduled. So if
> there
> is a response from Hyper-V to the original message, the tasklet still gets
> scheduled. Because it is disabled, it will sit in the tasklet queue and be
> skipped
> over each time the queue is processed. Later, when the channel is
> eventually
> deleted in free_channel(), tasklet_kill() is called. Unfortunately, tasklet_kill()
> will get stuck in an infinite loop, waiting for the tasklet to run. There aren't
> any tasklet interfaces to dequeue an already scheduled tasklet.
I think you're correct.
> Please double-check my reasoning. To solve this problem, I think the VMbus
> driver code will need some additional synchronization between rescind
> notifications and a response, which may or may not have been sent, and
> which could be processed after the rescind. I haven't yet thought about
> what this synchronization might need to look like.
>
> Michael
Yes, it looks the VMBus driver needs to provide an API to cope with this.
I'll try to further investigate the issue.
-- Dexuan
Powered by blists - more mailing lists