Skip to contentSkip to conversation

device plugging

DISCUSSION gopi krishna 2 participants 3 messages Jul 7, 2001 – Jul 12, 2001

lore
Share & tools
lore
#0 lore raw

Why do we need a dummy req for plugging.
As i understood only thing plugging does is to, on arrival of new req if the dev queue is empty, puts a dummy req on the queue, and schedules the unplug routine on tq_disk, which on being scheduled calls the strategy routine.
So we can as well put the new req on the queue without dummy req.

If i'm incorrect please explain what's exact process and the reason

Please cc the response to [email protected] as i'm not subscribed.

thanks
----------------------------------------
http://mail.indiainfo.com
First you had 10MB of free mail space.
Now you can send mails in your own language !!!

#1 lore raw
Quoted 5 lines · gopi krishna

Why do we need a dummy req for plugging.
As i understood only thing plugging does is to, on arrival of new req if the dev queue is empty, puts a dummy req on the queue, and schedules the unplug routine on tq_disk, which on being scheduled calls the strategy routine.

You are reading 2.2 sources, maybe try the 2.4 sources as they are easier to follow in this regard IMHO.

What happens is that we assign dev->current_request &dev->plug, so that the front request is recognizable as the 'plug' and not a valid request. You seem to completely misunderstand plugging -- if we just put the new request on the queue and scheduled tq_disk, then there would be no plugging going on at all. What we do instead is add this specific 'plug request' and queue lots of stuff behind that. Not until someone needs the data on the queue is the 'plug request' removed and the request_fn run. This happens for instance if _someone else_ calls tq_disk, typically __wait_on_buffer.

Quoted 1 line

So we can as well put the new req on the queue without dummy req.

Wrong

Quoted 1 line

If i'm incorrect please explain what's exact process and the reason

See?

Signature · 1 line
Jens Axboe
#2 lore raw

Hello,
Can some one provide online pointers for the description and features of linux 2.4 kernel.
The rubini 2nd edn is not avlbl in india and most of the books still concentrate on 2.2.
Plz cc the responses to [email protected] as i am no subscribed to the group
----------------------------------------
http://mail.indiainfo.com
First you had 10MB of free mail space.
Now you can send mails in your own language !!!