From nobody Thu Dec 18 21:30:48 2025 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 4dXP3d6Bryz6Lq24 for ; Thu, 18 Dec 2025 21:30:53 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXP3X5Rl8z3WSL for ; Thu, 18 Dec 2025 21:30:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766093448; 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=5Alu955SWx4kHxW+w4UC1RL60m3lk72mM6ZxilKgtK4=; b=xe2rKj+Nyl0+klOca1BFG+AUIIP5P5ziOxnnQVmm2goP3vdgaEddrtgC5EAD5M4qfTnRWS XT484tDSZjXUB5Ny5odeYtP9sha9N9cmirk5TVWN32Zmck+DYGqpL+EFzfwuTgMZmKVcqe VWBmCoc4gdOKB0Gru1jOV4VFpQz+CnzPXni1OPztewReU/dQXWuI6hLSZbKpQIDjgtpvZg dO82IW8/wc6LpGmD/7Y63yFdqzXUZ6QETO/JMB7yso4hjAO4jqXczZKLZJbBFK3Xn3yAbz gp9V+umRs1x2lqf+WPoXp9xqiEQcGNe24BXj6jMKXcuTmhIbBZAjzujNtC21Ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766093448; 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=5Alu955SWx4kHxW+w4UC1RL60m3lk72mM6ZxilKgtK4=; b=W3xrCaUVvMCty/OQBeOZ4/pYdaCP8Gy/NS19qnoSDzQSHTJf2pl+jFIHWfum8DvJkkTvHH kzVvjUKVEppuetFLSKTsDtdmBUrAYrLS7T+mEncUW5PGbmWQjNYViT3BFTw8Fc+3JEDbeN 09awUUKsoN/+t57XGhtqofXvYowCmkbH93a5XyfWa3nL/fS9sagP+XlJqMQ6kPQBjM9Y30 Ly2qYrOu4Q3Xugv9rXIE2ncDdIM9HlJH5WFLR05lTQhc/358bmRDbekGh5Xpwh1roBEQ8l fqnEUIQc/USf3l8Pq28ilCn/RVO8We1ZEunDVSNN1J5JP3EkDVr63X6Uv3ihbg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766093448; a=rsa-sha256; cv=none; b=B/hlJC37L/OtHD+Iw2gEKShW50nAaP0vnMc1U183dJlTYAZ4Egp+qbnubxYFHGff4I92Lk 8xIRGF2nUz+d/E04jiXlqpmZab8bH1vRXGell0s4x/V1ayeD5k4y5uOdscahTALqbbIMkK 8O4Zx4thGbqA/4beh8yWYj/oxfQvUocbbEGYyXXlt+4hiE7MDWdktJ4b9+oYl8snKPj6nS nKHe5xHv0jq+BFnQyhdVIgqGT4Vm586cnRURlM8kNG1+WP5+IhGuB1+IIMgQSOM58Xey0S V5M3XtcFFaUoXLbk3SdFDVaUH1xdFohnQ41Lc41JkYCDKB8iq+1ElzFFkKzwTg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dXP3X52dGzvnQ for ; Thu, 18 Dec 2025 21:30:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 42009 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 18 Dec 2025 21:30:48 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: 55ce12672b94 - main - kern: racct: Remove code unused since %cpu resource computation revamp 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: olce X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 55ce12672b948c002431851af54843bfc7f50d6f Auto-Submitted: auto-generated Date: Thu, 18 Dec 2025 21:30:48 +0000 Message-Id: <69447288.42009.509fe959@gitrepo.freebsd.org> The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=55ce12672b948c002431851af54843bfc7f50d6f commit 55ce12672b948c002431851af54843bfc7f50d6f Author: Olivier Certner AuthorDate: 2025-12-18 14:05:11 +0000 Commit: Olivier Certner CommitDate: 2025-12-18 21:30:18 +0000 kern: racct: Remove code unused since %cpu resource computation revamp Reviewed by: emaste, markj Fixes: c72188d85a79 ("racct: Improve handling of the pcpu resource") MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D54284 --- sys/kern/kern_racct.c | 133 -------------------------------------------------- 1 file changed, 133 deletions(-) diff --git a/sys/kern/kern_racct.c b/sys/kern/kern_racct.c index d1324935bdc3..2e243db04607 100644 --- a/sys/kern/kern_racct.c +++ b/sys/kern/kern_racct.c @@ -78,14 +78,6 @@ SYSCTL_BOOL(_kern_racct, OID_AUTO, enable, CTLFLAG_RDTUN, &racct_enable, SYSCTL_UINT(_kern_racct, OID_AUTO, pcpu_threshold, CTLFLAG_RW, &pcpu_threshold, 0, "Processes with higher %cpu usage than this value can be throttled."); -/* - * How many seconds it takes to use the scheduler %cpu calculations. When a - * process starts, we compute its %cpu usage by dividing its runtime by the - * process wall clock time. After RACCT_PCPU_SECS pass, we use the value - * provided by the scheduler. - */ -#define RACCT_PCPU_SECS 3 - struct mtx racct_lock; MTX_SYSINIT(racct_lock, &racct_lock, "racct lock", MTX_DEF); @@ -190,131 +182,6 @@ int racct_types[] = { static const fixpt_t RACCT_DECAY_FACTOR = 0.3 * FSCALE; -#ifdef SCHED_4BSD -/* - * Contains intermediate values for %cpu calculations to avoid using floating - * point in the kernel. - * ccpu_exp[k] = FSCALE * (ccpu/FSCALE)^k = FSCALE * exp(-k/20) - * It is needed only for the 4BSD scheduler, because in ULE, the ccpu equals to - * zero so the calculations are more straightforward. - */ -fixpt_t ccpu_exp[] = { - [0] = FSCALE * 1, - [1] = FSCALE * 0.95122942450071400909, - [2] = FSCALE * 0.90483741803595957316, - [3] = FSCALE * 0.86070797642505780722, - [4] = FSCALE * 0.81873075307798185866, - [5] = FSCALE * 0.77880078307140486824, - [6] = FSCALE * 0.74081822068171786606, - [7] = FSCALE * 0.70468808971871343435, - [8] = FSCALE * 0.67032004603563930074, - [9] = FSCALE * 0.63762815162177329314, - [10] = FSCALE * 0.60653065971263342360, - [11] = FSCALE * 0.57694981038048669531, - [12] = FSCALE * 0.54881163609402643262, - [13] = FSCALE * 0.52204577676101604789, - [14] = FSCALE * 0.49658530379140951470, - [15] = FSCALE * 0.47236655274101470713, - [16] = FSCALE * 0.44932896411722159143, - [17] = FSCALE * 0.42741493194872666992, - [18] = FSCALE * 0.40656965974059911188, - [19] = FSCALE * 0.38674102345450120691, - [20] = FSCALE * 0.36787944117144232159, - [21] = FSCALE * 0.34993774911115535467, - [22] = FSCALE * 0.33287108369807955328, - [23] = FSCALE * 0.31663676937905321821, - [24] = FSCALE * 0.30119421191220209664, - [25] = FSCALE * 0.28650479686019010032, - [26] = FSCALE * 0.27253179303401260312, - [27] = FSCALE * 0.25924026064589150757, - [28] = FSCALE * 0.24659696394160647693, - [29] = FSCALE * 0.23457028809379765313, - [30] = FSCALE * 0.22313016014842982893, - [31] = FSCALE * 0.21224797382674305771, - [32] = FSCALE * 0.20189651799465540848, - [33] = FSCALE * 0.19204990862075411423, - [34] = FSCALE * 0.18268352405273465022, - [35] = FSCALE * 0.17377394345044512668, - [36] = FSCALE * 0.16529888822158653829, - [37] = FSCALE * 0.15723716631362761621, - [38] = FSCALE * 0.14956861922263505264, - [39] = FSCALE * 0.14227407158651357185, - [40] = FSCALE * 0.13533528323661269189, - [41] = FSCALE * 0.12873490358780421886, - [42] = FSCALE * 0.12245642825298191021, - [43] = FSCALE * 0.11648415777349695786, - [44] = FSCALE * 0.11080315836233388333, - [45] = FSCALE * 0.10539922456186433678, - [46] = FSCALE * 0.10025884372280373372, - [47] = FSCALE * 0.09536916221554961888, - [48] = FSCALE * 0.09071795328941250337, - [49] = FSCALE * 0.08629358649937051097, - [50] = FSCALE * 0.08208499862389879516, - [51] = FSCALE * 0.07808166600115315231, - [52] = FSCALE * 0.07427357821433388042, - [53] = FSCALE * 0.07065121306042958674, - [54] = FSCALE * 0.06720551273974976512, - [55] = FSCALE * 0.06392786120670757270, - [56] = FSCALE * 0.06081006262521796499, - [57] = FSCALE * 0.05784432087483846296, - [58] = FSCALE * 0.05502322005640722902, - [59] = FSCALE * 0.05233970594843239308, - [60] = FSCALE * 0.04978706836786394297, - [61] = FSCALE * 0.04735892439114092119, - [62] = FSCALE * 0.04504920239355780606, - [63] = FSCALE * 0.04285212686704017991, - [64] = FSCALE * 0.04076220397836621516, - [65] = FSCALE * 0.03877420783172200988, - [66] = FSCALE * 0.03688316740124000544, - [67] = FSCALE * 0.03508435410084502588, - [68] = FSCALE * 0.03337326996032607948, - [69] = FSCALE * 0.03174563637806794323, - [70] = FSCALE * 0.03019738342231850073, - [71] = FSCALE * 0.02872463965423942912, - [72] = FSCALE * 0.02732372244729256080, - [73] = FSCALE * 0.02599112877875534358, - [74] = FSCALE * 0.02472352647033939120, - [75] = FSCALE * 0.02351774585600910823, - [76] = FSCALE * 0.02237077185616559577, - [77] = FSCALE * 0.02127973643837716938, - [78] = FSCALE * 0.02024191144580438847, - [79] = FSCALE * 0.01925470177538692429, - [80] = FSCALE * 0.01831563888873418029, - [81] = FSCALE * 0.01742237463949351138, - [82] = FSCALE * 0.01657267540176124754, - [83] = FSCALE * 0.01576441648485449082, - [84] = FSCALE * 0.01499557682047770621, - [85] = FSCALE * 0.01426423390899925527, - [86] = FSCALE * 0.01356855901220093175, - [87] = FSCALE * 0.01290681258047986886, - [88] = FSCALE * 0.01227733990306844117, - [89] = FSCALE * 0.01167856697039544521, - [90] = FSCALE * 0.01110899653824230649, - [91] = FSCALE * 0.01056720438385265337, - [92] = FSCALE * 0.01005183574463358164, - [93] = FSCALE * 0.00956160193054350793, - [94] = FSCALE * 0.00909527710169581709, - [95] = FSCALE * 0.00865169520312063417, - [96] = FSCALE * 0.00822974704902002884, - [97] = FSCALE * 0.00782837754922577143, - [98] = FSCALE * 0.00744658307092434051, - [99] = FSCALE * 0.00708340892905212004, - [100] = FSCALE * 0.00673794699908546709, - [101] = FSCALE * 0.00640933344625638184, - [102] = FSCALE * 0.00609674656551563610, - [103] = FSCALE * 0.00579940472684214321, - [104] = FSCALE * 0.00551656442076077241, - [105] = FSCALE * 0.00524751839918138427, - [106] = FSCALE * 0.00499159390691021621, - [107] = FSCALE * 0.00474815099941147558, - [108] = FSCALE * 0.00451658094261266798, - [109] = FSCALE * 0.00429630469075234057, - [110] = FSCALE * 0.00408677143846406699, -}; -#endif - -#define CCPU_EXP_MAX 110 - static void racct_add_racct(struct racct *dest, const struct racct *src) {