git: c4a4b2633d97 - main - allocate inpcb aligned to cachelines

From: Andrew Gallatin <gallatin_at_FreeBSD.org>
Date: Wed, 14 Dec 2022 19:43:48 UTC
The branch main has been updated by gallatin:

URL: https://cgit.FreeBSD.org/src/commit/?id=c4a4b2633d975bd0813afca6b8e23ead29d80e82

commit c4a4b2633d975bd0813afca6b8e23ead29d80e82
Author:     Andrew Gallatin <gallatin@FreeBSD.org>
AuthorDate: 2022-12-14 19:19:35 +0000
Commit:     Andrew Gallatin <gallatin@FreeBSD.org>
CommitDate: 2022-12-14 19:19:35 +0000

    allocate inpcb aligned to cachelines
    
    The inpcb struct is one of the most heavily utilized in the kernel
    on a busy network server.  By aligning it to a cacheline
    boundary, we can ensure that closely related fields in the inpcb
    and tcbcb can be predictably located on the same cacheline.  rrs
    has already done a lot of this work to put related fields on the
    same line for the tcbcb.
    
    In combination with a forthcoming patch to align the start of the tcpcb,
    we see a roughly 3% reduction in CPU use on a busy web server serving
    traffic over roughly 50,000 TCP connections.
    
    Reviewed by: glebius, markj, tuexen
    Differential Revision: https://reviews.freebsd.org/D37687
    Sponsored by: Netflix
---
 sys/netinet/in_pcb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c
index 3a83682b711f..e7f425f8593a 100644
--- a/sys/netinet/in_pcb.c
+++ b/sys/netinet/in_pcb.c
@@ -552,7 +552,7 @@ in_pcbstorage_init(void *arg)
 
 	pcbstor->ips_zone = uma_zcreate(pcbstor->ips_zone_name,
 	    pcbstor->ips_size, NULL, inpcb_dtor, pcbstor->ips_pcbinit,
-	    inpcb_fini, UMA_ALIGN_PTR, UMA_ZONE_SMR);
+	    inpcb_fini, UMA_ALIGN_CACHE, UMA_ZONE_SMR);
 	pcbstor->ips_portzone = uma_zcreate(pcbstor->ips_portzone_name,
 	    sizeof(struct inpcbport), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0);
 	uma_zone_set_smr(pcbstor->ips_portzone,