]> git.baikalelectronics.ru Git - kernel.git/commit
inetpeer: use div64_ul() and clamp_val() calculate inet_peer_threshold
authorYejune Deng <yejune.deng@gmail.com>
Mon, 1 Mar 2021 06:05:48 +0000 (14:05 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 1 Mar 2021 21:32:12 +0000 (13:32 -0800)
commit0383a65ad814bf9c8f742daadb2b4ac98e37247f
treeaeb34baeb465eb1937b01d46fe252bb4f0b73099
parentc96ea8b42ab8d0f8e88d24758ba3c1a079a6b3dc
inetpeer: use div64_ul() and clamp_val() calculate inet_peer_threshold

In inet_initpeers(), struct inet_peer on IA32 uses 128 bytes in nowdays.
Get rid of the cascade and use div64_ul() and clamp_val() calculate that
will not need to be adjusted in the future as suggested by Eric Dumazet.

Suggested-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Yejune Deng <yejune.deng@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/inetpeer.c