Date: Fri, 20 Mar 2020 11:19:02 -0700 From: Gleb Smirnoff <glebius@freebsd.org> To: Andrew Gallatin <gallatin@freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r359016 - head/sys/netinet Message-ID: <20200320181902.GB1292@FreeBSD.org> In-Reply-To: <202003161403.02GE3Rse024202@repo.freebsd.org> References: <202003161403.02GE3Rse024202@repo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Andrew, On Mon, Mar 16, 2020 at 02:03:27PM +0000, Andrew Gallatin wrote: A> Log: A> Avoid a cache miss accessing an mbuf ext_pgs pointer when doing SW kTLS. A> A> For a Netflix 90Gb/s 100% TLS software kTLS workload, this reduces A> the CPI of tcp_m_copym() from ~3.5 to ~2.5 as reported by vtune. A> A> Reviewed by: jtl, rrs A> Sponsored by: Netflix A> Differential Revision: https://reviews.freebsd.org/D23998 A> A> Modified: A> head/sys/netinet/tcp_output.c A> A> Modified: head/sys/netinet/tcp_output.c A> ============================================================================== A> --- head/sys/netinet/tcp_output.c Mon Mar 16 13:53:29 2020 (r359015) A> +++ head/sys/netinet/tcp_output.c Mon Mar 16 14:03:27 2020 (r359016) A> @@ -1907,7 +1907,7 @@ tcp_m_copym(struct mbuf *m, int32_t off0, int32_t *ple A> top = NULL; A> pkthdrlen = NULL; A> #ifdef KERN_TLS A> - if (m->m_flags & M_NOMAP) A> + if (hw_tls && (m->m_flags & M_NOMAP)) A> tls = m->m_ext.ext_pgs->tls; A> else A> tls = NULL; IMHO, such changes must always be accompanied by a comment. Otherwise, I can easily imagine someone in couple of years "optimizing" it back with commit message "Remove extraneous check. m->m_ext.ext_pgs->tls is NULL when tls is off" -- Gleb Smirnoff
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20200320181902.GB1292>