Re: disk head scheduling

Gerard Roudier (groudier@club-internet.fr)
Fri, 26 Mar 1999 20:35:02 +0100 (MET)


On Thu, 25 Mar 1999, Linus Torvalds wrote:

> On Fri, 26 Mar 1999, Gadi Oxman wrote:
> > > ./drivers/block/ide.c: if (bdev->current_request != &bdev->plug)
> >
> > Every block driver has to have such a line. The current plug
> > mehanism is only good if it is checked for and honoured by the
> > low level driver, as the only thing which plug_device() does
> > is:
> >
> > dev->current_request = &dev->plug;

This one let the block driver care about some concept of 'plug' when it
does not need to do so.

> > Some drivers might check it as follows (like the SCSI driver):
> >
> > if (CURRENT != NULL && CURRENT->rq_status == RQ_INACTIVE) {
> > return;
> > }

This one looks like some 'queue empty' condition.

> >
> > which is the same thing,
>
> Indeed.
>

Absolutely NOT!!!!

One of them is just uselessly exporting the concept of 'plug' to block
drivers when it is not needed. This is kind of usual 'bad coupling' that
are either result of bad design or some start point of the messing process
that generally occurs with large software.

> However, I think it would make sense to make the "plug" not actually be a
> request itself, but just a flag. Making it a request was a nice way of
> minimally impacting the code, but as we will need to have a per-entity
> structure to keep track of the per-request-list lock status for
> re-entrancy protection, we might as well just make the plug more obvious,
> and make it a real flag.
>
> That's just an implementation detail, but it would make it more obvious
> what the test is.

I can only disagree 100%.
BTW, it's time for me to give up this thread.

exit(1) ;-)

> Linus

Gérard.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/