2007-12-10 09:49:49

by Jidong Xiao

[permalink] [raw]
Subject: What does "ordering by draining" mean?

Hi,

I am reading the source code of block I/O layer, and now seeing there
saying "ordering by draining" or "ordering by tag" in
include/blkdev.h,and the comments in that file says: "Hardbarrier is
supported with one of the following methods", but what do these two
methods exactly mean?

Thanks

Regards
Jason


2007-12-10 10:41:19

by Jens Axboe

[permalink] [raw]
Subject: Re: What does "ordering by draining" mean?

On Mon, Dec 10 2007, jidong xiao wrote:
> Hi,
>
> I am reading the source code of block I/O layer, and now seeing there
> saying "ordering by draining" or "ordering by tag" in
> include/blkdev.h,and the comments in that file says: "Hardbarrier is
> supported with one of the following methods", but what do these two
> methods exactly mean?

ordering by draining means that you empty the pending queue of requests
and then flush the cache to prevent a later issue of a new request to
reach the platter before the older ones. order by tag means that the hw
has a way of being told not to reorder beyond the barrier, in which case
you don't have to drain the queue.

--
Jens Axboe

2007-12-27 13:24:12

by Jidong Xiao

[permalink] [raw]
Subject: Re: What does "ordering by draining" mean?

On Dec 10, 2007 6:37 PM, Jens Axboe <[email protected]> wrote:
>
> On Mon, Dec 10 2007, jidong xiao wrote:
> > Hi,
> >
> > I am reading the source code of block I/O layer, and now seeing there
> > saying "ordering by draining" or "ordering by tag" in
> > include/blkdev.h,and the comments in that file says: "Hardbarrier is
> > supported with one of the following methods", but what do these two
> > methods exactly mean?
>
> ordering by draining means that you empty the pending queue of requests
> and then flush the cache to prevent a later issue of a new request to
> reach the platter before the older ones. order by tag means that the hw
> has a way of being told not to reorder beyond the barrier, in which case
> you don't have to drain the queue.
>

Well, I saw these comments in sd_revalidate_disk(), does this mean
SCSI TCQ is not supported in Linux?

1545 /*
1546 * We now have all cache related info, determine how we deal
1547 * with ordered requests. Note that as the current SCSI
1548 * dispatch function can alter request order, we cannot use
1549 * QUEUE_ORDERED_TAG_* even when ordered tag is supported.
1550 */
1551 if (sdkp->WCE)
1552 ordered = sdkp->DPOFUA
1553 ? QUEUE_ORDERED_DRAIN_FUA :
QUEUE_ORDERED_DRAIN_FLUSH;
1554 else
1555 ordered = QUEUE_ORDERED_DRAIN;
1556
1557 blk_queue_ordered(sdkp->disk->queue, ordered, sd_prepare_flush);

Regards
Jason