]> git.baikalelectronics.ru Git - kernel.git/commit
net: updating dst lastusage is an unlikely event.
authorPaolo Abeni <pabeni@redhat.com>
Tue, 24 Oct 2017 10:41:01 +0000 (12:41 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 27 Oct 2017 02:52:52 +0000 (11:52 +0900)
commita3bffe38c42fee4882789dcf73e56570073b2cfa
tree35337519773d8a269fcbcc72b706f0d6fef57c51
parent9e6098b0cef1dea863c99e480a655fa89fa2b63f
net: updating dst lastusage is an unlikely event.

Since commit de8c5434f017 ("ipv6: only update __use and lastusetime
once per jiffy at most"), updating the dst lastuse field is an
unlikely action: it happens at most once per jiffy, out of
potentially millions of calls per second.

Mark explicitly the code as such, and let the compiler generate
better code.

Note: gcc 7.2 and several older versions do actually generate
different - better - code when the unlikely() hint is in place,
avoid jump in the fast path and keeping better code locality.

Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/dst.h