From nobody Thu Oct 21 22:31:34 2021 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 E73E31813449; Thu, 21 Oct 2021 22:31:35 +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 4Hb2Jl2Szwz4fKh; Thu, 21 Oct 2021 22:31:35 +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 1D083233C2; Thu, 21 Oct 2021 22:31:35 +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 19LMVYgl018813; Thu, 21 Oct 2021 22:31:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19LMVYre018812; Thu, 21 Oct 2021 22:31:34 GMT (envelope-from git) Date: Thu, 21 Oct 2021 22:31:34 GMT Message-Id: <202110212231.19LMVYre018812@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: a3d50144ccd7 - stable/13 - Fix build without SMP. 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: a3d50144ccd7cdb0754efc8ff2c8b56d8abcc2d9 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=a3d50144ccd7cdb0754efc8ff2c8b56d8abcc2d9 commit a3d50144ccd7cdb0754efc8ff2c8b56d8abcc2d9 Author: Alexander Motin AuthorDate: 2021-09-22 02:13:33 +0000 Commit: Alexander Motin CommitDate: 2021-10-21 22:24:35 +0000 Fix build without SMP. MFC after: 1 month (cherry picked from commit 8db1669959ceebdc60a7d402830663953bf32818) --- sys/kern/sched_ule.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c index e7de4a50bb93..d92436f70db2 100644 --- a/sys/kern/sched_ule.c +++ b/sys/kern/sched_ule.c @@ -2118,7 +2118,10 @@ sched_switch(struct thread *td, int flags) struct td_sched *ts; struct mtx *mtx; int srqflag; - int cpuid, pickcpu, preempted; + int cpuid, preempted; +#ifdef SMP + int pickcpu; +#endif THREAD_LOCK_ASSERT(td, MA_OWNED); @@ -2126,11 +2129,13 @@ sched_switch(struct thread *td, int flags) tdq = TDQ_SELF(); ts = td_get_sched(td); sched_pctcpu_update(ts, 1); +#ifdef SMP pickcpu = (td->td_flags & TDF_PICKCPU) != 0; if (pickcpu) ts->ts_rltick = ticks - affinity * MAX_CACHE_LEVELS; else ts->ts_rltick = ticks; +#endif td->td_lastcpu = td->td_oncpu; preempted = (td->td_flags & TDF_SLICEEND) == 0 && (flags & SW_PREEMPT) != 0;