From nobody Mon Jan 24 02:36:05 2022 X-Original-To: dev-commits-src-branches@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 D35EA1982672; Mon, 24 Jan 2022 02:36:05 +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 4JhvHT5f2Gz3mWp; Mon, 24 Jan 2022 02:36:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642991765; 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=8LOOJtGV0cMvUx1hVMra/hxxtm5KF3B+JiLbpWjOLQo=; b=cczt0xMMuhuUEghrqJQIfaLEAmet9QFC9VEndL6Cv0SiTxzUvlbx4WPvTXUeIEG67X3dNo WMSC4lVqH3B051U4wfzIzuGReQqzvtjZIo1VuSPGXc1ixHQkuwxsunKWgCjLTN584+ikHe 4BGoi5MrzpjUplI+MvzPw4k+S76InVpaY0LwAsUGEPyAKoMGaHD1kDPg9W2e5BqBWNsNOP 2trS4LvTmFOOun4RIleOiTY9lf9I7JM+umVD6Q79bvwsoJc1ciuXLiXokiRqntZkgRPPnH gKMA9Z8REVKubiioxYgG1B4DaPREuC15Hf3glqvnDQwSdlVI6iTYC6VPiX4tqQ== 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 A1850609B; Mon, 24 Jan 2022 02:36:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 20O2a52j098804; Mon, 24 Jan 2022 02:36:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20O2a5TJ098803; Mon, 24 Jan 2022 02:36:05 GMT (envelope-from git) Date: Mon, 24 Jan 2022 02:36:05 GMT Message-Id: <202201240236.20O2a5TJ098803@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: 70201cc45dc7 - stable/13 - Reduce minimum idle hardclock rate from 2Hz to 1Hz. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 70201cc45dc7c3466a852e6b93e02dfd13fc8f59 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642991765; 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=8LOOJtGV0cMvUx1hVMra/hxxtm5KF3B+JiLbpWjOLQo=; b=aPfYhXQo5Mlh1Q+7mpbYBlJR6V5NaxitkR1DsbH5qxn6/JUwtHN7XrTB8+veS7weWa9Za1 n+lknxL6vxI+1ue8OtyPFOnyhIwML6f21gP4TWKi4CMinjUZcwWG/lmB8S2u+HCyNsu5kn 1WUQfjkIQ/SUwkomWE5SKv13zriZksxk9QQ9E0vUgWhG2svDQv9t226+M6jtPUWKiZyDU7 pmQreVmLDNUDC5lU1H8MRnDvu5anwalHggYMbXfnHJzybmiZJgresXeUjgnfnk6nfiXdrL eJgJt2qDUHy1LBXSOoDyG9dSxCw4r63wTvsxtTjRQ/MinDzgOp0/ZCswXoxunA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1642991765; a=rsa-sha256; cv=none; b=mPHiqzUagr95UEkWM1Y4NmwwKaEXLYe3sqULZSw7gEewwU4GQDCbwjlbTSnxmfQdvuR+la hzezDV8n15G728cXQrfZ7YP2I6qQ4989l+VfYhiWB4+AbE4PaqXIyzz8/JiZADdPHzaf2y Shp9ymj0zJrtZ/Mcx1A0tgoRiC56WlaR9m92/vN4Ql0MXdxgleb9Rq1a7YNjBLgVssL+0Q 2GjRhgmQNErQhma8gcPRmexvPvMpgvVTxYoFLcBgEE/w8DJgLLTMnwmsggqDUWK9SD7utd tvqVKcyvUcnGmZ/QXU/FKmBLJ/mINDfdeC/xs/d6Kr9aQ5R4dYv/az8V4qT81g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=70201cc45dc7c3466a852e6b93e02dfd13fc8f59 commit 70201cc45dc7c3466a852e6b93e02dfd13fc8f59 Author: Alexander Motin AuthorDate: 2022-01-10 00:17:43 +0000 Commit: Alexander Motin CommitDate: 2022-01-24 02:35:58 +0000 Reduce minimum idle hardclock rate from 2Hz to 1Hz. On idle 80-thread system it allows to improve package-level idle state residency and so power consumption by several percent. MFC after: 2 weeks (cherry picked from commit cb1f5d11366dc9b803f2755d83fe02599830882a) --- sys/kern/kern_clocksource.c | 5 +++-- sys/kern/kern_timeout.c | 5 ++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/kern/kern_clocksource.c b/sys/kern/kern_clocksource.c index dfc9081ba9f6..48e06ee082fc 100644 --- a/sys/kern/kern_clocksource.c +++ b/sys/kern/kern_clocksource.c @@ -239,13 +239,14 @@ getnextcpuevent(int idle) /* Handle hardclock() events, skipping some if CPU is idle. */ event = state->nexthard; if (idle) { - hardfreq = (u_int)hz / 2; - if (tc_min_ticktock_freq > 2 + if (tc_min_ticktock_freq > 1 #ifdef SMP && curcpu == CPU_FIRST() #endif ) hardfreq = hz / tc_min_ticktock_freq; + else + hardfreq = hz; if (hardfreq > 1) event += tick_sbt * (hardfreq - 1); } diff --git a/sys/kern/kern_timeout.c b/sys/kern/kern_timeout.c index 992a093d30ab..2e98c1033ee3 100644 --- a/sys/kern/kern_timeout.c +++ b/sys/kern/kern_timeout.c @@ -418,8 +418,7 @@ callout_process(sbintime_t now) struct callout *tmp, *tmpn; struct callout_cpu *cc; struct callout_list *sc; - sbintime_t first, last, max, tmp_max; - uint32_t lookahead; + sbintime_t first, last, lookahead, max, tmp_max; u_int firstb, lastb, nowb; #ifdef CALLOUT_PROFILING int depth_dir = 0, mpcalls_dir = 0, lockcalls_dir = 0; @@ -439,7 +438,7 @@ callout_process(sbintime_t now) else if (nowb - firstb == 1) lookahead = (SBT_1S / 8); else - lookahead = (SBT_1S / 2); + lookahead = SBT_1S; first = last = now; first += (lookahead / 2); last += lookahead;