]> git.baikalelectronics.ru Git - kernel.git/commit
net: avoid an indirect call in ____sys_recvmsg()
authorEric Dumazet <edumazet@google.com>
Fri, 6 Dec 2019 17:38:36 +0000 (09:38 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 6 Dec 2019 20:06:44 +0000 (12:06 -0800)
commitfe016cf9d52bd513cc3dc73138f16584c67695c9
treea590d14576eeb53502e7d98d3a222e2368099c59
parentce10cebab55a54d9bf1e2868e9ff54a91c699212
net: avoid an indirect call in ____sys_recvmsg()

CONFIG_RETPOLINE=y made indirect calls expensive.

gcc seems to add an indirect call in ____sys_recvmsg().

Rewriting the code slightly makes sure to avoid this indirection.

Alternative would be to not call sock_recvmsg() and instead
use security_socket_recvmsg() and sock_recvmsg_nosec(),
but this is less readable IMO.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: David Laight <David.Laight@aculab.com>
Acked-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/socket.c