From nobody Fri Sep 23 16:46:08 2022 X-Original-To: freebsd-current@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 4MYyhj0vLRz4cNsn for ; Fri, 23 Sep 2022 16:46:13 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) (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 (2048 bits) client-digest SHA256) (Client CN "troutmask", Issuer "troutmask" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MYyhg6Gg5z3C3f; Fri, 23 Sep 2022 16:46:11 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (localhost [127.0.0.1]) by troutmask.apl.washington.edu (8.16.1/8.16.1) with ESMTPS id 28NGk8ls014730 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 23 Sep 2022 09:46:08 -0700 (PDT) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.16.1/8.16.1/Submit) id 28NGk88r014729; Fri, 23 Sep 2022 09:46:08 -0700 (PDT) (envelope-from sgk) Date: Fri, 23 Sep 2022 09:46:08 -0700 From: Steve Kargl To: Mark Johnston Cc: freebsd-current@freebsd.org Subject: Re: A panic a day Message-ID: Reply-To: sgk@troutmask.apl.washington.edu References: List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4MYyhg6Gg5z3C3f X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=washington.edu (policy=none); spf=none (mx1.freebsd.org: domain of sgk@troutmask.apl.washington.edu has no SPF policy when checking 128.95.76.21) smtp.mailfrom=sgk@troutmask.apl.washington.edu X-Spamd-Result: default: False [-3.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.999]; MIME_GOOD(-0.10)[text/plain]; DMARC_POLICY_SOFTFAIL(0.10)[washington.edu : No valid SPF, No valid DKIM,none]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_DKIM_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_SPF_NA(0.00)[no SPF record]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:73, ipnet:128.95.0.0/16, country:US]; TO_DN_SOME(0.00)[]; MLMMJ_DEST(0.00)[freebsd-current@freebsd.org]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; ARC_NA(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; REPLYTO_ADDR_EQ_FROM(0.00)[]; HAS_REPLYTO(0.00)[sgk@troutmask.apl.washington.edu] X-ThisMailContainsUnwantedMimeParts: N On Thu, Sep 22, 2022 at 03:00:53PM -0400, Mark Johnston wrote: > > I think this untested patch will address the panics. The bug was there > for a long time but some recent restructuring added an assertion which > caught it. > > diff --git a/sys/kern/sched_4bsd.c b/sys/kern/sched_4bsd.c > index 9d48aa746f6d..484864b66c1c 100644 > --- a/sys/kern/sched_4bsd.c > +++ b/sys/kern/sched_4bsd.c > @@ -1282,9 +1282,10 @@ kick_other_cpu(int pri, int cpuid) > } > #endif /* defined(IPI_PREEMPTION) && defined(PREEMPTION) */ > > - ast_sched_locked(pcpu->pc_curthread, TDA_SCHED); > - ipi_cpu(cpuid, IPI_AST); > - return; > + if (pcpu->pc_curthread->td_lock == &sched_lock) { > + ast_sched_locked(pcpu->pc_curthread, TDA_SCHED); > + ipi_cpu(cpuid, IPI_AST); > + } > } > #endif /* SMP */ > > @@ -1397,7 +1398,7 @@ sched_add(struct thread *td, int flags) > > cpuid = PCPU_GET(cpuid); > if (single_cpu && cpu != cpuid) { > - kick_other_cpu(td->td_priority, cpu); > + kick_other_cpu(td->td_priority, cpu); > } else { > if (!single_cpu) { > tidlemsk = idle_cpus_mask; Mark, My system has been running a fairly heavy load with this patch for the last 20 or so hours without any incidences. In fact, the system feels snappier. Thanks for the quick response with a patch. -- Steve