[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <000f01c72ed9$9a73cdd0$ff0da8c0@amr.corp.intel.com>
Date: Tue, 2 Jan 2007 17:50:53 -0800
From: "Chen, Kenneth W" <kenneth.w.chen@...el.com>
To: "'Zach Brown'" <zach.brown@...cle.com>
Cc: "'Andrew Morton'" <akpm@...l.org>, <linux-aio@...ck.org>,
<linux-kernel@...r.kernel.org>,
"'Benjamin LaHaise'" <bcrl@...ck.org>, <suparna@...ibm.com>
Subject: RE: [patch] aio: add per task aio wait event condition
Zach Brown wrote on Tuesday, January 02, 2007 5:24 PM
> > That is not possible because when multiple tasks waiting for
> > events, they
> > enter the wait queue in FIFO order, prepare_to_wait_exclusive() does
> > __add_wait_queue_tail(). So first io_getevents() with min_nr of 2
> > will be woken up when 2 ops completes.
>
> So switch the order of the two sleepers in the example?
Not sure why that would be a problem though: whoever sleep first will
be woken up first.
> The point is that there's no way to guarantee that the head of the
> wait queue will be the lowest min_nr.
Before I challenge that semantics, I want to mention that in current
implementation, dribbling AIO events will be distributed in round robin
fashion to all pending tasks waiting in io_getevents. In the example you
gave earlier, task with min_nr of 2 will be woken up after 4 completed
events. I consider that as an undesirable behavior as well.
Going back to your counter argument, why do we need the lowest min_nr in
the head of the queue? These are tasks that shares one aio ctx and ioctx
is shareable only among threads. Any reason why round robin policy is
superior than FIFO? Also presumably, threads that shares ioctx should be
capable of handling events for the same ioctx.
>From wakeup order point of view, yes, tasks with lowest min_nr wakes up
first, but looking from io completion order, they are not. And these are
the source of excessive ctx switch.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists