]> git.baikalelectronics.ru Git - kernel.git/commit
net/sysctl: avoid two synchronize_rcu() calls
authorEric Dumazet <edumazet@google.com>
Fri, 25 Feb 2022 16:18:55 +0000 (08:18 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Feb 2022 11:40:47 +0000 (11:40 +0000)
commit4d0da1c5ba4b772276b294fbe783efe6d92f3038
tree2d43f17047844c6ce22ece7d96ff6e085061dc81
parentbc92384d4fe5ed38a80d5f5233577e7132a316dd
net/sysctl: avoid two synchronize_rcu() calls

Both rps_sock_flow_sysctl() and flow_limit_cpu_sysctl()
are using synchronize_rcu() right before freeing memory
either by vfree() or kfree()

They can switch to kvfree_rcu(ptr) and kfree_rcu(ptr) to benefit
from asynchronous mode, instead of blocking the current thread.

Note that kvfree_rcu(ptr) and kfree_rcu(ptr) eventually can
have to use synchronize_rcu() in some memory pressure cases.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/sysctl_net_core.c