From patchwork Sat Sep 24 01:32:43 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 4308 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id E72A923F56 for ; Sat, 24 Sep 2011 01:33:18 +0000 (UTC) Received: from mail-fx0-f52.google.com (mail-fx0-f52.google.com [209.85.161.52]) by fiordland.canonical.com (Postfix) with ESMTP id D09A6A18411 for ; Sat, 24 Sep 2011 01:33:18 +0000 (UTC) Received: by fxe23 with SMTP id 23so6092605fxe.11 for ; Fri, 23 Sep 2011 18:33:18 -0700 (PDT) Received: by 10.223.55.136 with SMTP id u8mr3175790fag.46.1316827998607; Fri, 23 Sep 2011 18:33:18 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.152.18.198 with SMTP id y6cs9231lad; Fri, 23 Sep 2011 18:33:18 -0700 (PDT) Received: by 10.236.77.133 with SMTP id d5mr25537669yhe.75.1316827996699; Fri, 23 Sep 2011 18:33:16 -0700 (PDT) Received: from e7.ny.us.ibm.com (e7.ny.us.ibm.com. [32.97.182.137]) by mx.google.com with ESMTPS id b41si15071251yhn.7.2011.09.23.18.33.16 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 23 Sep 2011 18:33:16 -0700 (PDT) Received-SPF: pass (google.com: domain of jstultz@us.ibm.com designates 32.97.182.137 as permitted sender) client-ip=32.97.182.137; Authentication-Results: mx.google.com; spf=pass (google.com: domain of jstultz@us.ibm.com designates 32.97.182.137 as permitted sender) smtp.mail=jstultz@us.ibm.com Received: from d01relay07.pok.ibm.com (d01relay07.pok.ibm.com [9.56.227.147]) by e7.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id p8O0CNfP009318; Fri, 23 Sep 2011 20:12:23 -0400 Received: from d01av03.pok.ibm.com (d01av03.pok.ibm.com [9.56.224.217]) by d01relay07.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p8O1XFtZ3129454; Fri, 23 Sep 2011 21:33:15 -0400 Received: from d01av03.pok.ibm.com (loopback [127.0.0.1]) by d01av03.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p8O1XFpb018875; Fri, 23 Sep 2011 22:33:15 -0300 Received: from kernel.beaverton.ibm.com ([9.47.67.96]) by d01av03.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p8O1XEvB018869; Fri, 23 Sep 2011 22:33:15 -0300 Received: by kernel.beaverton.ibm.com (Postfix, from userid 1056) id F29A31E7515; Fri, 23 Sep 2011 18:33:13 -0700 (PDT) From: John Stultz To: markgross@thegnar.org Cc: John Stultz Subject: [PATCH 6/6] [RFC] alarmtimer: Deboost on nanosleep Date: Fri, 23 Sep 2011 18:32:43 -0700 Message-Id: <1316827963-13122-7-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.7.3.2.146.gca209 In-Reply-To: <1316827963-13122-1-git-send-email-john.stultz@linaro.org> References: <1316827963-13122-1-git-send-email-john.stultz@linaro.org> Example of deboosting tasks before blocking on a wakeup source like alarmtimer based nanosleep. Signed-off-by: John Stultz --- 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 523a123..f2fe16e 100644 --- a/kernel/time/alarmtimer.c +++ b/kernel/time/alarmtimer.c @@ -566,9 +566,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));