From: Vitaly Kuznetsov <vkuznets@redhat.com>
To: Olaf Hering <olaf@aepfle.de>
Cc: "K. Y. Srinivasan" <kys@microsoft.com>,
Greg KH <gregkh@linuxfoundation.org>,
linux-kernel@vger.kernel.org, devel@linuxdriverproject.org,
apw@canonical.com, jasowang@redhat.com
Subject: Re: [PATCH 2/5] hv: add helpers to handle hv_util device state
Date: Mon, 21 Sep 2015 15:37:51 +0200 [thread overview]
Message-ID: <8737y728r4.fsf@vitty.brq.redhat.com> (raw)
In-Reply-To: <20150921121706.GA9172@aepfle.de> (Olaf Hering's message of "Mon, 21 Sep 2015 14:17:06 +0200")
Olaf Hering <olaf@aepfle.de> writes:
> On Mon, Sep 21, Vitaly Kuznetsov wrote:
>
>> I'd like to see a trace from the hang, it is not obvious to me how it
>> happened and what caused it. (or if you have such hang scenario in your
>> head, can you please reveal it?)
>
> There is no trace. I think fcopy_respond_to_host notifies the host,
> which in turn triggers an interrupt right away which is processed while
> fcopy_on_msg is executing somewhere between the return from
> fcopy_respond_to_host and the call into hv_fcopy_onchannelcallback.
>
I think it is fcopy_transaction.fcopy_context which gets out of sync.
When we're done processing some request we have the following code:
fcopy_transaction.state = HVUTIL_USERSPACE_RECV;
fcopy_respond_to_host(*val);
fcopy_transaction.state = HVUTIL_READY;
hv_poll_channel(fcopy_transaction.fcopy_context,
hv_fcopy_onchannelcallback);
If interrupt happens after we did fcopy_respond_to_host()
fcopy_transaction.state will still be HVUTIL_USERSPACE_RECV or even its
previous HVUTIL_USERSPACE_REQ but it's OK as we have the following in
hv_fcopy_onchannelcallback()
if (fcopy_transaction.state > HVUTIL_READY) {
/*
* We will defer processing this callback once
* the current transaction is complete.
*/
fcopy_transaction.fcopy_context = context;
return;
}
And we're supposed to process the work with hv_poll_channel(). The
problem is (I guess) that fcopy_transaction.fcopy_context gets out of
sync and it still has its previous value (possibly NULL). We call
hv_poll_channel() with NULL and everything gets stuck as we'll never
process the request.
AFAICS proper locking is requred here (and probably in all three
drivers), we need to protect not only .state but the whole transaction.
[...]
--
Vitaly
next prev parent reply other threads:[~2015-09-21 13:38 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-16 0:37 [PATCH 0/5] Drivers: hv: Miscellaneous fixes K. Y. Srinivasan
2015-09-16 0:37 ` [PATCH 1/5] Drivers: hv: vmbus: fix init_vp_index() for reloading hv_netvsc K. Y. Srinivasan
2015-09-16 0:37 ` [PATCH 2/5] hv: add helpers to handle hv_util device state K. Y. Srinivasan
2015-09-21 5:25 ` Greg KH
2015-09-21 10:26 ` Olaf Hering
2015-09-21 11:25 ` Vitaly Kuznetsov
2015-09-21 12:17 ` Olaf Hering
2015-09-21 13:37 ` Vitaly Kuznetsov [this message]
2015-09-21 16:45 ` KY Srinivasan
2015-09-21 16:34 ` KY Srinivasan
2015-09-21 16:43 ` Greg KH
2015-09-21 17:00 ` KY Srinivasan
2015-09-16 0:37 ` [PATCH 3/5] hv: fcopy: use wrappers to propagate state K. Y. Srinivasan
2015-09-16 0:37 ` [PATCH 4/5] hv: kvp: use wrappers to propaigate state K. Y. Srinivasan
2015-09-21 5:26 ` Greg KH
2015-09-21 10:18 ` Olaf Hering
2015-09-21 16:31 ` KY Srinivasan
2015-09-21 16:16 ` KY Srinivasan
2015-09-16 0:37 ` [PATCH 5/5] hv: vss: use wrappers to propagate state K. Y. Srinivasan
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=8737y728r4.fsf@vitty.brq.redhat.com \
--to=vkuznets@redhat.com \
--cc=apw@canonical.com \
--cc=devel@linuxdriverproject.org \
--cc=gregkh@linuxfoundation.org \
--cc=jasowang@redhat.com \
--cc=kys@microsoft.com \
--cc=linux-kernel@vger.kernel.org \
--cc=olaf@aepfle.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