From patchwork Mon May 6 23:50:17 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Cross X-Patchwork-Id: 2528981 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 D1A90DF230 for ; Mon, 6 May 2013 23:53:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932880Ab3EFXwb (ORCPT ); Mon, 6 May 2013 19:52:31 -0400 Received: from mail-vb0-f74.google.com ([209.85.212.74]:60864 "EHLO mail-vb0-f74.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932498Ab3EFXuc (ORCPT ); Mon, 6 May 2013 19:50:32 -0400 Received: by mail-vb0-f74.google.com with SMTP id q16so447331vbe.1 for ; Mon, 06 May 2013 16:50:31 -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=Q576qFIcv5TrQhCyLou0AlsqGg+wV5JDowUmIloBe6Q=; b=hCLSmEhdGAqDuFr/I/njxOqzvLYMsrNvjAfbtzb76mwAbZ94/e+aw0ywT1YgCvb2v6 CJszahg5WZ9AQ01KSzViAV4oUcoQCwEhPBgB2PChiGtxESNQdm8+kUEjt2JUtHMdXOkp 6PVGwIklxnakTuyN39ZyMt9wil8OnnprIw/daRVSdC+7eySEW8PQYNXkMjNdKsVupMDP 91+unx27Z1UzZ72kDHLn0QFCh9I2iwyA1PoXcQZStHESEYV6+iPC4haLYmiWWK66ryR1 xNTONZ2O+V4AfGqXHjyQgw4iUoL0RK+uHSjkkQ6mblGk8C2NDzP4wQbq0DYzl0/h9Wac g/OA== X-Received: by 10.236.113.203 with SMTP id a51mr4179808yhh.31.1367884231310; Mon, 06 May 2013 16:50:31 -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 n23si2636727yhi.7.2013.05.06.16.50.31 for (version=TLSv1.1 cipher=AES128-SHA bits=128/128); Mon, 06 May 2013 16:50:31 -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 21E275A4005; Mon, 6 May 2013 16:50:31 -0700 (PDT) Received: by walnut.mtv.corp.google.com (Postfix, from userid 99897) id D7BD31613FF; Mon, 6 May 2013 16:50:30 -0700 (PDT) From: Colin Cross To: linux-kernel@vger.kernel.org Cc: Pavel Machek , "Rafael J. Wysocki" , Peter Zijlstra , Ingo Molnar , Andrew Morton , Mandeep Singh Baines , Colin Cross , Oleg Nesterov , linux-nfs@vger.kernel.org, linux-pm@vger.kernel.org, netdev@vger.kernel.org, Linus Torvalds , Tejun Heo , Alexander Viro , linux-fsdevel@vger.kernel.org Subject: [PATCH v3 12/16] select: use freezable blocking call Date: Mon, 6 May 2013 16:50:17 -0700 Message-Id: <1367884221-20462-13-git-send-email-ccross@android.com> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1367884221-20462-1-git-send-email-ccross@android.com> References: <1367884221-20462-1-git-send-email-ccross@android.com> X-Gm-Message-State: ALoCoQlQFYoylFuwaZxHz3olhGS7epYb7c9WPHEui7grkMjOoR/oB9vLKN45RltIL8ELPB9uKf58xYcU6HPGJ76doCFb9SRn1on1rE4O7UDnL7v/lHEp17+2x8xq5mHtdrbRmOGvQmykQKiPMVP0Tww9LAafzPlQ8s2epyI2/cyJmQKZoliTfLBCBJvtQ7WNxvMT4a7l+BZP 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 select 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. Acked-by: Tejun Heo Signed-off-by: Colin Cross --- fs/select.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/select.c b/fs/select.c index 8c1c96c..6b14dc7 100644 --- a/fs/select.c +++ b/fs/select.c @@ -27,6 +27,7 @@ #include #include #include +#include #include @@ -236,7 +237,8 @@ int poll_schedule_timeout(struct poll_wqueues *pwq, int state, set_current_state(state); if (!pwq->triggered) - rc = schedule_hrtimeout_range(expires, slack, HRTIMER_MODE_ABS); + rc = freezable_schedule_hrtimeout_range(expires, slack, + HRTIMER_MODE_ABS); __set_current_state(TASK_RUNNING); /*