Hi Tim, On Fri, Mar 06, 2020 at 01:15:39PM +0100, Tim Duesterhus wrote: > For the whole unique ID processing I've used the new `ist` helpers, it > might make sense to update the authority processing to make use of ist > in a future CLEANUP patch. > > I've added the new `struct connection` member at the end. Please check > whether you think that is the appropriate place for it or if it should > be moved somewhere else because of holes or caches.
I'm seeing that the struct connection has become huge (160 bytes now) and is going to be inflated by 10% with this change. The authority used to save a few bytes by keeping the length on a uint8_t but that's still a detail. I think that the real problem is the proxy protocol processing here. It's very rarely used by those where the connection size matters, and when we look at it, we can see : proxy_netns (8) proxy_authority (8) proxy_authority_len (1) proxy_unique_id (16) That's a total of 33 bytes (well, 40-48 in practice due to holes around) that are there only for the proxy proto. What could possibly be done to improve the situation would be to create a pool of proxy-proto entries which would contain room for netns, auth and unique_id and which would be allocated on the fly when receiving such TLV fields. We'd only inflate it when adding new fields and that would only eat memory in such a case. Thinking that the change above alone is enough to go back to 128 bytes hence two cache lines makes me really tempted to have a look at it. But for now I'm OK with taking your patch above. Willy

