RFC add poll_event*() interface
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest5 patches 3 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/5 | add poll_event*()include/ | +39 | 1 reply | |
| 2/5 | char/tpqic02: use poll_event*() interfacedrivers/ | +4 | 2 replies | |
| 3/5 | ppc/pmac_cpufreq: use poll_event*() interfacearch/ | +2 | 0 replies | |
| 4/5 | ppc/serial_sicc: use poll_event*() interfacearch/ | +8 | 0 replies | |
| 5/5 | ieee1394/amdtp: use poll_event*() interfacedrivers/ | +6 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [KJ] [RFC][PATCH 0/5] add poll_event*() interface
Hi,
The following patches, including the one below, attempt to create a new sleep interface.
In reviewing the remaining schedule_timeout() callers in the kernel, I noticed that a number of usages of this function obey this model:
/* sleep at most this long */
timeout = jiffies + some_time;
/* every interval of time, check some_event's state */
while (some_event) {
/* state to sleep in depends on the intent */
set_current_state(TASK_{UN,}INTERRUPTIBLE);
/* each iteration sleep for some_other_time */
schedule_timeout(some_other_time);
}Now, I thought to myself, this is very similar to wait_event() and co., but without wait-queues. And, thus, instead of a wait-queue being the trigger to check a condition, the some_other_time sleep going by is.
Thus, it seemed logical to add an interface to do exactly this in a nice compact way, but using msleep() and msleep_interruptible().
Patch 1/5: Adds the poll_event(), poll_event_timeout(), poll_event_interruptible() and poll_event_interruptible_timeout() interfaces.
Patch {2,3,4,5}/5: Demonstrates the utitlity of poll_event*() in various drivers.
I am more than happy to change the names of these macros, change the names of the variables, or whatever other suggestions you may have. I closely modelled the macros after wait_event*(), which should be apparently.
If this code has a decent response from KJML, I will go ahead and push it to LKML.
Thanks,
Nish
_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors