[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1357352744-8138-5-git-send-email-ming.lei@canonical.com>
Date: Sat, 5 Jan 2013 10:25:42 +0800
From: Ming Lei <ming.lei@...onical.com>
To: Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-usb@...r.kernel.org, linux-pm@...r.kernel.org,
linux-mm@...ck.org, Alan Stern <stern@...land.harvard.edu>,
Oliver Neukum <oneukum@...e.de>,
Minchan Kim <minchan@...nel.org>,
"Rafael J. Wysocki" <rjw@...k.pl>, Jens Axboe <axboe@...nel.dk>,
"David S. Miller" <davem@...emloft.net>,
Ming Lei <ming.lei@...onical.com>,
Eric Dumazet <eric.dumazet@...il.com>,
David Decotigny <david.decotigny@...gle.com>,
Tom Herbert <therbert@...gle.com>, Ingo Molnar <mingo@...e.hu>
Subject: [PATCH v7 4/6] net/core: apply pm_runtime_set_memalloc_noio on network devices
Deadlock might be caused by allocating memory with GFP_KERNEL in
runtime_resume and runtime_suspend callback of network devices in
iSCSI situation, so mark network devices and its ancestor as
'memalloc_noio' with the introduced pm_runtime_set_memalloc_noio().
Cc: "David S. Miller" <davem@...emloft.net>
Cc: Eric Dumazet <eric.dumazet@...il.com>
Cc: David Decotigny <david.decotigny@...gle.com>
Cc: Tom Herbert <therbert@...gle.com>
Cc: Ingo Molnar <mingo@...e.hu>
Signed-off-by: Ming Lei <ming.lei@...onical.com>
--
v7:
- rebase on v3.8-rc2-next-20130104
v4:
- call pm_runtime_set_memalloc_noio(ddev, true) after
device_add
---
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 29c884a..67e00b2 100644
--- a/net/core/net-sysfs.c
+++ b/net/core/net-sysfs.c
@@ -21,6 +21,7 @@
#include <linux/vmalloc.h>
#include <linux/export.h>
#include <linux/jiffies.h>
+#include <linux/pm_runtime.h>
#include "net-sysfs.h"
@@ -1409,6 +1410,8 @@ void netdev_unregister_kobject(struct net_device * net)
remove_queue_kobjects(net);
+ pm_runtime_set_memalloc_noio(dev, false);
+
device_del(dev);
}
@@ -1453,6 +1456,8 @@ int netdev_register_kobject(struct net_device *net)
return error;
}
+ pm_runtime_set_memalloc_noio(dev, true);
+
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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists