From patchwork Mon May 6 23:50:16 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Cross X-Patchwork-Id: 2529331 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 A7D383FD85 for ; Mon, 6 May 2013 23:58:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758767Ab3EFX6Z (ORCPT ); Mon, 6 May 2013 19:58:25 -0400 Received: from mail-ye0-f202.google.com ([209.85.213.202]:39620 "EHLO mail-ye0-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758750Ab3EFX6V (ORCPT ); Mon, 6 May 2013 19:58:21 -0400 Received: by mail-ye0-f202.google.com with SMTP id r13so448544yen.1 for ; Mon, 06 May 2013 16:58: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=qFfI4Fc5BARiMyADWKZV8WQC9sUsbPr7keav8vPxP64=; b=KzrTYs8BeIbIwIylIdcUlp5Fc3HXnYMubNl+zbkwo4O1atPtI0hYZ4zhau0Sn3MtTr ARUUM0N3JeRJDh7zquAt2a2hISSh2IUPG+n/v8IEm17lYipOmAVxg+V4K8EAjx1vC1cg 4hHbYfL355TAqOljFAuZTZqd7f7E0yPXTpv9A/RHxFdxNP4twgHx1dyLQDbh6W1eY6r0 c7dKz15fDtGOBIszBhHM2oO8RKix0kVJotP1ZqNB2TjQ2QjbyYNkzL8jey7Jat1f6RL2 LYNKxEpfXsZgRkoGAfUzxAP0UPgBY+FJh18/PJEOsFOrWHAo09efa7OnoW4+++8tX5Vk HkOw== X-Received: by 10.236.41.137 with SMTP id h9mr17867264yhb.43.1367884231097; Mon, 06 May 2013 16:50:31 -0700 (PDT) Received: from corp2gmr1-1.hot.corp.google.com (corp2gmr1-1.hot.corp.google.com [172.24.189.92]) by gmr-mx.google.com with ESMTPS id q46si2640330yhh.4.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-1.hot.corp.google.com (Postfix) with ESMTP id E8BF531C078; Mon, 6 May 2013 16:50:30 -0700 (PDT) Received: by walnut.mtv.corp.google.com (Postfix, from userid 99897) id AACB61613E8; 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 11/16] epoll: use freezable blocking call Date: Mon, 6 May 2013 16:50:16 -0700 Message-Id: <1367884221-20462-12-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: ALoCoQkCuJyEuvEE/Iz5dpHgTG1CsnsKS9ylQruu0gc4i2ZBgoL4zUelGQSbtdlCzhxxDVSDvmjaS2ZJYlbxxR08VApkjaau2I6Dcz34QoyYpixlqsmzrhKZiEhtnt5d42UTOZOz0Pw9NKds3nzc8Az387HVBRdpdBYpbCE6wswoj4/v347YElbdQvYE2RCoOmEphkIUlbk9 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 an epoll_wait 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/eventpoll.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/eventpoll.c b/fs/eventpoll.c index 9fec183..65245e7 100644 --- a/fs/eventpoll.c +++ b/fs/eventpoll.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -1543,7 +1544,8 @@ fetch_events: } spin_unlock_irqrestore(&ep->lock, flags); - if (!schedule_hrtimeout_range(to, slack, HRTIMER_MODE_ABS)) + if (!freezable_schedule_hrtimeout_range(to, slack, + HRTIMER_MODE_ABS)) timed_out = 1; spin_lock_irqsave(&ep->lock, flags);