Re: [patch] aio: add per task aio wait event condition

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Zach Brown
Date: Tuesday, January 2, 2007 - 5:49 pm

On Dec 29, 2006, at 6:31 PM, Chen, Kenneth W wrote:


Yeah, it's a real deficiency.  Thanks for taking a stab at it.


But only one of the waiting tasks is tested, the one at the head of  
the list.  It looks like this change could starve a io_getevents()  
with a low min_nr in the presence of another io_getevents() with a  
larger min_nr.


Nice.  What min_nr was used in this test?


It appears that this is never assigned a negative?  Can we make it  
that explicit in the type so that we reviewers don't have to worry  
about wrapping and signed comparisons?



This just changed from using default_wake_function() to  
autoremove_wait_function().  Very sneaky!  wait_for_all_aios() should  
be adding the wait queue before going to sleep each time.  (better  
still to just use wait_event()).

Was this on purpose?  I'm all for it as a way to reduce wakeups from  
a stream of completions to a single waiter.


  int = unsigned - unsigned;
  if (int < 0)

My head already hurts.  Can we clean this up so one doesn't have to  
live and breath type conversion rules to tell if this code is correct?


First is the fear of starvation as mentioned previously.

issue 2 ops
first io_getevents sleeps with a min_nr of 2
second io_getevents sleeps with min_nr of 3
2 ops complete but only test the second sleeper's min_nr of 3
first sleeper twiddles thumbs

This makes me think this elegant task_list approach is doomed.  I  
think this is what stopped Ben and I from being interested in this  
last time we talked about it :).

Also, is that container_of() and dereference safe in the presence of  
racing wake-ups?  It looks like we could get deref a freed wait and  
get a bogus nr_wait and decide not to wake.

Andrew, I fear we should remove this from -mm until it's fixed up.

- z
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [patch] aio: add per task aio wait event condition, Zach Brown, (Tue Jan 2, 5:49 pm)
RE: [patch] aio: add per task aio wait event condition, Chen, Kenneth W, (Tue Jan 2, 6:16 pm)
RE: [patch] aio: add per task aio wait event condition, Chen, Kenneth W, (Tue Jan 2, 6:50 pm)
RE: [patch] aio: add per task aio wait event condition, Chen, Kenneth W, (Tue Jan 2, 7:32 pm)
RE: [patch] aio: add per task aio wait event condition, Chen, Kenneth W, (Tue Jan 2, 11:36 pm)