Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752483Ab2JVIf5 (ORCPT ); Mon, 22 Oct 2012 04:35:57 -0400 Received: from mail-pa0-f46.google.com ([209.85.220.46]:55660 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752355Ab2JVIfy (ORCPT ); Mon, 22 Oct 2012 04:35:54 -0400 From: Ming Lei To: linux-kernel@vger.kernel.org Cc: Alan Stern , Oliver Neukum , Minchan Kim , Greg Kroah-Hartman , "Rafael J. Wysocki" , Jens Axboe , "David S. Miller" , Andrew Morton , netdev@vger.kernel.org, linux-usb@vger.kernel.org, linux-pm@vger.kernel.org, linux-mm@kvack.org, Ming Lei , Eric Dumazet , David Decotigny , Tom Herbert , Ingo Molnar Subject: [RFC PATCH v2 4/6] net/core: apply pm_runtime_set_memalloc_noio on network devices Date: Mon, 22 Oct 2012 16:33:12 +0800 Message-Id: <1350894794-1494-5-git-send-email-ming.lei@canonical.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1350894794-1494-1-git-send-email-ming.lei@canonical.com> References: <1350894794-1494-1-git-send-email-ming.lei@canonical.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1572 Lines: 53 Deadlock might be caused by allocating memory with GFP_KERNEL in runtime_resume callback of network devices in iSCSI situation, so mark network devices and its ancestor as 'memalloc_noio_resume' with the introduced pm_runtime_set_memalloc_noio(). Cc: "David S. Miller" Cc: Eric Dumazet Cc: David Decotigny Cc: Tom Herbert Cc: Ingo Molnar Signed-off-by: Ming Lei --- net/core/net-sysfs.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c index bcf02f6..9aba5be 100644 --- a/net/core/net-sysfs.c +++ b/net/core/net-sysfs.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include "net-sysfs.h" @@ -1386,6 +1387,8 @@ void netdev_unregister_kobject(struct net_device * net) remove_queue_kobjects(net); + pm_runtime_set_memalloc_noio(dev, false); + device_del(dev); } @@ -1411,6 +1414,8 @@ int netdev_register_kobject(struct net_device *net) *groups++ = &netstat_group; #endif /* CONFIG_SYSFS */ + pm_runtime_set_memalloc_noio(dev, true); + error = device_add(dev); if (error) return error; -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/