From owner-svn-src-all@freebsd.org Mon Feb 3 23:50:30 2020 Return-Path: Delivered-To: svn-src-all@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 1D6FB2335D0; Mon, 3 Feb 2020 23:50:30 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BPhj6vnkz4Kj6; Mon, 3 Feb 2020 23:50:29 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E42A18ADC; Mon, 3 Feb 2020 23:50:29 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 013NoTHv029387; Mon, 3 Feb 2020 23:50:29 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 013NoTJK029385; Mon, 3 Feb 2020 23:50:29 GMT (envelope-from np@FreeBSD.org) Message-Id: <202002032350.013NoTJK029385@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 3 Feb 2020 23:50:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357479 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 357479 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Feb 2020 23:50:30 -0000 Author: np Date: Mon Feb 3 23:50:29 2020 New Revision: 357479 URL: https://svnweb.freebsd.org/changeset/base/357479 Log: cxgbe(4): Avoid ext_arg2 in rxb_free. ext_arg2 is the only item in the third cacheline in an mbuf and could be cold by the time rxb_free runs. Put the information needed by rxb_free in the same line as the refcount, which is very likely to be hot given that rxb_free runs when the refcount is decremented and reaches 0. MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Mon Feb 3 23:40:27 2020 (r357478) +++ head/sys/dev/cxgbe/adapter.h Mon Feb 3 23:50:29 2020 (r357479) @@ -326,6 +326,8 @@ struct cluster_layout { }; struct cluster_metadata { + uma_zone_t zone; + caddr_t cl; u_int refcount; }; Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Mon Feb 3 23:40:27 2020 (r357478) +++ head/sys/dev/cxgbe/t4_sge.c Mon Feb 3 23:50:29 2020 (r357479) @@ -1804,10 +1804,9 @@ cl_metadata(struct adapter *sc, struct sge_fl *fl, str static void rxb_free(struct mbuf *m) { - uma_zone_t zone = m->m_ext.ext_arg1; - void *cl = m->m_ext.ext_arg2; + struct cluster_metadata *clm = m->m_ext.ext_arg1; - uma_zfree(zone, cl); + uma_zfree(clm->zone, clm->cl); counter_u64_add(extfree_rels, 1); } @@ -1880,10 +1879,12 @@ get_scatter_segment(struct adapter *sc, struct sge_fl fl->mbuf_inlined++; if (sd->nmbuf++ == 0) { clm->refcount = 1; + clm->zone = swz->zone; + clm->cl = sd->cl; counter_u64_add(extfree_refs, 1); } - m_extaddref(m, payload, blen, &clm->refcount, rxb_free, - swz->zone, sd->cl); + m_extaddref(m, payload, blen, &clm->refcount, rxb_free, clm, + NULL); } else { /* @@ -1899,10 +1900,12 @@ get_scatter_segment(struct adapter *sc, struct sge_fl if (clm != NULL) { if (sd->nmbuf++ == 0) { clm->refcount = 1; + clm->zone = swz->zone; + clm->cl = sd->cl; counter_u64_add(extfree_refs, 1); } m_extaddref(m, payload, blen, &clm->refcount, - rxb_free, swz->zone, sd->cl); + rxb_free, clm, NULL); } else { m_cljset(m, sd->cl, swz->type); sd->cl = NULL; /* consumed, not a recycle candidate */