virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <levinsasha928@gmail.com>
To: KY Srinivasan <kys@microsoft.com>
Cc: "gregkh@suse.de" <gregkh@suse.de>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"devel@linuxdriverproject.org" <devel@linuxdriverproject.org>,
	"virtualization@lists.osdl.org" <virtualization@lists.osdl.org>,
	Haiyang Zhang <haiyangz@microsoft.com>
Subject: RE: [PATCH 2/8] Staging: hv: vmbus: Invoke vmbus_on_msg_dpc() directly
Date: Thu, 18 Aug 2011 08:50:20 +0300	[thread overview]
Message-ID: <1313646620.22532.16.camel@lappy> (raw)
In-Reply-To: <6E21E5352C11B742B20C142EB499E04808194C66@TK5EX14MBXC126.redmond.corp.microsoft.com>

On Wed, 2011-08-17 at 18:43 +0000, KY Srinivasan wrote:
> 
> > -----Original Message-----
> > From: Sasha Levin [mailto:levinsasha928@gmail.com]
> > Sent: Wednesday, August 17, 2011 8:48 AM
> > To: KY Srinivasan
> > Cc: gregkh@suse.de; linux-kernel@vger.kernel.org;
> > devel@linuxdriverproject.org; virtualization@lists.osdl.org; Haiyang Zhang
> > Subject: Re: [PATCH 2/8] Staging: hv: vmbus: Invoke vmbus_on_msg_dpc()
> > directly
> > 
> > On Mon, 2011-08-15 at 15:12 -0700, K. Y. Srinivasan wrote:
> > > The message processing function needs to execute on the same CPU where
> > > the interrupt was taken. tasklets cannot gurantee this; so, invoke the
> > > function directly.
> > >
> > > Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
> > > Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
> > > ---
> > 
> > tasklets are guaranteed to run on the same CPU as the function that
> > scheduled them.
> > 
> > Unless I'm missing something?
> 
> I too was under this impression until I stumbled upon this comment in
> include/Linux/interrupt.h where I see that there is no guarantee that
> tasklet would run on the same CPU that it was scheduled on
> (look at the first listed property):
> 
> /* Tasklets --- multithreaded analogue of BHs.
> 
>    Main feature differing them of generic softirqs: tasklet
>    is running only on one CPU simultaneously.
> 
>    Main feature differing them of BHs: different tasklets
>    may be run simultaneously on different CPUs.
> 
>    Properties:
>    * If tasklet_schedule() is called, then tasklet is guaranteed
>      to be executed on some cpu at least once after this.
> .
> .
> */
> 
> Given this comment here, I felt that safest thing to do would be to just
> not use the tasklet in this scenario.

Hm..

Looking at __tasklet_schedule() it should be guaranteed to run on the
same CPU, but as you said - the comment above is actually saying the
opposite.

The relevant documentation in the 'Linux Device Drivers' book also
states that it is guaranteed, so maybe we can get a confirmation from
Greg that this is still true and update the comment instead?

Not using bottom halves and just calling the dpc handler would mean that
you block interrupts for much longer than you need to.

-- 

Sasha.

  reply	other threads:[~2011-08-18  5:50 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-15 22:10 [PATCH 0/8] Staging: hv: vmbus: Driver cleanup K. Y. Srinivasan
2011-08-15 22:12 ` [PATCH 1/8] Staging: hv: vmbus: Get rid of vmbus_on_isr() by inlining the code K. Y. Srinivasan
2011-08-15 22:12   ` [PATCH 2/8] Staging: hv: vmbus: Invoke vmbus_on_msg_dpc() directly K. Y. Srinivasan
2011-08-17 12:47     ` Sasha Levin
2011-08-17 18:43       ` KY Srinivasan
2011-08-18  5:50         ` Sasha Levin [this message]
2011-08-15 22:12   ` [PATCH 3/8] Staging: hv: vmbus: Check for events before messages K. Y. Srinivasan
2011-08-15 22:12   ` [PATCH 4/8] Staging: hv: vmbus: Do not enable auto eoi K. Y. Srinivasan
2011-08-15 22:12   ` [PATCH 5/8] Staging: hv: vmbus: Fixup indentation in vmbus_acpi_add() K. Y. Srinivasan
2011-08-15 22:12   ` [PATCH 6/8] Staging: hv: vmbus: Get rid of some dated/redundant comments K. Y. Srinivasan
2011-08-15 22:12   ` [PATCH 7/8] Staging: hv: vmbus: Fix a bug in error handling in vmbus_bus_init() K. Y. Srinivasan
2011-08-17 13:26     ` Sasha Levin
2011-08-17 19:10       ` KY Srinivasan
2011-08-15 22:12   ` [PATCH 8/8] Staging: hv: vmbus: Get rid of an unnecessary check in vmbus_connect() K. Y. Srinivasan
2011-08-23 23:18 ` [PATCH 0/8] Staging: hv: vmbus: Driver cleanup Greg KH

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=1313646620.22532.16.camel@lappy \
    --to=levinsasha928@gmail.com \
    --cc=devel@linuxdriverproject.org \
    --cc=gregkh@suse.de \
    --cc=haiyangz@microsoft.com \
    --cc=kys@microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=virtualization@lists.osdl.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 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).