From nobody Wed Dec 04 20:24:59 2024 X-Original-To: dev-commits-src-main@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 4Y3TXX2BRZz5g8SC; Wed, 04 Dec 2024 20:25:00 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Y3TXX1MKzz4Dt3; Wed, 4 Dec 2024 20:25:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733343900; 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=6hznm8XfL2tKySx/FpMLz14cvZ2kvvKmjhO9nJlGLKc=; b=cQty9ua0zYGRTNWzFwFv6wGJwo62fdr0tfFyqOCLyXm3IJRCFWXzfFZtE7hGhaS80fSXSz YCOQPVLFjNA8K6KsInoVP75gRuII599srZrY60EFDybYvCSlZGBpWL4RXK29a1d/4/1COT 7oy7+o96MAAPjyvAMDADO5wFHO3jvCl43dM4+jeEHK+LWddfoXpk1qOf5C+znTYandGad+ NMdeCYpS7C3Ve1zUaJZIYqd2x013dmfdbvwotipqax6MJ0s8DBChSSogDuqcd99FieEc/y j15f0cHHPdsYMqlAJnidhD4Y5bWkZR0g5xrM7N+3n29NfI9VKwEcBU+NSlTdsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733343900; 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=6hznm8XfL2tKySx/FpMLz14cvZ2kvvKmjhO9nJlGLKc=; b=HMHXnvGtu2FeBCVQWb7EQZ+nvq1NM1lWghX8T1JcrZUr1TqkWjrEKIFMxrpdfw42sY3J0E CPO1JMfejfRJbCBDtOWTMLYjHRVr3xkZ0MHmrPco61Srbi605UW4G6lVoJdMXxPSWNqAgd WbKTpGjPo2XH2RVhjl0SnV9utpxPr71dqb88DYLb3++7ucDK2G0XxdLcGxsysszdAphVzI /6f+oArzXaRKIciiEwKfpujZycKnSqv/ZB7DcPUuxkvOQQzOpt/RHTFHOMFvvCqyyxU74I uSoiCZBoRDuVPd5BtYsDCLrDOVfgwVYzZ7K4ZTfvFu/oxyOg9mKPRfOcQRicdw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1733343900; a=rsa-sha256; cv=none; b=DSNmrz6+KqXDK7tOSmpIyD40q4JXfnDTuo7wzgVL9le0RplGuGjGuhCU8DXQ3shOYJacaq LmF3csftHHoYmNv5IxOLjDeNZ6k/L+48FRwrjpGq8RrLPtsQu06P+FD7UQ4uj5G0e9Qyhc XCQvLfRAnV9KpirV5EMJPEuk1EY/iViFysMe4HMe7WjfIK33Tkrix6RVgQYoKyaub5BN40 W9y29ZW3jukxQMDBcKPd4Kmors4/idEBQ4cnKPxFlEXppgWZZHHAMNf6KwaqxAXC0pLcHE Y4YKlblAGKkST13sR1/ompBZL5ifHBFQiy/9hdW8L+vpZn1GMW1s9t3YoSTsiQ== 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 4Y3TXW4Vd5zMws; Wed, 4 Dec 2024 20:24:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4B4KOxUq083528; Wed, 4 Dec 2024 20:24:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4B4KOxu0083525; Wed, 4 Dec 2024 20:24:59 GMT (envelope-from git) Date: Wed, 4 Dec 2024 20:24:59 GMT Message-Id: <202412042024.4B4KOxu0083525@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 63446fd35421 - main - tcp_hpts: use boolean to tell is it callout or userret context List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 63446fd354212f03cdc2a12314fc57e6225c2351 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=63446fd354212f03cdc2a12314fc57e6225c2351 commit 63446fd354212f03cdc2a12314fc57e6225c2351 Author: Gleb Smirnoff AuthorDate: 2024-12-04 20:14:44 +0000 Commit: Gleb Smirnoff CommitDate: 2024-12-04 20:14:44 +0000 tcp_hpts: use boolean to tell is it callout or userret context No functional change. --- sys/netinet/tcp_hpts.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/sys/netinet/tcp_hpts.c b/sys/netinet/tcp_hpts.c index 85341cab0750..7d897d30392c 100644 --- a/sys/netinet/tcp_hpts.c +++ b/sys/netinet/tcp_hpts.c @@ -239,7 +239,7 @@ static int tcp_bind_threads = 2; static int tcp_use_irq_cpu = 0; static int hpts_does_tp_logging = 0; -static int32_t tcp_hptsi(struct tcp_hpts_entry *hpts, int from_callout); +static int32_t tcp_hptsi(struct tcp_hpts_entry *hpts, bool from_callout); static void tcp_hpts_thread(void *ctx); int32_t tcp_min_hptsi_time = DEFAULT_MIN_SLEEP; @@ -430,7 +430,7 @@ hpts_random_cpu(void) static void tcp_hpts_log(struct tcp_hpts_entry *hpts, struct tcpcb *tp, struct timeval *tv, - int slots_to_run, int idx, int from_callout) + int slots_to_run, int idx, bool from_callout) { union tcp_log_stackspecific log; /* @@ -1075,7 +1075,7 @@ tcp_hpts_set_max_sleep(struct tcp_hpts_entry *hpts, int wrap_loop_cnt) } static int32_t -tcp_hptsi(struct tcp_hpts_entry *hpts, int from_callout) +tcp_hptsi(struct tcp_hpts_entry *hpts, bool from_callout) { struct tcpcb *tp; struct timeval tv; @@ -1350,7 +1350,8 @@ again: CURVNET_SET(inp->inp_vnet); /* Lets do any logging that we might want to */ if (hpts_does_tp_logging && tcp_bblogging_on(tp)) { - tcp_hpts_log(hpts, tp, &tv, slots_to_run, i, from_callout); + tcp_hpts_log(hpts, tp, &tv, slots_to_run, i, + from_callout); } if (tp->t_fb_ptr != NULL) { @@ -1414,7 +1415,7 @@ no_one: */ hpts->p_prev_slot = hpts->p_cur_slot; hpts->p_lasttick = hpts->p_curtick; - if ((from_callout == 0) || (loop_cnt > max_pacer_loops)) { + if (!from_callout || (loop_cnt > max_pacer_loops)) { /* * Something is serious slow we have * looped through processing the wheel @@ -1462,11 +1463,11 @@ no_run: * multiple times so the slots may not align either. */ KASSERT(((hpts->p_prev_slot == hpts->p_cur_slot) || - (wrap_loop_cnt >= 2) || (from_callout == 0)), + (wrap_loop_cnt >= 2) || !from_callout), ("H:%p p_prev_slot:%u not equal to p_cur_slot:%u", hpts, hpts->p_prev_slot, hpts->p_cur_slot)); KASSERT(((hpts->p_lasttick == hpts->p_curtick) - || (wrap_loop_cnt >= 2) || (from_callout == 0)), + || (wrap_loop_cnt >= 2) || !from_callout), ("H:%p p_lasttick:%u not equal to p_curtick:%u", hpts, hpts->p_lasttick, hpts->p_curtick)); if (from_callout && (hpts->p_lasttick != hpts->p_curtick)) { @@ -1476,7 +1477,7 @@ no_run: goto again; } - if (from_callout){ + if (from_callout) { tcp_hpts_set_max_sleep(hpts, wrap_loop_cnt); } if (seen_endpoint) @@ -1566,7 +1567,7 @@ __tcp_run_hpts(void) hpts->syscall_cnt++; counter_u64_add(hpts_direct_call, 1); hpts->p_hpts_active = 1; - ticks_ran = tcp_hptsi(hpts, 0); + ticks_ran = tcp_hptsi(hpts, false); /* We may want to adjust the sleep values here */ if (hpts->p_on_queue_cnt >= conn_cnt_thresh) { if (ticks_ran > ticks_indicate_less_sleep) { @@ -1682,7 +1683,7 @@ tcp_hpts_thread(void *ctx) } hpts->sleeping = 0; hpts->p_hpts_active = 1; - ticks_ran = tcp_hptsi(hpts, 1); + ticks_ran = tcp_hptsi(hpts, true); tv.tv_sec = 0; tv.tv_usec = hpts->p_hpts_sleep_time * HPTS_TICKS_PER_SLOT; if ((hpts->p_on_queue_cnt > conn_cnt_thresh) && (hpts->hit_callout_thresh == 0)) {