[Devel] [PATCH RHEL8 COMMIT] netlink: silence high-order memory allocation warning in netlink_ack
Konstantin Khorenko
khorenko at virtuozzo.com
Mon Jun 21 21:05:32 MSK 2021
The commit is pushed to "branch-rh8-4.18.0-240.1.1.vz8.5.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh8-4.18.0-240.1.1.vz8.5.47
------>
commit 460eab691b24e6871c0431927820c9d42117e095
Author: Vasily Averin <vvs at virtuozzo.com>
Date: Mon Jun 21 21:05:31 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>
---
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 fcd647b113a7..83f73cd4eafb 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -2479,7 +2479,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;
NETLINK_CB(in_skb).sk->sk_error_report(NETLINK_CB(in_skb).sk);
More information about the Devel
mailing list