From patchwork Thu May 2 01:35:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Cross X-Patchwork-Id: 2509731 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 DB291DF230 for ; Thu, 2 May 2013 01:41:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756226Ab3EBBlz (ORCPT ); Wed, 1 May 2013 21:41:55 -0400 Received: from mail-qc0-f201.google.com ([209.85.216.201]:53862 "EHLO mail-qc0-f201.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752891Ab3EBBly (ORCPT ); Wed, 1 May 2013 21:41:54 -0400 Received: by mail-qc0-f201.google.com with SMTP id f14so14633qcs.2 for ; Wed, 01 May 2013 18:41:54 -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=eSydZhb2KUTOlO3xcZp489oE9E/FP4No2p934YwQtxs=; b=I9VV0ynOIcv4bclWzkN+FwnC3UhqgPbv3vDOxNoCxQwKgrsPxH4wevFdZamB7kmf7+ LuCOAJu8FtO8Pf2QC3WwFtMxWMN29su44GI9KWRVYIM45a16cwbzVikomnPEoOemMisT GaURfhV2bLty3j5be+Thg22b3cnNNx5bJFJXfWzjCy7hZ5d0o+LZ9QUdho3O75AT7d24 S11dT4bBxTuRKqLh+cq36Nbf7hD7IxvXd7zNe2m59hmC2lUDnKrbJDndsDdA7mR6bkwz nEFJW5wObs2fS3YdWYcy+bXm1Ggktp9DFav1bU3MtEGkIx1eu24g9UEb4TZcuD29Iknf 0Ajg== X-Received: by 10.236.143.177 with SMTP id l37mr3905693yhj.9.1367458518294; Wed, 01 May 2013 18:35:18 -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 i36si399836yhb.3.2013.05.01.18.35.18 for (version=TLSv1.1 cipher=AES128-SHA bits=128/128); Wed, 01 May 2013 18:35:18 -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 24E345A4174; Wed, 1 May 2013 18:35:18 -0700 (PDT) Received: by walnut.mtv.corp.google.com (Postfix, from userid 99897) id DB4A2160F17; Wed, 1 May 2013 18:35:17 -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 , Alexander Viro , linux-fsdevel@vger.kernel.org Subject: [PATCH v2 05/10] epoll: use freezable blocking call Date: Wed, 1 May 2013 18:35:03 -0700 Message-Id: <1367458508-9133-6-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: ALoCoQmnDANxGklHvN0L3tUl119WL3pKhilP50ypyvqoIR/49WHDFoBpV6n8TJwYb2DQTwJciVizZMOyVWIVBxqeDN9/C0d5xslLVjZtBoF48VtdYrgJnP/9N3LufFaCXB5f0WrRRHeyDc2uds1h8MaoyR7mbdqN4jBGlp6NjbC3chNlLrGJAzZIGR6JieV76qAJK0i350ws 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. 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);