Re: [REPORT] cfs-v4 vs sd-0.44

Ulrich Drepper
2007-04-22T16:16:36Z

On 4/22/07, William Lee Irwin III <wli@holomorphy.com> wrote:
> On Sun, Apr 22, 2007 at 12:17:31AM -0700, Ulrich Drepper wrote:
> > For futex(), the extension is needed for the FUTEX_WAIT operation. We
> > need a new operation FUTEX_WAIT_FOR or so which takes another (the
> > fourth) parameter which is the PID of the target.
> > For FUTEX_LOCK_PI we need no extension. The futex value is the PID of
> > the current owner. This is required for the whole interface to work
> > in the first place.
>
> We'll have to send things out and see what sticks here. There seems to
> be some pickiness above.

I know Rusty will shudder since it makes futexes yet more complicated
(although only if the user wants it) but if you introduce the concept
of "yield to" then this extension makes really sense and it is a quite
simple extension. Plus: I'm the most affected by the change since I
have to change code to use it and I'm fine with it.

Oh, last time I didn't explicitly mention the cases of
waitpid()/wait4()/waitid() explicitly naming a process to wait on. I
think it's clear that those cases also should be changed to use yield
to if possible. I don't have a good suggestion what to do when the
call waits for any child. Perhaps yielding to the last created one is
fine. If delays through reading on a pipe are recognized as well and
handle with yield to then the time slot will automatically be
forwarded to the first runnable process in the pipe sequence. I.e.,
running

grep foo /etc/passwd | cut -d: -f2 | crack

probably will create 'crack' last. Giving the remainder of the time
slot should result is recognizing it waits for 'cut' which in turn
waits for 'grep'. So in the end 'grep' gets the timeslot. Seems
quite complicated from the outside but I can imagine quite good
results from this.