On Tue 22-03-16 22:23:52, Peter Zijlstra wrote: [...] > Probably. However, with such semantics the schedule*() name is wrong > too, you cannot use these functions to build actual wait loops etc. > > So maybe: > > static inline long sleep_in_state(long timeout, long state) > { > __set_current_state(state); > return schedule_timeout(timeout); > } > > might be an even better name; but at that point we look very like the > msleep*() class of function, so maybe we should do: > > long sleep_in_state(long state, long timeout) > { > while (timeout && !signal_pending_state(state, current)) { > __set_current_state(state); > timeout = schedule_timeout(timeout); > } > return timeout; > } > > Hmm ? I am not sure how many callers do care about premature wake-ups (e.g I could find a use for it) but this indeed has a better and cleaner semantic. -- Michal Hocko SUSE Labs -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>