[Devel] [PATCH RHEL COMMIT] netlink: silence high-order memory allocation warning in netlink_ack

Konstantin Khorenko khorenko at virtuozzo.com
Thu Sep 30 16:03:59 MSK 2021


The commit is pushed to "branch-rh9-5.14.vz9.1.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after ark-5.14
------>
commit e7c3acba0b6a47ea0f34ac19c18ed27c735190cb
Author: Vasily Averin <vvs at virtuozzo.com>
Date:   Thu Sep 30 16:03:59 2021 +0300

    netlink: silence high-order memory allocation warning in netlink_ack
    
    In some cases netlink_ack() legally does high-order memory allocation.
    
     ------------[ cut here ]------------
     WARNING: CPU: 4 PID: 258995 at mm/page_alloc.c:3533 __alloc_pages_nodemask+0x1b1/0x600
     order 4 >= 3, gfp 0x2040d0
     Call Trace:
      [<ffffffff97c9d1ba>] __warn+0xfa/0x100
      [<ffffffff97c9d21f>] warn_slowpath_fmt+0x5f/0x80
      [<ffffffff97ddfaa1>] __alloc_pages_nodemask+0x1b1/0x600
      [<ffffffff983b4bb9>] kmalloc_large_node+0x5f/0x80
      [<ffffffff97e47ff2>] __kmalloc_node_track_caller+0x292/0x300
      [<ffffffff98272734>] __kmalloc_reserve.isra.32+0x44/0xa0
      [<ffffffff9827377d>] __alloc_skb+0x8d/0x2d0
      [<ffffffff982c80b9>] netlink_ack+0x49/0x110
      [<ffffffff97d4e267>] audit_receive+0x67/0xa0
      [<ffffffff982c7b8c>] netlink_unicast+0x1bc/0x240
      [<ffffffff982c7f5e>] netlink_sendmsg+0x34e/0x460
      [<ffffffff98269480>] sock_sendmsg+0xb0/0xf0
      [<ffffffff9826a379>] ___sys_sendmsg+0x3e9/0x400
      [<ffffffff9826ba01>] __sys_sendmsg+0x51/0x90
      [<ffffffff9826ba52>] SyS_sendmsg+0x12/0x20
      [<ffffffff983cbf92>] system_call_fastpath+0x25/0x2a
    
    This patch disables warning generation in this case.
    https://jira.sw.ru/browse/PSBM-120889
    Signed-off-by: Vasily Averin <vvs at virtuozzo.com>
    
    (cherry-picked from vz7 commit 6e0d67b80bd21a83eb5becc33ad69a7ee3074f00)
    https://jira.sw.ru/browse/PSBM-127858
    Signed-off-by: Valeriy Vdovin <valeriy.vdovin at virtuozzo.com>
    
    (cherry picked from vz8 commit 0086e9b0683566341184ba4c1c54979c87a2022f)
    Signed-off-by: Andrey Zhadchenko <andrey.zhadchenko at virtuozzo.com>
---
 net/netlink/af_netlink.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index 528f43593e9e..454110ce2a6c 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -2456,7 +2456,7 @@ void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err,
 	if (tlvlen)
 		flags |= NLM_F_ACK_TLVS;
 
-	skb = nlmsg_new(payload + tlvlen, GFP_KERNEL);
+	skb = nlmsg_new(payload + tlvlen, GFP_KERNEL|__GFP_ORDER_NOWARN);
 	if (!skb) {
 		NETLINK_CB(in_skb).sk->sk_err = ENOBUFS;
 		sk_error_report(NETLINK_CB(in_skb).sk);


More information about the Devel mailing list