On Fri, Jul 30, 2010 at 09:07:32AM +0200, Christoph Hellwig wrote: > On Thu, Jul 29, 2010 at 11:17:21PM -0400, Vivek Goyal wrote: > > To me it looked like as if everything is there and it is just a matter > > of skipping elevator draining and request queue draining. > > The problem is that is just appears to be so. The code blocking only > the next barrier for tagged writes is there, but in that form it doesn't > work and probably never did. When I try to use it and debug it I always > get my post-flush request issued before the barrier request has > finished. Are you referring to following piece of code. if (q->ordered & QUEUE_ORDERED_BY_TAG) { /* Ordered by tag. Blocking the next barrier is enough. */ if (is_barrier && rq != &q->bar_rq) *rqp = NULL; If request queue is ordered by TAG, then isn't it ok to issue post-flush after barrier immediately (without barrier request to finish). We just need to block next barrier (a new barrier and not the post-flush request of current barrier). I thought for tagged queue, controller will take care of making sure commands finish in order. If queue is ordered by DRAIN, then I need to worry about first barrier to finish and then issue post-flush and I thought following should take care of it. } else { /* Ordered by draining. Wait for turn. */ WARN_ON(blk_ordered_req_seq(rq) < blk_ordered_cur_seq(q)); if (blk_ordered_req_seq(rq) > blk_ordered_cur_seq(q)) *rqp = NULL; } May be there is a bug somewhere. I will do some debugging. Thanks Vivek -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html