From owner-svn-src-head@freebsd.org Thu Nov 7 21:30:27 2019 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 C91F317A3C3; Thu, 7 Nov 2019 21:30:27 +0000 (UTC) (envelope-from glebius@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 478Gll4wGlz4Nth; Thu, 7 Nov 2019 21:30:27 +0000 (UTC) (envelope-from glebius@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 8C0E21BFFF; Thu, 7 Nov 2019 21:30:27 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7LURr8096783; Thu, 7 Nov 2019 21:30:27 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7LURuL096782; Thu, 7 Nov 2019 21:30:27 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201911072130.xA7LURuL096782@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 7 Nov 2019 21:30:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354487 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 354487 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: Thu, 07 Nov 2019 21:30:27 -0000 Author: glebius Date: Thu Nov 7 21:30:27 2019 New Revision: 354487 URL: https://svnweb.freebsd.org/changeset/base/354487 Log: In TCP HPTS enter the epoch in tcp_hpts_thread() and assert it in the leaf functions. Modified: head/sys/netinet/tcp_hpts.c Modified: head/sys/netinet/tcp_hpts.c ============================================================================== --- head/sys/netinet/tcp_hpts.c Thu Nov 7 21:29:38 2019 (r354486) +++ head/sys/netinet/tcp_hpts.c Thu Nov 7 21:30:27 2019 (r354487) @@ -1245,12 +1245,10 @@ tcp_input_data(struct tcp_hpts_entry *hpts, struct tim int16_t set_cpu; uint32_t did_prefetch = 0; int dropped; - struct epoch_tracker et; HPTS_MTX_ASSERT(hpts); -#ifndef VIMAGE - INP_INFO_RLOCK_ET(&V_tcbinfo, et); -#endif + NET_EPOCH_ASSERT(); + while ((inp = TAILQ_FIRST(&hpts->p_input)) != NULL) { HPTS_MTX_ASSERT(hpts); hpts_sane_input_remove(hpts, inp, 0); @@ -1266,7 +1264,6 @@ tcp_input_data(struct tcp_hpts_entry *hpts, struct tim INP_WLOCK(inp); #ifdef VIMAGE CURVNET_SET(inp->inp_vnet); - INP_INFO_RLOCK_ET(&V_tcbinfo, et); #endif if ((inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) || (inp->inp_flags2 & INP_FREED)) { @@ -1276,7 +1273,6 @@ out: INP_WUNLOCK(inp); } #ifdef VIMAGE - INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); CURVNET_RESTORE(); #endif mtx_lock(&hpts->p_mtx); @@ -1296,7 +1292,6 @@ out: if (in_pcbrele_wlocked(inp) == 0) INP_WUNLOCK(inp); #ifdef VIMAGE - INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); CURVNET_RESTORE(); #endif mtx_lock(&hpts->p_mtx); @@ -1349,22 +1344,16 @@ out: INP_WUNLOCK(inp); INP_UNLOCK_ASSERT(inp); #ifdef VIMAGE - INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); CURVNET_RESTORE(); #endif mtx_lock(&hpts->p_mtx); hpts->p_inp = NULL; } -#ifndef VIMAGE - INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); - INP_INFO_UNLOCK_ASSERT(&V_tcbinfo); -#endif } static void tcp_hptsi(struct tcp_hpts_entry *hpts) { - struct epoch_tracker et; struct tcpcb *tp; struct inpcb *inp = NULL, *ninp; struct timeval tv; @@ -1378,6 +1367,8 @@ tcp_hptsi(struct tcp_hpts_entry *hpts) int16_t set_cpu; HPTS_MTX_ASSERT(hpts); + NET_EPOCH_ASSERT(); + /* record previous info for any logging */ hpts->saved_lasttick = hpts->p_lasttick; hpts->saved_curtick = hpts->p_curtick; @@ -1469,9 +1460,6 @@ again: goto no_one; } HPTS_MTX_ASSERT(hpts); -#ifndef VIMAGE - INP_INFO_RLOCK_ET(&V_tcbinfo, et); -#endif for (i = 0; i < ticks_to_run; i++) { /* * Calculate our delay, if there are no extra ticks there @@ -1586,7 +1574,6 @@ again: } #ifdef VIMAGE CURVNET_SET(inp->inp_vnet); - INP_INFO_RLOCK_ET(&V_tcbinfo, et); #endif /* Lets do any logging that we might want to */ if (hpts_does_tp_logging && (tp->t_logstate != TCP_LOG_STATE_OFF)) { @@ -1658,7 +1645,6 @@ again: INP_WUNLOCK(inp); skip_pacing: #ifdef VIMAGE - INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); CURVNET_RESTORE(); #endif INP_UNLOCK_ASSERT(inp); @@ -1678,9 +1664,6 @@ again: hpts->p_runningtick = 0; } } -#ifndef VIMAGE - INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); -#endif no_one: HPTS_MTX_ASSERT(hpts); hpts->p_delayed_by = 0; @@ -1820,6 +1803,7 @@ static void tcp_hpts_thread(void *ctx) { struct tcp_hpts_entry *hpts; + struct epoch_tracker et; struct timeval tv; sbintime_t sb; @@ -1839,7 +1823,9 @@ tcp_hpts_thread(void *ctx) } hpts->p_hpts_wake_scheduled = 0; hpts->p_hpts_active = 1; + NET_EPOCH_ENTER(et); tcp_hptsi(hpts); + NET_EPOCH_EXIT(et); HPTS_MTX_ASSERT(hpts); tv.tv_sec = 0; tv.tv_usec = hpts->p_hpts_sleep_time * HPTS_TICKS_PER_USEC;