From nobody Tue Jan 16 19:05:21 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TDz3k4tkWz57r00; Tue, 16 Jan 2024 19:05:22 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TDz3k1S18z54nK; Tue, 16 Jan 2024 19:05:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705431922; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Mp7GaTF0dWgbxGSSVvyscG+IJuf/nD6FNRdU79spJn4=; b=cATMYAvG6Vd6WiaJOdMuY+5LvP0uR6vBHSota0wWNWjG+JwfkcZ8mZ2x2Ceu6X6YLIpxpa Bra32t+2YJ+Bt1vPc9ahfGy6/pSlAjpqedseKQE72qTAvX69uWECr+EwWdhyVbpCS5mies s/GGsaBNoFAU3/XDlqwtNolvt5kPzD6+e+20DA0SIVU32xVlMlX75PaItITsXtOQcO0wM6 /t/rv2KBGEm9CJgB+feahOh5H+rFEvzTUoE9DHZqyIqXG8e5kfH7TsVZCXUL+PUrW7+d0j Y2C6ma5gTeorLCnmcauV7dCUac5vv24yZqEsf/+yz/CALT4imf3hC8I4mLpzrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705431922; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Mp7GaTF0dWgbxGSSVvyscG+IJuf/nD6FNRdU79spJn4=; b=R9jJzEv9hvqduFagXRGJLOibH3LFqLW6UoiIj3G4jxhvxekyEhFObJp90j7dXYDawcKHwN eosywrCqEhbZYM98q6VmGaNk2flvNkY0ou3FEkrnyNm2I6Jit1QnkCo5rC82XPAA0ZNfA+ GaaTFDFC5fbj164+MIJzQLl6YbNIaKDLZkNOeRKLFDy2fdZraC5cP9tkmi+irkfD5c9FbC 0avAd/cojZYH2bfjJJHpST1zuD8atvLFXy/Q5o+AvobsM/pHEagobyAS7KrtiMl56ifWxZ /xcTZiL/PHku0m5dINWLeec7Dj9kqvmdGvJmGRJdb41CcAZVCnYh7lyltFzo1g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705431922; a=rsa-sha256; cv=none; b=K9Xj9kmuIgzKdBEtJu9HxrdHb+7+KZO2Qo++rO3XLIl2aFC8NvfgHebyCsTQo97ROzg4c2 Hattx87bVaS1D1SWGDt0ZVfLMELXwbK0/scUHM+j5x+cX5j0xC+EqLOrFTIbGTl+PEeQvT VlGF5c6cYuP4ebqG3ofeeh/dThDjMX2pERBROgn4EYVOysFS8f21lLortl4EMuUWEA/K0U whpwNqCXGpr9LsDoP7OJF6qOYJBoIirxZOXXwFlWI0knn0UAPLVciv5l/4Z6bhtAreyFB2 0LwhQWGuBsCDWOV7lBaH7oN+NPPYVRMrIO2SeaGcZXdcRqRdcXpUEUdXYlsnCA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TDz3k0XfhzsMl; Tue, 16 Jan 2024 19:05:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40GJ5Lga010521; Tue, 16 Jan 2024 19:05:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40GJ5LDw010518; Tue, 16 Jan 2024 19:05:21 GMT (envelope-from git) Date: Tue, 16 Jan 2024 19:05:21 GMT Message-Id: <202401161905.40GJ5LDw010518@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gleb Smirnoff Subject: git: 39000ced1f29 - stable/14 - tcp_hpts: use tcp_pace.cts_last_ran for last ran table List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 39000ced1f2931bdf105b1a2547775f942891428 Auto-Submitted: auto-generated The branch stable/14 has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=39000ced1f2931bdf105b1a2547775f942891428 commit 39000ced1f2931bdf105b1a2547775f942891428 Author: Gleb Smirnoff AuthorDate: 2023-12-19 18:21:56 +0000 Commit: Gleb Smirnoff CommitDate: 2024-01-16 18:47:50 +0000 tcp_hpts: use tcp_pace.cts_last_ran for last ran table Remove the global cts_last_ran and use already existing unused field of struct tcp_hptsi, which seems originally planned to hold this table. This makes it consistent with other malloc-ed tables, like main array of HPTS entities and CPU groups. Reviewed by: tuexen Differential Revision: https://reviews.freebsd.org/D43091 (cherry picked from commit 175d4d69887fb103f0b0385cbbafec0432284ff3) --- sys/netinet/tcp_hpts.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/sys/netinet/tcp_hpts.c b/sys/netinet/tcp_hpts.c index f1b729c249c6..50a30a2cff03 100644 --- a/sys/netinet/tcp_hpts.c +++ b/sys/netinet/tcp_hpts.c @@ -236,7 +236,6 @@ static int tcp_bind_threads = 1; static int tcp_bind_threads = 2; #endif static int tcp_use_irq_cpu = 0; -static uint32_t *cts_last_ran; static int hpts_does_tp_logging = 0; static int32_t tcp_hptsi(struct tcp_hpts_entry *hpts, int from_callout); @@ -1098,7 +1097,7 @@ tcp_hptsi(struct tcp_hpts_entry *hpts, int from_callout) hpts->p_lasttick = hpts->p_curtick; hpts->p_curtick = tcp_gethptstick(&tv); - cts_last_ran[hpts->p_num] = tcp_tv_to_usectick(&tv); + tcp_pace.cts_last_ran[hpts->p_num] = tcp_tv_to_usectick(&tv); orig_exit_slot = hpts->p_cur_slot = tick_to_wheel(hpts->p_curtick); if ((hpts->p_on_queue_cnt == 0) || (hpts->p_lasttick == hpts->p_curtick)) { @@ -1441,7 +1440,7 @@ no_one: goto again; } no_run: - cts_last_ran[hpts->p_num] = tcp_tv_to_usectick(&tv); + tcp_pace.cts_last_ran[hpts->p_num] = tcp_tv_to_usectick(&tv); /* * Set flag to tell that we are done for * any slot input that happens during @@ -1523,8 +1522,8 @@ tcp_choose_hpts_to_run(void) } oldest_idx = -1; for (i = start; i < end; i++) { - if (TSTMP_GT(cts, cts_last_ran[i])) - calc = cts - cts_last_ran[i]; + if (TSTMP_GT(cts, tcp_pace.cts_last_ran[i])) + calc = cts - tcp_pace.cts_last_ran[i]; else calc = 0; if (calc > time_since_ran) { @@ -1830,7 +1829,7 @@ tcp_init_hptsi(void *st) sz = (tcp_pace.rp_num_hptss * sizeof(struct tcp_hpts_entry *)); tcp_pace.rp_ent = malloc(sz, M_TCPHPTS, M_WAITOK | M_ZERO); sz = (sizeof(uint32_t) * tcp_pace.rp_num_hptss); - cts_last_ran = malloc(sz, M_TCPHPTS, M_WAITOK); + tcp_pace.cts_last_ran = malloc(sz, M_TCPHPTS, M_WAITOK); tcp_pace.grp_cnt = 0; if (cpu_top == NULL) { tcp_pace.grp_cnt = 1; @@ -1916,7 +1915,7 @@ tcp_init_hptsi(void *st) SYSCTL_ADD_UINT(&hpts->hpts_ctx, SYSCTL_CHILDREN(hpts->hpts_root), OID_AUTO, "lastran", CTLFLAG_RD, - &cts_last_ran[i], 0, + &tcp_pace.cts_last_ran[i], 0, "The last usec tick that this hpts ran"); SYSCTL_ADD_LONG(&hpts->hpts_ctx, SYSCTL_CHILDREN(hpts->hpts_root), @@ -1937,7 +1936,7 @@ tcp_init_hptsi(void *st) hpts->p_hpts_sleep_time = hpts_sleep_max; hpts->p_num = i; hpts->p_curtick = tcp_gethptstick(&tv); - cts_last_ran[i] = tcp_tv_to_usectick(&tv); + tcp_pace.cts_last_ran[i] = tcp_tv_to_usectick(&tv); hpts->p_prev_slot = hpts->p_cur_slot = tick_to_wheel(hpts->p_curtick); hpts->p_cpu = 0xffff; hpts->p_nxt_slot = hpts_slot(hpts->p_cur_slot, 1);