From patchwork Thu May 2 01:35:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Cross X-Patchwork-Id: 2509751 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 0DB55DF230 for ; Thu, 2 May 2013 01:42:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757563Ab3EBBmV (ORCPT ); Wed, 1 May 2013 21:42:21 -0400 Received: from mail-ye0-f202.google.com ([209.85.213.202]:33970 "EHLO mail-ye0-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755380Ab3EBBmV (ORCPT ); Wed, 1 May 2013 21:42:21 -0400 Received: by mail-ye0-f202.google.com with SMTP id r13so14845yen.3 for ; Wed, 01 May 2013 18:42:20 -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=DjojAssxMwFc8iis7k32C4ggBmRsb6Zz+B+Szptvndk=; b=cdsEeSn/n8PEeTU/0qZ9ko/bqKdINxRqG8vHo0uJJoGopkfsgJcqRK6QjSbkGhj5s3 8vJXdEhxfc2KRx6gRobVUoOLRR8yKhTQl7hwWTugsg4ubdf7C6xK8aOjKNENwxeC8voZ f/GxNsuJT+bzUhj0nc89dgnxSVi1ntaZrK108hgflYtd72zjNWa0bajUteCXo5J7adQx sZN7ZTgX9NT3cdnuMq/i9BlZR0gSRE5rFdNXabu3mYuTafMROlFabc5D0W52l5Iw3Po/ O2CAyHB8c/S24nA0JKyn+earjvaDpEZB/W32Yqk0wraCqbl4HIxuw4LSHpLUQctVbFn/ nc2Q== X-Received: by 10.236.123.199 with SMTP id v47mr3207191yhh.21.1367458520665; Wed, 01 May 2013 18:35:20 -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 n78si403318yhh.1.2013.05.01.18.35.20 for (version=TLSv1.1 cipher=AES128-SHA bits=128/128); Wed, 01 May 2013 18:35:20 -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 7225A5A4224; Wed, 1 May 2013 18:35:20 -0700 (PDT) Received: by walnut.mtv.corp.google.com (Postfix, from userid 99897) id 32FA5160F17; Wed, 1 May 2013 18:35:20 -0700 (PDT) From: Colin Cross To: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org, "Rafael J. Wysocki" , arve@android.com, Tejun Heo , Oleg Nesterov , Colin Cross , Thomas Gleixner Subject: [PATCH v2 08/10] nanosleep: use freezable blocking call Date: Wed, 1 May 2013 18:35:06 -0700 Message-Id: <1367458508-9133-9-git-send-email-ccross@android.com> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1367458508-9133-1-git-send-email-ccross@android.com> References: <1367458508-9133-1-git-send-email-ccross@android.com> X-Gm-Message-State: ALoCoQlJiDLEoRp+0pEUhqSIhCJlZRH7XGdBKiqMGxaOiQEarBsPmgN1pxuV92WPYMhaUEifGOwQtoNKxTobGpFdklmVCbvkMmimLDEY54TmvlV84H/Sx8So4NwsCVXLj69owlMMq+Stj94R9Tci/1v1nlRkkPHpAzhGJySHxyUBz4TVwSX8DgSLb/v5N4tO3fYPi3Nq0ltE 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. Previous patches modified the freezer to avoid sending wakeups to threads that are blocked in freezable blocking calls. This call was selected to be converted to a freezable call because it doesn't hold any locks or release any resources when interrupted that might be needed by another freezing task or a kernel driver during suspend, and is a common site where idle userspace tasks are blocked. Signed-off-by: Colin Cross Acked-by: Thomas Gleixner --- 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;