public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: 'Christoph Hellwig' <hch@infradead.org>
To: "Infante, Jon" <Jon.Infante@Emulex.Com>
Cc: "Smart, James" <James.Smart@Emulex.Com>,
	"'linux-scsi@vger.kernel.org'" <linux-scsi@vger.kernel.org>
Subject: Re: DPC vs tasklet
Date: Thu, 20 May 2004 18:03:39 +0100	[thread overview]
Message-ID: <20040520180339.A10148@infradead.org> (raw)
In-Reply-To: <8D43EFD7CCBDB24980134BE078C227E704E37AEB@xcm.emulex.com>; from Jon.Infante@Emulex.Com on Thu, May 20, 2004 at 09:52:25AM -0700

On Thu, May 20, 2004 at 09:52:25AM -0700, Infante, Jon wrote:
> I was going to take your advice:
> "usage of tasklet itself is questionable, you probably want a kernel-thread"
> 
> and redo our driver bottom half discovery handler to use a DPC. I just
> wanted to get your opinion of why usage of a tasklet is questionable. Some
> of the LINUX documentation I've read states "tasklets are the preferred
> mechanism with which to implement your bottom half for a normal hardware
> device". I can see, as you stated, being in user context will help with
> things like allowing the use of GFP_KERNEL for memory allocations or safe
> calling of del_timer_sync(); but its not real clear to me what all the
> tradeoffs are and why some people think tasklets are the preferred
> mechanism. Can you shed some more light on this or direct me to some URLs
> with more info.

tasklets run at softirq time which means you don't want to do too much
work there, in addition to making locking and memory allocation more
difficult for you.  Given that you're doing lots of processing in there
a kernel thread seems like the better choice.  The kernelthread also
has the advtantage that you can bind it to the cpu the irq happens on
to avoid lots of cacheline bouncing.

In the end you probably want to benchmark the different variants against
each other.

  reply	other threads:[~2004-05-20 17:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-20 16:52 DPC vs tasklet Infante, Jon
2004-05-20 17:03 ` 'Christoph Hellwig' [this message]
2004-05-20 17:08 ` Jeff Garzik
2004-05-21  0:36   ` Bryan Henderson
2004-05-21  0:39     ` Matthew Wilcox
2004-05-21  7:46     ` Arjan van de Ven
2004-05-20 17:20 ` Arjan van de Ven
2004-05-20 17:57   ` Jeff Garzik
  -- strict thread matches above, loose matches on Subject: below --
2004-05-20 18:14 Infante, Jon

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=20040520180339.A10148@infradead.org \
    --to=hch@infradead.org \
    --cc=James.Smart@Emulex.Com \
    --cc=Jon.Infante@Emulex.Com \
    --cc=linux-scsi@vger.kernel.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