[lkml]   [2003]   [Jun]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] io stalls (was: -rc7 Re: Linux 2.4.21-rc6)
On Tue, 2003-06-10 at 20:33, Andrea Arcangeli wrote:
> On Mon, Jun 09, 2003 at 05:39:23PM -0400, Chris Mason wrote:
> > + if (!waitqueue_active(&q->wait_for_requests[rw]))
> > + clear_queue_full(q, rw);
> you've an smp race above, the smp safe implementation is this:

clear_queue_full has a wmb() in my patch, and queue_full has a rmb(), I
thought that covered these cases? I'd rather remove those though, since
the spot you point out is the only place done outside the

> if (!waitqueue_active(&q->wait_for_requests[rw])) {
> clear_queue_full(q, rw);
> mb();
> if (unlikely(waitqueue_active(&q->wait_for_requests[rw])))
> wake_up(&q->wait_for_requests[rw]);
> }
I don't think we need the extra wake_up (this is in __get_request_wait,
right?), since it gets done by get_request_wait_wakeup()

> I'm also unsure what the "waited" logic does, it doesn't seem necessary.

Once a process waits once, they are allowed to ignore the q->full flag.
This way existing waiters can make progress even when q->full is set.
Without the waited check, q->full will never get cleared because the
last writer wouldn't proceed until the last writer was gone. I had to
make __get_request for the same reason.


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:36    [W:0.161 / U:0.348 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site