[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1313646620.22532.16.camel@lappy>
Date: Thu, 18 Aug 2011 08:50:20 +0300
From: Sasha Levin <levinsasha928@...il.com>
To: KY Srinivasan <kys@...rosoft.com>
Cc: "gregkh@...e.de" <gregkh@...e.de>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"devel@...uxdriverproject.org" <devel@...uxdriverproject.org>,
"virtualization@...ts.osdl.org" <virtualization@...ts.osdl.org>,
Haiyang Zhang <haiyangz@...rosoft.com>
Subject: RE: [PATCH 2/8] Staging: hv: vmbus: Invoke vmbus_on_msg_dpc()
directly
On Wed, 2011-08-17 at 18:43 +0000, KY Srinivasan wrote:
>
> > -----Original Message-----
> > From: Sasha Levin [mailto:levinsasha928@...il.com]
> > Sent: Wednesday, August 17, 2011 8:48 AM
> > To: KY Srinivasan
> > Cc: gregkh@...e.de; linux-kernel@...r.kernel.org;
> > devel@...uxdriverproject.org; virtualization@...ts.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@...rosoft.com>
> > > Signed-off-by: Haiyang Zhang <haiyangz@...rosoft.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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists