From patchwork Mon Apr 29 21:45:44 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Cross X-Patchwork-Id: 2502781 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id EAF6C3FD1A for ; Mon, 29 Apr 2013 21:54:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933185Ab3D2VyE (ORCPT ); Mon, 29 Apr 2013 17:54:04 -0400 Received: from mail-qc0-f202.google.com ([209.85.216.202]:53118 "EHLO mail-qc0-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933170Ab3D2VyB (ORCPT ); Mon, 29 Apr 2013 17:54:01 -0400 Received: by mail-qc0-f202.google.com with SMTP id k26so713942qcs.3 for ; Mon, 29 Apr 2013 14:54:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=ilUvRvGWpQS65R+wuxLV/f9TJBW9FdLzGQy4E2WLRnM=; b=JC7b6BpTzwF6V9dUPXA8eJirT/YcHKCRobQF508iHJN4jyr0ccA4l8MCm8QFtioeD9 d1qquMYET5t1QgXJdwAVn4ZIeIb3okgd41N32bom9ko53bFOaNYE8IjpphZJGitG43Y7 hWsRkAx3ENBtvF9F/i6d/I0UOzKVM+1dP8oWvLq6XJ2YSuOLc87vbuXV2eoM8SXSl+vR fsJ20y9fXXxoLtn6HLvLh/3XdrOs1alMiKyWT6EJVWaCGHX6Rj/Vgg5yac8XXdNMOsYA 2cH0xT0JNbi9lB/gfqtp3NYVunxrkw4rd5CGEQ0YIR4IvgePV6nwjkfaJl28akhIp0d1 u0fQ== X-Received: by 10.236.41.137 with SMTP id h9mr24601863yhb.43.1367271959540; Mon, 29 Apr 2013 14:45:59 -0700 (PDT) Received: from corp2gmr1-2.hot.corp.google.com (corp2gmr1-2.hot.corp.google.com [172.24.189.93]) by gmr-mx.google.com with ESMTPS id q46si491683yhh.4.2013.04.29.14.45.59 for (version=TLSv1.1 cipher=AES128-SHA bits=128/128); Mon, 29 Apr 2013 14:45:59 -0700 (PDT) Received: from walnut.mtv.corp.google.com (walnut.mtv.corp.google.com [172.18.105.48]) by corp2gmr1-2.hot.corp.google.com (Postfix) with ESMTP id 5EF685A4034; Mon, 29 Apr 2013 14:45:59 -0700 (PDT) Received: by walnut.mtv.corp.google.com (Postfix, from userid 99897) id 27EFB162258; Mon, 29 Apr 2013 14:45:54 -0700 (PDT) From: Colin Cross To: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org, "Rafael J. Wysocki" , arve@android.com, Colin Cross , Thomas Gleixner Subject: [PATCH 08/10] nanosleep: use freezable blocking call Date: Mon, 29 Apr 2013 14:45:44 -0700 Message-Id: <1367271946-7239-9-git-send-email-ccross@android.com> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1367271946-7239-1-git-send-email-ccross@android.com> References: <1367271946-7239-1-git-send-email-ccross@android.com> X-Gm-Message-State: ALoCoQlkqOVBpUOJNHfOsH9wVso+zz0+u7AusUtyttepX5Ftc06QanZh/jStHTVL0bfbS7ySmSaQfQH8I8BEX1VWdfvfcTz23Y1Mzisqps2bl8s85ZRj6YPImclm4jgTFLm9YtyGzeMVCRCN0G5U7dngU/5OCmPoJ8y3F0WbVHWloSjzaUD0/B8hhSOL9UB65RHvv9NJTXFw Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Avoid waking up every thread sleeping in a nanosleep call during suspend and resume by calling a freezable blocking call. Signed-off-by: Colin Cross --- kernel/hrtimer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c index 14be27f..e036276 100644 --- a/kernel/hrtimer.c +++ b/kernel/hrtimer.c @@ -47,6 +47,7 @@ #include #include #include +#include #include @@ -1525,7 +1526,7 @@ static int __sched do_nanosleep(struct hrtimer_sleeper *t, enum hrtimer_mode mod t->task = NULL; if (likely(t->task)) - schedule(); + freezable_schedule(); hrtimer_cancel(&t->timer); mode = HRTIMER_MODE_ABS;