From owner-svn-src-head@freebsd.org Fri Mar 20 18:19:13 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 66A1926EFDC; Fri, 20 Mar 2020 18:19:13 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 48kX9C7448z49hw; Fri, 20 Mar 2020 18:19:11 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id 02KIJ2sf012247 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 20 Mar 2020 11:19:02 -0700 (PDT) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id 02KIJ2F9012246; Fri, 20 Mar 2020 11:19:02 -0700 (PDT) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Fri, 20 Mar 2020 11:19:02 -0700 From: Gleb Smirnoff To: Andrew Gallatin 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> References: <202003161403.02GE3Rse024202@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202003161403.02GE3Rse024202@repo.freebsd.org> X-Rspamd-Queue-Id: 48kX9C7448z49hw X-Spamd-Bar: + Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [1.48 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_SPAM_LONG(0.98)[0.981,0]; NEURAL_SPAM_MEDIUM(0.50)[0.498,0]; ASN(0.00)[asn:27348, ipnet:162.251.186.0/24, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Mar 2020 18:19:13 -0000 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