lkml.org 
[lkml]   [2012]   [Oct]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 4/6] net/core: apply pm_runtime_set_memalloc_noio on network devices
On Mon, 29 Oct 2012, Ming Lei wrote:

> 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().

> @@ -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;

This is an example of what I described earlier. The
pm_runtime_set_memalloc_noio() call should come after device_add(), not
before.

(Not to mention that this version of the code doesn't correctly handle
the case where device_add() fails.)

Alan Stern



\
 
 \ /
  Last update: 2012-10-29 17:41    [W:0.126 / U:1.368 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site