Date: Fri, 23 Sep 2022 20:22:31 -0400 From: Mark Johnston <markj@freebsd.org> To: Steve Kargl <sgk@troutmask.apl.washington.edu> Cc: freebsd-current@freebsd.org Subject: Re: A panic a day Message-ID: <Yy5Nx7Ig5dqVVtu9@nuc> In-Reply-To: <Yy3i0K9VuPSJtqsR@troutmask.apl.washington.edu> References: <YyyqDEPL3X3esFYl@troutmask.apl.washington.edu> <Yyyw5bnWO1y6veYl@nuc> <Yy3i0K9VuPSJtqsR@troutmask.apl.washington.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Sep 23, 2022 at 09:46:08AM -0700, Steve Kargl wrote: > 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. Thanks, committed in c2d27b0ec700.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Yy5Nx7Ig5dqVVtu9>