On 3/26/17 9:11 PM, Eric W. Biederman wrote: > I don't like this. Byte writes don't exist on all architectures. > > So while I think always writing to rtn_nhn_alive under the > rtn_lock ensures that we don't have wrong values written > it is quite subtle. And I don't know how this will interact with other > fields that you are introducing. > > AKA this might be ok, but I expect this formulation of the code > will easily bit-rot and break.
net/ has other use cases -- e.g., ipv6 tunneling has proto as a u8. It unrealistic for a route to have 255 or more nexthops so the point of this patch is to not waste 8 bytes tracking it - especially when removing it gets routes with ipv4 and ipv6 via's into a cache line. I can make the alive counter a u16 without increasing the size of the struct. I'd prefer to leave it as an u8 to have a u8 hole for flags should something be needed later.