[Devel] [PATCH RHEL7 COMMIT] ms/netlink: do not enter direct reclaim from netlink_trim()

Konstantin Khorenko khorenko at virtuozzo.com
Mon May 18 22:35:44 MSK 2020


The commit is pushed to "branch-rh7-3.10.0-1127.8.2.vz7.151.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-1127.8.2.vz7.151.1
------>
commit 46e0291034819d38e85f62f3cff956daa1618b95
Author: Vasily Averin <vvs at virtuozzo.com>
Date:   Mon May 18 22:35:44 2020 +0300

    ms/netlink: do not enter direct reclaim from netlink_trim()
    
    [ Upstream commit e89df813174d]
    
    In commit d35c99ff77ecb ("netlink: do not enter direct reclaim from
    netlink_dump()") we made sure to not trigger expensive memory reclaim.
    
    Problem is that a bit later, netlink_trim() might be called and
    trigger memory reclaim.
    
    netlink_trim() should be best effort, and really as fast as possible.
    Under memory pressure, it is fine to not trim this skb.
    
    Signed-off-by: Eric Dumazet <edumazet at google.com>
    Acked-by: Alexei Starovoitov <ast at kernel.org>
    Signed-off-by: David S. Miller <davem at davemloft.net>
    
    [vvs@: backported]
    https://jira.sw.ru/browse/PSBM-104086
    Signed-off-by: Vasily Averin <vvs at virtuozzo.com>
---
 net/netlink/af_netlink.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index c36d6c354dfc5..7b3de330d2340 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -1166,7 +1166,10 @@ static struct sk_buff *netlink_trim(struct sk_buff *skb, gfp_t allocation)
 		skb = nskb;
 	}
 
-	pskb_expand_head(skb, 0, -delta, allocation);
+	pskb_expand_head(skb, 0, -delta,
+			 (allocation & ~__GFP_WAIT) |
+			 __GFP_NOWARN | __GFP_NORETRY);
+
 	return skb;
 }
 


More information about the Devel mailing list