public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@suse.de>
To: "Rajat  Jain, Noida" <rajatj@noida.hcltech.com>
Cc: lk <linux_kernel@patni.com>,
	linux-scsi@vger.kernel.org, linux-newbie@vger.kernel.org
Subject: Re: When & how is the SCSI strategy routine called?
Date: Wed, 23 Mar 2005 11:39:28 +0100	[thread overview]
Message-ID: <20050323103926.GQ24105@suse.de> (raw)
In-Reply-To: <267988DEACEC5A4D86D5FCD780313FBB06043621@exch-03.noida.hcltech.com>

On Wed, Mar 23 2005, Rajat  Jain, Noida wrote:
>  
> 
> Thanks lk.
> 
> It cleared a lot of things.
> 
> How ever, what I am wondering is:
> 
> - Does each device queue have a corresponding thread that is woken up when
> it is time to call the request function? And the request function is called
> in the context of this thread?
> 
> - I explored and found that there is some "worker thread" kblockd that does
> this task of monitoring the queue and calling the request function. I want
> to know whether there is a separate thread for each queue (device) , or just
> one for all the block devices?

There is on kblockd thread per cpu for all queues. But note that the
request function is only invoked through that, if you get the unplug
threshold kicking in _or_ the io scheduler uses it to awake the queue.
The normal path for unplugs (this is what invokes the request handler)
is exceeding unplug_thresh or somebody calling blk_run_backing_dev()
either directly or from blk_run_address_space().

Normally drivers will re-invoke the request handler themselves, when
requests complete. So once the unplug has happened, if there is a
continual influx of io for that queue, the queue will not get replugged
and it is the drivers responsibility to reinvoke the request handler.

-- 
Jens Axboe

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

  parent reply	other threads:[~2005-03-23 10:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-23  8:49 When & how is the SCSI strategy routine called? Rajat  Jain, Noida
2005-03-23 10:01 ` lk
2005-03-23 10:39 ` Jens Axboe [this message]
  -- strict thread matches above, loose matches on Subject: below --
2005-03-22 17:05 Rajat  Jain, Noida
2005-03-22 16:30 Rajat  Jain, Noida

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=20050323103926.GQ24105@suse.de \
    --to=axboe@suse.de \
    --cc=linux-newbie@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linux_kernel@patni.com \
    --cc=rajatj@noida.hcltech.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox