scm: optimize put_cmsg()
authorEric Dumazet <edumazet@google.com>
Thu, 15 Apr 2021 17:37:53 +0000 (10:37 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 16 Apr 2021 00:03:33 +0000 (17:03 -0700)
commit38ebcf5096a86762b82262e96b2c8b170fe79040
treee374d75ffd37f3053bf687938f8596aea6988f69
parentb6faf160d0dac3c8654aa911e6e281541628d304
scm: optimize put_cmsg()

Calling two copy_to_user() for very small regions has very high overhead.

Switch to inlined unsafe_put_user() to save one stac/clac sequence,
and avoid copy_to_user().

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Soheil Hassas Yeganeh <soheil@google.com>
Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/scm.c