[PATCH 6/6] [RFC] alarmtimer: Deboost on nanosleep

From: John Stultz
Date: Mon Sep 26 2011 - 15:15:35 EST


Example of deboosting tasks before blocking on a wakeup
source like alarmtimer based nanosleep.

With this final patch, the kernel will be able to suspend
when SCHED_STAYAWAKE flagged tasks are blocked on the alarmtimer.

CC: Rafael J. Wysocki <rjw@xxxxxxx>
CC: arve@xxxxxxxxxxx
CC: markgross@xxxxxxxxxxx
CC: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>
CC: amit.kucheria@xxxxxxxxxx
CC: farrowg@xxxxxxxxxx
CC: Dmitry Fink (Palm GBU) <Dmitry.Fink@xxxxxxxx>
CC: linux-pm@xxxxxxxxxxxxxxxxxxxxxxxxxx
CC: khilman@xxxxxx
CC: Magnus Damm <damm@xxxxxxxxxxxxx>
CC: mjg@xxxxxxxxxx
CC: peterz@xxxxxxxxxxxxx
Signed-off-by: John Stultz <john.stultz@xxxxxxxxxx>
---
kernel/time/alarmtimer.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/kernel/time/alarmtimer.c b/kernel/time/alarmtimer.c
index 00ee80f..c855d40 100644
--- a/kernel/time/alarmtimer.c
+++ b/kernel/time/alarmtimer.c
@@ -568,9 +568,10 @@ static int alarmtimer_do_nsleep(struct alarm *alarm, ktime_t absexp)
do {
set_current_state(TASK_INTERRUPTIBLE);
alarm_start(alarm, absexp, ktime_set(0, 0));
- if (likely(alarm->data))
+ if (likely(alarm->data)) {
+ sched_deboost_task_active_count(current);
schedule();
-
+ }
alarm_cancel(alarm);
} while (alarm->data && !signal_pending(current));

--
1.7.3.2.146.gca209

--
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/