From patchwork Thu May 2 01:35:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Cross X-Patchwork-Id: 2509661 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 7AF7A3FC5A for ; Thu, 2 May 2013 01:36:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759326Ab3EBBgS (ORCPT ); Wed, 1 May 2013 21:36:18 -0400 Received: from mail-gg0-f201.google.com ([209.85.161.201]:50247 "EHLO mail-gg0-f201.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758912Ab3EBBfV (ORCPT ); Wed, 1 May 2013 21:35:21 -0400 Received: by mail-gg0-f201.google.com with SMTP id k25so14310ggl.2 for ; Wed, 01 May 2013 18:35: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=QkJiuw6JOhfimqMhRVyecf3NGIZlqgD6OE1k8dxQJQA=; b=dGk6xXOex1tPUuDsbKISJFAAmLd1AUXbT9R79natZP8x5Oko7oF9pvoYboVsQkIzaW i71Qif02DRtYjUpsHlVqQu1vuAYb0iTSR8qdCJcdJeQLCo8cVD4ncXjDj1ewWsG5O3Dj O8ybZg6VA7Iyb8ZW41HC4IibjrHZtotC8vUp6tGvDZcb9le+zL/ec8e6QiUmRpXWwois U9eFotUynFuxeJ/LbVflAbCi5Ro7bacqvaWf9KZM8oODJqsXUfhVZcM2MTrejljOC3Jw xwMNd3poEtlYBoyD/M4C0D0YYmjqzoU8r/iXikv6Uprz0Y9IQdhIfci81Y5D7AlrA4S0 b2Vg== X-Received: by 10.236.89.65 with SMTP id b41mr3626448yhf.49.1367458520492; 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 s48si395864yhe.6.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 51FD85A4174; Wed, 1 May 2013 18:35:20 -0700 (PDT) Received: by walnut.mtv.corp.google.com (Postfix, from userid 99897) id 12378160D29; 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 , Darren Hart , Thomas Gleixner , Andrew Morton , Randy Dunlap , Al Viro Subject: [PATCH v2 07/10] futex: use freezable blocking call Date: Wed, 1 May 2013 18:35:05 -0700 Message-Id: <1367458508-9133-8-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: ALoCoQnPeUtj//xNjHd2PjTJSjvmfZ9GhMQzibNhA4IPAgBB3uXkoNGJv7xJ6z8NnaeS4fAXBQ9D7dhbzADn5X0+0m8X8YvnVATTC/tEoA4e7UbPb40ukrQ9m4eDGOW1jaSDIBdYuFHcMXbjXZYKrWDLv0aEe4jcdwJvh5xOUJpwsZsTAoH8IvNk0+/Gz963MUTUtYx9mBqV 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 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. Signed-off-by: Colin Cross Acked-by: Thomas Gleixner Acked-by: Darren Hart --- 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); }