From patchwork Mon May 6 23:50:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Cross X-Patchwork-Id: 2529361 Return-Path: X-Original-To: patchwork-linux-nfs@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 4A682E014A for ; Mon, 6 May 2013 23:58:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758835Ab3EFX6d (ORCPT ); Mon, 6 May 2013 19:58:33 -0400 Received: from mail-ye0-f202.google.com ([209.85.213.202]:54956 "EHLO mail-ye0-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758750Ab3EFX6a (ORCPT ); Mon, 6 May 2013 19:58:30 -0400 Received: by mail-ye0-f202.google.com with SMTP id r13so448554yen.1 for ; Mon, 06 May 2013 16:58:30 -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=5TlmWYBx/I2hh7GVFS8xh95xJLDvcKMh5FoMqi33vgk=; b=oeo4KG9YtCcvgzy6hvemqqf2di5Vtevsx6NZ27Dot1sTOwWqkl79OB92Y4itAc7u2b 8PDAZW3hHn5RMga3y+PEjXOrH/CxVpQzBc1DigjK28+My4ZdHJmOZ2zAgWq6qQ2zYcD8 +hxKL0ghpN/y05VENT6IBzLyWwhWtIU3yZxT429rOaggff+piHHxKoiwH6ocVvtPMulO gsNIarMRPX8amvMY1/sXo7kqXsLw5JlLxr0T6MVOAVWZOeo9stIzJv2iEk0NFXNi8b3P /S09xO3SiiUif4LsjeQVMzr4+rlEAs36SUu1fC7TfKg4ZWchygUZO4syWLgz1PhFXWz+ DrRA== X-Received: by 10.236.183.98 with SMTP id p62mr17666192yhm.3.1367884233151; Mon, 06 May 2013 16:50:33 -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 s48si2637308yhe.6.2013.05.06.16.50.33 for (version=TLSv1.1 cipher=AES128-SHA bits=128/128); Mon, 06 May 2013 16:50:33 -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 F16BC5A4005; Mon, 6 May 2013 16:50:32 -0700 (PDT) Received: by walnut.mtv.corp.google.com (Postfix, from userid 99897) id B14B416078C; Mon, 6 May 2013 16:50:32 -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 , Darren Hart , Thomas Gleixner , Randy Dunlap , Al Viro Subject: [PATCH v3 13/16] futex: use freezable blocking call Date: Mon, 6 May 2013 16:50:18 -0700 Message-Id: <1367884221-20462-14-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: ALoCoQmtnpb/ZWd0hmpeG2+gPbanyDLQiwfxEsHsjWvytevEz5yT1FRgvMBKM6MpzxjO1aRpcCB85krtoLSm2ImYF2inh2A03k2tZ4AjtOu3+8SoWt43etqwavtCMrtnltk5RVLQ1BAgnk/GKjhRBC3b+wywNDKVb4BWtXlnG4C88znthHtz7MvUdlGUOFC5DtV3SqVpH8zAcFMcekjwOkegB5dm4FlAHA== Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Avoid waking up every thread sleeping in a futex_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 Acked-by: Thomas Gleixner Acked-by: Darren Hart Signed-off-by: Colin Cross --- kernel/futex.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/futex.c b/kernel/futex.c index b26dcfc..d710fae 100644 --- a/kernel/futex.c +++ b/kernel/futex.c @@ -61,6 +61,7 @@ #include #include #include +#include #include @@ -1807,7 +1808,7 @@ static void futex_wait_queue_me(struct futex_hash_bucket *hb, struct futex_q *q, * is no timeout, or if it has yet to expire. */ if (!timeout || timeout->task) - schedule(); + freezable_schedule(); } __set_current_state(TASK_RUNNING); }