From patchwork Thu May 2 01:35:08 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Cross X-Patchwork-Id: 2509641 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 A078CDF230 for ; Thu, 2 May 2013 01:36:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758868Ab3EBBgQ (ORCPT ); Wed, 1 May 2013 21:36:16 -0400 Received: from mail-gg0-f201.google.com ([209.85.161.201]:39768 "EHLO mail-gg0-f201.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757088Ab3EBBfY (ORCPT ); Wed, 1 May 2013 21:35:24 -0400 Received: by mail-gg0-f201.google.com with SMTP id k25so14313ggl.2 for ; Wed, 01 May 2013 18:35:24 -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=An0gthRLrnxCho+oU47J7/fTl4GdS055u43WbbbOry8=; b=kLvFe/KjUUDMfkm6ppsdBNBtGwU1xDo6roD8iMzRlCk1DEJC4VjP/ywybLzww6567Y tN4pvy8YYp5Ei0BB4tIaz4Eyw6EWaBo4rLaNyyH2I2z1L9QLpZw4TBTlCjUGAb+jJy8z wBzIV9OaLrkqcnMGFLTL8YotbPvLE/iGz3HukXDNd9cODZKaT7N7Np+brBASKWceyTBg nU3/QC9Yr2RHsAngWvpqbYG2rkysdMNfsNof82Gqn+mGF6ehTRSpa6TuLd2RFaRrkM1d NN936MnxYBuXeMI0M+OZFND4FJx9sMaNECYepFiLXMNJqBaTSY+ECXIFluR2H+cHo32E 4GAA== X-Received: by 10.236.93.116 with SMTP id k80mr3553669yhf.32.1367458524139; Wed, 01 May 2013 18:35:24 -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 q46si398549yhh.4.2013.05.01.18.35.24 for (version=TLSv1.1 cipher=AES128-SHA bits=128/128); Wed, 01 May 2013 18:35:24 -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 F3AA65A4174; Wed, 1 May 2013 18:35:23 -0700 (PDT) Received: by walnut.mtv.corp.google.com (Postfix, from userid 99897) id B3865160D29; Wed, 1 May 2013 18:35:23 -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 , "David S. Miller" , Eric Dumazet , Al Viro , "Eric W. Biederman" , Gao feng , netdev@vger.kernel.org Subject: [PATCH v2 10/10] af_unix: use freezable blocking calls in read Date: Wed, 1 May 2013 18:35:08 -0700 Message-Id: <1367458508-9133-11-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: ALoCoQm86sJNvtetufTYj7IEqc4DnGaiCDoy3IBci2WJUGfpX0U/uVW1GpjDwcM4M3MDXyJTuBW890Fr9rttbqbVF8OMzC4WTxAstro1mrL31KLKaadagx8TsNVxh7pa55iGh552OkPo5XFOAN3MolTKbFhRfMFIycbPK2Fy1zWiuQ9aJ4BeTGK9urNEGhrtgX9JK9XvlCYV 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 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. 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); }