From owner-dev-commits-src-main@freebsd.org Mon Aug 2 14:55:34 2021 Return-Path: Delivered-To: dev-commits-src-main@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 4E3D1675944; Mon, 2 Aug 2021 14:55:34 +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 4GdgzV182Xz4Y0q; Mon, 2 Aug 2021 14:55:34 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 0F4C521834; Mon, 2 Aug 2021 14:55:34 +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 172EtXTh057285; Mon, 2 Aug 2021 14:55:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 172EtX31057284; Mon, 2 Aug 2021 14:55:33 GMT (envelope-from git) Date: Mon, 2 Aug 2021 14:55:33 GMT Message-Id: <202108021455.172EtX31057284@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Motin Subject: git: ca34553b6f63 - main - sched_ule(4): Pre-seed sched_random(). 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/main X-Git-Reftype: branch X-Git-Commit: ca34553b6f631ec4ec5ae9f3825e3196e172c35d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Aug 2021 14:55:34 -0000 The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=ca34553b6f631ec4ec5ae9f3825e3196e172c35d commit ca34553b6f631ec4ec5ae9f3825e3196e172c35d Author: Alexander Motin AuthorDate: 2021-08-02 14:50:34 +0000 Commit: Alexander Motin CommitDate: 2021-08-02 14:55:28 +0000 sched_ule(4): Pre-seed sched_random(). I don't think it changes anything, but why not. While there, make cpu_search_highest() use all 8 lower load bits for noise, since it does not use cs_prefer and the code is not shared with cpu_search_lowest() any more. MFC after: 1 month --- sys/kern/sched_ule.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c index 1bdcfb1f793d..9bcc2a64e2b8 100644 --- a/sys/kern/sched_ule.c +++ b/sys/kern/sched_ule.c @@ -739,7 +739,7 @@ cpu_search_highest(const struct cpu_group *cg, const struct cpu_search *s, if (l < s->cs_limit || !tdq->tdq_transferable || !CPU_ISSET(c, s->cs_mask)) continue; - load -= sched_random() % 128; + load -= sched_random() % 256; if (load > bload) { bload = load; r->cs_cpu = c; @@ -1416,6 +1416,7 @@ sched_setup_smp(void) tdq->tdq_cg = smp_topo_find(cpu_top, i); if (tdq->tdq_cg == NULL) panic("Can't find cpu group for %d\n", i); + DPCPU_ID_SET(i, randomval, i * 69069 + 5); } PCPU_SET(sched, DPCPU_PTR(tdq)); balance_tdq = TDQ_SELF();