Re: disk head scheduling

Linus Torvalds (torvalds@transmeta.com)
Thu, 25 Mar 1999 16:17:08 -0800 (PST)


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;
>
> Some drivers might check it as follows (like the SCSI driver):
>
> if (CURRENT != NULL && CURRENT->rq_status == RQ_INACTIVE) {
> return;
> }
>
> which is the same thing,

Indeed.

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.

Linus

-
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/