All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dexuan Cui <decui@microsoft.com>
To: KY Srinivasan <kys@microsoft.com>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"devel@linuxdriverproject.org" <devel@linuxdriverproject.org>,
	"olaf@aepfle.de" <olaf@aepfle.de>,
	"apw@canonical.com" <apw@canonical.com>,
	"vkuznets@redhat.com" <vkuznets@redhat.com>,
	"jasowang@redhat.com" <jasowang@redhat.com>
Subject: RE: [PATCH V2 02/10] Drivers: hv: utils: run polling callback always in interrupt context
Date: Fri, 11 Dec 2015 07:33:11 +0000	[thread overview]
Message-ID: <02dd0f8d7f8e4cacb9e54a067fd483e4@HKXPR3004MB0088.064d.mgd.msft.net> (raw)
In-Reply-To: <BY2PR0301MB16541AAA6481D02387FEF713A0E90@BY2PR0301MB1654.namprd03.prod.outlook.com>

[-- Attachment #1: Type: text/plain, Size: 1553 bytes --]

> -----Original Message-----
> From: KY Srinivasan
> Sent: Friday, December 11, 2015 7:23
> > It looks the patch has not been Greg's tree yet.
> >
> > I have 2 questions about the patch:
> >
> > 1. hv_poll_channel() is invoked in fcopy_handle_handshake(), but not in
> > vss_handle_handshake() and kvp_handle_handshake().
> > Why -- I guess we missed the vss/kvp cases somehow?
> I will fix this.

Thanks, KY!
BTW, I fixed another small issue by https://lkml.org/lkml/2015/12/10/50
(The mail is attached for your convenience)

> > 2.  With the patch, hv_fcopy_onchannelcallback() can be invoked in the
> > tasklet (i.e., vmbus_on_event(). NB: local irq is enabled), and in the
> > hard irq handler(the IPI handler, e.g.,
> > fcopy_poll_wrapper() -> fcopy_poll_wrapper()).
> >
> > Can the former be interrupted by the latter?
> > e.g., when the callback is running in the tasklet on vCPU0,
> > fcopy_timeout_func() or fcopy_on_msg() could send the IPI to
> > vCPU0 from another vCPU.
> 
> Keep in mind that when the poll function is run, the state will not be
> HVUTIL_READY. The state will be set to HVUTIL_READY in the IPI
> handler. So, it is ok if the tasklet is interrupted by the IPI handler.
> 
> K. Y

Got it.

BTW, in fcopy_handle_handshake(), IMO the line
fcopy_transaction.state = HVUTIL_READY;
just before 
hv_poll_channel(fcopy_transaction.recv_channel, fcopy_poll_wrapper);
should be removed? Because in fcopy_poll_wrapper() we always have
the same line. 

Ditto for kvp/vss.

Thanks,
-- Dexuan

[-- Attachment #2: Type: message/rfc822, Size: 7138 bytes --]

From: Dexuan Cui <decui@microsoft.com>
To: "gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, "driverdev-devel@linuxdriverproject.org" <driverdev-devel@linuxdriverproject.org>, "olaf@aepfle.de" <olaf@aepfle.de>, "apw@canonical.com" <apw@canonical.com>, "jasowang@redhat.com" <jasowang@redhat.com>, KY Srinivasan <kys@microsoft.com>, "vkuznets@redhat.com" <vkuznets@redhat.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Subject: [PATCH] tools: hv: vss: fix the write()'s argument: error -> vss_msg
Date: Thu, 10 Dec 2015 09:00:57 +0000
Message-ID: <1449738057-4596-1-git-send-email-decui@microsoft.com>

I found this by chance. I don't have a specific bug caused by this.

Cc: Vitaly Kuznetsov <vkuznets@redhat.com>
Cc: "K. Y. Srinivasan" <kys@microsoft.com>
Signed-off-by: Dexuan Cui <decui@microsoft.com>
Cc: stable@vger.kernel.org
---
 tools/hv/hv_vss_daemon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/hv/hv_vss_daemon.c b/tools/hv/hv_vss_daemon.c
index 96234b6..5d51d6f 100644
--- a/tools/hv/hv_vss_daemon.c
+++ b/tools/hv/hv_vss_daemon.c
@@ -254,7 +254,7 @@ int main(int argc, char *argv[])
                        syslog(LOG_ERR, "Illegal op:%d\n", op);
                }
                vss_msg->error = error;
-               len = write(vss_fd, &error, sizeof(struct hv_vss_msg));
+               len = write(vss_fd, vss_msg, sizeof(struct hv_vss_msg));
                if (len != sizeof(struct hv_vss_msg)) {
                        syslog(LOG_ERR, "write failed; error: %d %s", errno,
                               strerror(errno));
--
1.9.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2fdriverdev.linuxdriverproject.org%2fmailman%2flistinfo%2fdriverdev-devel&data=01%7c01%7cdecui%40064d.mgd.microsoft.com%7c6038ce2d24784746fa0408d30134f8d9%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=6Hs1UNlA11wBtnU5XvHhpCgkUlIhWVMKxPHVj9UAZq8%3d

  reply	other threads:[~2015-12-11  7:33 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-30  1:12 [PATCH V2 00/10] Drivers: hv: Miscellaneous fixes K. Y. Srinivasan
2015-10-30  1:12 ` [PATCH V2 01/10] Drivers: hv: util: Increase the timeout for util services K. Y. Srinivasan
2015-10-30  1:12   ` [PATCH V2 02/10] Drivers: hv: utils: run polling callback always in interrupt context K. Y. Srinivasan
2015-12-10 10:18     ` Dexuan Cui
2015-12-10 23:23       ` KY Srinivasan
2015-12-11  7:33         ` Dexuan Cui [this message]
2015-12-12  0:49           ` KY Srinivasan
2015-10-30  1:12   ` [PATCH V2 03/10] tools: hv: report ENOSPC errors in hv_fcopy_daemon K. Y. Srinivasan
2015-10-30  1:12   ` [PATCH V2 04/10] tools: hv: remove repeated HV_FCOPY string K. Y. Srinivasan
2015-10-30  1:12   ` [PATCH V2 05/10] Drivers: hv: util: catch allocation errors K. Y. Srinivasan
2015-10-30  1:12   ` [PATCH V2 06/10] Drivers: hv: utils: use memdup_user in hvt_op_write K. Y. Srinivasan
2015-10-30  1:12   ` [PATCH V2 07/10] drivers/hv: cleanup synic msrs if vmbus connect failed K. Y. Srinivasan
2015-10-30  1:12   ` [PATCH V2 08/10] drivers:hv: Export a function that maps Linux CPU num onto Hyper-V proc num K. Y. Srinivasan
2015-10-30  1:12   ` [PATCH V2 09/10] drivers:hv: Export the API to invoke a hypercall on Hyper-V K. Y. Srinivasan
2015-10-30  1:12   ` [PATCH V2 10/10] drivers:hv: Define the channel type for Hyper-V PCI Express pass-through 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=02dd0f8d7f8e4cacb9e54a067fd483e4@HKXPR3004MB0088.064d.mgd.msft.net \
    --to=decui@microsoft.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 \
    --cc=vkuznets@redhat.com \
    /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.