Skip to contentSkip to conversation

netlink: Allow direct reclaim for fallback allocation

PATCH RESEND Applied Ross Lagerwall 2 participants 3 messages May 3, 2017 – May 4, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 netlink: Allow direct reclaim for fallback allocation

The backport of d35c99ff77ec ("netlink: do not enter direct reclaim from netlink_dump()") to the 4.4 branch (first in 4.4.32) mistakenly removed direct claim from the initial large allocation _and_ the fallback allocation which means that allocations can spuriously fail. Fix the issue by adding back the direct reclaim flag to the fallback allocation.

Fixes 6d123f1d396b ("netlink: do not enter direct reclaim from netlink_dump()")

---

Note that this is only for the 4.4 branch as the regression is only in this branch. Consequently, there is no corresponding upstream commit.

I'm resending this to the linux-stable list since I now understand the netdev maintainer only handles backports for the last couple of versions of Linux.

 net/netlink/af_netlink.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/netlink/af_netlink.c +1 -1
index 8e33019..acfb16f 100644
@@ -2107,7 +2107,7 @@ static int netlink_dump(struct sock *sk)
 	if (!skb) {
 		alloc_size = alloc_min_size;
 		skb = netlink_alloc_skb(sk, alloc_size, nlk->portid,
-					(GFP_KERNEL & ~__GFP_DIRECT_RECLAIM));
+					GFP_KERNEL);
 	}
 	if (!skb)
 		goto errout_skb;
Signature · 1 line
2.7.4
#1 lore raw
Quoted 9 lines · Ross Lagerwall

The backport of d35c99ff77ec ("netlink: do not enter direct reclaim from netlink_dump()") to the 4.4 branch (first in 4.4.32) mistakenly removed direct claim from the initial large allocation _and_ the fallback allocation which means that allocations can spuriously fail. Fix the issue by adding back the direct reclaim flag to the fallback allocation.

Fixes 6d123f1d396b ("netlink: do not enter direct reclaim from netlink_dump()")
Quoted 9 lines

---

Note that this is only for the 4.4 branch as the regression is only in this branch. Consequently, there is no corresponding upstream commit.

I'm resending this to the linux-stable list since I now understand the netdev maintainer only handles backports for the last couple of versions of Linux.

Many thanks for this fix, now queued up.

greg k-h

maintainer Applied
#2 lore raw

Patch "netlink: Allow direct reclaim for fallback allocation" has been added to the 4.4-stable tree

In reply to Ross Lagerwall

This is a note to let you know that I've just added the patch titled

netlink: Allow direct reclaim for fallback allocation

to the 4.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
netlink-allow-direct-reclaim-for-fallback-allocation.patch
and it can be found in the queue-4.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From [email protected] Thu May 4 12:37:51 2017

From: Ross Lagerwall <[email protected]>
Date: Wed, 3 May 2017 09:44:19 +0100
Subject: netlink: Allow direct reclaim for fallback allocation
To: <[email protected]>
Cc: Ross Lagerwall <[email protected]>, "David S. Miller" <[email protected]>, Greg Kroah-Hartman <[email protected]>, Eric Dumazet <[email protected]>, <[email protected]>, <[email protected]>
Message-ID: <[email protected]>

From: Ross Lagerwall <[email protected]>

The backport of d35c99ff77ec ("netlink: do not enter direct reclaim from netlink_dump()") to the 4.4 branch (first in 4.4.32) mistakenly removed direct claim from the initial large allocation _and_ the fallback allocation which means that allocations can spuriously fail. Fix the issue by adding back the direct reclaim flag to the fallback allocation.

Fixes 6d123f1d396b ("netlink: do not enter direct reclaim from netlink_dump()")

---

Note that this is only for the 4.4 branch as the regression is only in this branch. Consequently, there is no corresponding upstream commit.

I'm resending this to the linux-stable list since I now understand the netdev maintainer only handles backports for the last couple of versions of Linux.

 net/netlink/af_netlink.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/netlink/af_netlink.c +1 -1
@@ -2107,7 +2107,7 @@ static int netlink_dump(struct sock *sk)
 	if (!skb) {
 		alloc_size = alloc_min_size;
 		skb = netlink_alloc_skb(sk, alloc_size, nlk->portid,
-					(GFP_KERNEL & ~__GFP_DIRECT_RECLAIM));
+					GFP_KERNEL);
 	}
 	if (!skb)
 		goto errout_skb;

Patches currently in stable-queue which might be from [email protected] are

queue-4.4/netlink-allow-direct-reclaim-for-fallback-allocation.patch