linux/include/net/sctp
David Laight b9420e1c87 net: sctp: Optimise the way 'sctp_arg_t' values are initialised.
Even if memset() is inlined (as on x86) using it to zero the union
generates a memory word write of zero, followed by a write of the
smaller field, and then a read of the word.
As well as being a lot of instructions the sequence is unlikely to
be optimised by the store-load forward hardware so will be slow.

Instead allocate a field of the union that is the same size as the
entire union and write a zero value to it. The compiler will then
generate the required value in a register.

Zeroing the union shouldn't be necessary, but this patch series isn't
intended to have a behavioural change.

Signed-off-by: David Laight <david.laight@aculab.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-07-08 14:39:00 -07:00
..
auth.h include/net/: Fix FSF address in file headers 2013-12-06 12:37:56 -05:00
checksum.h include/net/: Fix FSF address in file headers 2013-12-06 12:37:56 -05:00
command.h net: sctp: Optimise the way 'sctp_arg_t' values are initialised. 2014-07-08 14:39:00 -07:00
constants.h include/net/: Fix FSF address in file headers 2013-12-06 12:37:56 -05:00
sctp.h net: sctp: improve timer slack calculation for transport HBs 2014-07-02 18:44:07 -07:00
sm.h sctp: Fix FSF address in file headers 2013-12-06 12:37:56 -05:00
structs.h net: sctp: migrate most recently used transport to ktime 2014-06-11 12:23:17 -07:00
tsnmap.h sctp: Fix FSF address in file headers 2013-12-06 12:37:56 -05:00
ulpevent.h sctp: Fix FSF address in file headers 2013-12-06 12:37:56 -05:00
ulpqueue.h sctp: Fix FSF address in file headers 2013-12-06 12:37:56 -05:00