From patchwork Mon May 6 23:50:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Cross X-Patchwork-Id: 2528941 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 4C139DF230 for ; Mon, 6 May 2013 23:52:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932922Ab3EFXwe (ORCPT ); Mon, 6 May 2013 19:52:34 -0400 Received: from mail-vb0-f74.google.com ([209.85.212.74]:48624 "EHLO mail-vb0-f74.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932465Ab3EFXuc (ORCPT ); Mon, 6 May 2013 19:50:32 -0400 Received: by mail-vb0-f74.google.com with SMTP id q16so447330vbe.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=IErXXpeI47ZVRYQb5yC46xVGPBgBbhSTXe8bATqo1DM=; b=UZuejRFPMD4zc3UKTEqdDpRrCKLiMvUOMFPYPxZvVqD18tvLw3tCgbv6BE5Yn5OE3j PAxDOoYOg+bDsHRhsASHFO8gdsyt/s+LSQ9iXE/cFbf5KbOwWbrTbkqFZ6EjXyusnCs+ lsBQWfoTsffrmYGbIlSwB+eh5JyxsVMtd8MnNHHM9T+9Xg9mDbBekGbHfEGz147LD+BX ZcwKWZdwdlQw8J1GlesWfWPOdzTf064p01/K4OxndnpgDjdZpgocH2xtkbKAX93+/z2Z BP/C+fv9QfoAv2GYyz176nm/jekuePv/PmZyofLdHaC1rBy3tPQc5qDWJs3ynh9KcUbk hdKg== X-Received: by 10.236.46.50 with SMTP id q38mr13864777yhb.44.1367884230959; Mon, 06 May 2013 16:50:30 -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 n78si2644775yhh.1.2013.05.06.16.50.30 for (version=TLSv1.1 cipher=AES128-SHA bits=128/128); Mon, 06 May 2013 16:50:30 -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 C0C135A4005; Mon, 6 May 2013 16:50:30 -0700 (PDT) Received: by walnut.mtv.corp.google.com (Postfix, from userid 99897) id 81F0016078C; 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 , Greg Kroah-Hartman , Al Viro , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , "Eric W. Biederman" , Sachin Kamat , devel@driverdev.osuosl.org Subject: [PATCH v3 10/16] binder: use freezable blocking calls Date: Mon, 6 May 2013 16:50:15 -0700 Message-Id: <1367884221-20462-11-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: ALoCoQnarJl7ZrTEeo834uYQlPe6bu/c8Mh183O4QZm0ZCyIlepukoDQVfTJsPZZzma/vGYQxGYnZ0TecrZtnVgzz6+9lZWjoNuMVznyTqX5Frktfi8HWTK4XGJ6LeOH6uG6yUnPivgx0kymOJ2N0sztgFe6oSBhApc8pUwt6x9g+Rs4AR8INePeimN0n4pFlwYE8gJSv0trnUvY2Up4Se04syc74D53xg== 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 binder 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 --- drivers/staging/android/binder.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/android/binder.c b/drivers/staging/android/binder.c index 24456a0..af8fba4 100644 --- a/drivers/staging/android/binder.c +++ b/drivers/staging/android/binder.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -2140,13 +2141,13 @@ retry: if (!binder_has_proc_work(proc, thread)) ret = -EAGAIN; } else - ret = wait_event_interruptible_exclusive(proc->wait, binder_has_proc_work(proc, thread)); + ret = wait_event_freezable_exclusive(proc->wait, binder_has_proc_work(proc, thread)); } else { if (non_block) { if (!binder_has_thread_work(thread)) ret = -EAGAIN; } else - ret = wait_event_interruptible(thread->wait, binder_has_thread_work(thread)); + ret = wait_event_freezable(thread->wait, binder_has_thread_work(thread)); } binder_lock(__func__);