Re: [PATCH 1/2] do_wait reorganization

From: Roland McGrath
Date: Sun Mar 30 2008 - 23:27:48 EST


> I also wonder if you really need both "int *retval" and the return value.
> Isn't "retval" always going to be zero or a negative errno?

No.

> And the return value is going to be either true of false?

Yes.

> Why not just fold them into one single thing:
>
> - negative: all done, with error
> - zero: this didn't trigger, continue with the next one in caller
> - positive: this thread triggered, all done, return 0 in the caller.
>
> which is (I think) close to what we already do in eligible_child() (so
> this would not be a new calling convention for this particular code).

You listed the three possibilities for eligible_child().
For wait_consider_task(), there are four possibilities:

- all done, with error
- this thread was not eligible, look for another; return -ECHILD if none ready
- this thread was eligible but is not ready; return 0 or block if none ready
- all done, this thread is ready; return its pid

I'll post another version that I think you'll like a little better.


Thanks,
Roland
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/