From patchwork Mon Apr 29 21:45:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Cross X-Patchwork-Id: 2502711 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 A502F3FD1A for ; Mon, 29 Apr 2013 21:47:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933092Ab3D2Vr2 (ORCPT ); Mon, 29 Apr 2013 17:47:28 -0400 Received: from mail-gg0-f202.google.com ([209.85.161.202]:58319 "EHLO mail-gg0-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932543Ab3D2Vp7 (ORCPT ); Mon, 29 Apr 2013 17:45:59 -0400 Received: by mail-gg0-f202.google.com with SMTP id 4so712875ggm.1 for ; Mon, 29 Apr 2013 14:45:58 -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=6CFr7pZBpoTYGocxq5UYidjzNg/ylwxtXx3y+xkFHtE=; b=o3Hd7oxXv3hfRlt94Wi6UcTL2IXAEnX1I9UxkPdne4W4lLse2/qd8SUhfbpc1n3maK eQHSWyLih6FOJS4Q3b8jYyl1/s8+rzhuKe2hhGR1nLSLvaa25DMi6OlEcvYBaXAKFe2S H0CLq1N0X8DUCJF8YJT4gZyPgBSRC88qoAlMPN/fNiDZxKdAWcYedJ8EqzCWEIY6/eBr TR2S9yRnAgi58FAJBpl2G0ilsY7QVtiegKsgRhr+8YQ/mnyJTnkBvVDMCi0zaKCQDNQ2 CYxnvZtl2/NiaqtkQuO2LJRsBE2S6z8F1LFQX8HN9CdTnIU6nJhHfC0m5KLMEax6LTfn yxBQ== X-Received: by 10.236.134.132 with SMTP id s4mr9152665yhi.56.1367271958346; Mon, 29 Apr 2013 14:45:58 -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 q46si491690yhh.4.2013.04.29.14.45.58 for (version=TLSv1.1 cipher=AES128-SHA bits=128/128); Mon, 29 Apr 2013 14:45:58 -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 18D245A4034; Mon, 29 Apr 2013 14:45:58 -0700 (PDT) Received: by walnut.mtv.corp.google.com (Postfix, from userid 99897) id EBB14161CB6; Mon, 29 Apr 2013 14:45:57 -0700 (PDT) From: Colin Cross To: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org, "Rafael J. Wysocki" , arve@android.com, Colin Cross , "David S. Miller" , Eric Dumazet , Al Viro , "Eric W. Biederman" , Gao feng , netdev@vger.kernel.org Subject: [PATCH 10/10] af_unix: use freezable blocking calls in read Date: Mon, 29 Apr 2013 14:45:46 -0700 Message-Id: <1367271946-7239-11-git-send-email-ccross@android.com> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1367271946-7239-1-git-send-email-ccross@android.com> References: <1367271946-7239-1-git-send-email-ccross@android.com> X-Gm-Message-State: ALoCoQkX74WteoU9D7xjXV6Y7iLOVdtnGfiU5pFUNeoqEYr2LYd6f3YKY1ejd8RjuWP7jtC3+GtPcGqOTtz/pjGipocwh11NZtlsASpZ5cebOf0AKB5VmXAiWFKIb4aKpoGXRteHn+uVoinMBWcu4O8gZmjfTuJufSvU1vON3da9xBRHwBCfHyuxfCVfA/HF7G8iMcW73RQE 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. 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); }