From patchwork Mon May 6 23:50:21 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Cross X-Patchwork-Id: 2528891 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 10AD1DF230 for ; Mon, 6 May 2013 23:51:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758169Ab3EFXvG (ORCPT ); Mon, 6 May 2013 19:51:06 -0400 Received: from mail-qc0-f201.google.com ([209.85.216.201]:43613 "EHLO mail-qc0-f201.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932578Ab3EFXui (ORCPT ); Mon, 6 May 2013 19:50:38 -0400 Received: by mail-qc0-f201.google.com with SMTP id c10so10604qcz.4 for ; Mon, 06 May 2013 16:50:37 -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=IseCsrJsDe2kjNMRlnF89e0Z+H4Hl14jtQVD3i8E9wU=; b=dBSJLEquh1r03tkzVhRiQoxRaf0Eb/2zngvHwfmEliBpEEoGo06IxrJHaB203DkGd8 EQCGDzRbWWyrRxSl4EdfE1V4IRML4sfjj0aqwiwqq+m9nBaClgCPf1j7q76+fiNe3J76 CibtaqUEM/Jg8KKw8YaiOhVdHsm1YbYbHUdH6KISCE+tyM8ed/I3y7nQsTWx9mPTcn11 A0u2lNtaHnuDesRPJThvBZacm2sWkZDVyXKBl8RPO7XmBG/yCcs6ArmiFSgForsTRJAU KGvvImIcC1Yi6JvmCXR2fVK/qsQam61Kssf1X7p8YAdJ8rrAqw5yvOrZatemkSjhrHNj N89g== X-Received: by 10.236.181.234 with SMTP id l70mr16971363yhm.53.1367884237446; Mon, 06 May 2013 16:50:37 -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 n23si2636753yhi.7.2013.05.06.16.50.37 for (version=TLSv1.1 cipher=AES128-SHA bits=128/128); Mon, 06 May 2013 16:50:37 -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 45BC55A4250; Mon, 6 May 2013 16:50:37 -0700 (PDT) Received: by walnut.mtv.corp.google.com (Postfix, from userid 99897) id 04E8416078C; Mon, 6 May 2013 16:50:36 -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 , "David S. Miller" , Eric Dumazet , Al Viro , "Eric W. Biederman" , Gao feng Subject: [PATCH v3 16/16] af_unix: use freezable blocking calls in read Date: Mon, 6 May 2013 16:50:21 -0700 Message-Id: <1367884221-20462-17-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: ALoCoQkJGX99qEcgzfEUR7xtKKt6bR5vEdjFzi3+J+w7WaMdYwxybUuzhlFSg38g5Kt8bAO2UxH4fs0ZfLO9ZkvLAo6x2LMACHM4ffl9nOCuQKNe2wBVVUwGjHfRVTmIRELJZ99+4NsGHo2fqKclf4JovRbJf/tgm844+/ZlYjkH2fSRnq8KggmKyLh/uqAF20Yu9SND6t2Xq8ihP6khX61DYqAzyJdp+Q== 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 read call on an AF_UNIX socket 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 --- net/unix/af_unix.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index 2db702d..2bcac57 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c @@ -114,6 +114,7 @@ #include #include #include +#include struct hlist_head unix_socket_table[2 * UNIX_HASH_SIZE]; EXPORT_SYMBOL_GPL(unix_socket_table); @@ -1880,7 +1881,7 @@ static long unix_stream_data_wait(struct sock *sk, long timeo) set_bit(SOCK_ASYNC_WAITDATA, &sk->sk_socket->flags); unix_state_unlock(sk); - timeo = schedule_timeout(timeo); + timeo = freezable_schedule_timeout(timeo); unix_state_lock(sk); clear_bit(SOCK_ASYNC_WAITDATA, &sk->sk_socket->flags); }