Date: Fri, 17 Feb 2017 21:15:00 +1100 (EST) From: Bruce Evans <brde@optusnet.com.au> To: Hans Petter Selasky <hps@selasky.org> Cc: Mateusz Guzik <mjg@freebsd.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r313859 - in head/sys: kern sys Message-ID: <20170217203028.K2144@besplex.bde.org> In-Reply-To: <2c01557a-3412-8b46-ef4d-77214566b74a@selasky.org> References: <201702170645.v1H6j4l6060548@repo.freebsd.org> <2c01557a-3412-8b46-ef4d-77214566b74a@selasky.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 17 Feb 2017, Hans Petter Selasky wrote: >> Log: >> Introduce SCHEDULER_STOPPED_TD for use when the thread pointer was >> already read >> >> Sprinkle in few places. >> >> Modified: >> head/sys/kern/kern_condvar.c >> head/sys/kern/kern_synch.c >> head/sys/sys/systm.h > > Do these checks also cover panics? Or only shutdown? This is just an optimization. I don't like it because it moves further from moving the stopped flag back out of the thread to a global. The stopped flag is only set for panics. > Should you also add a check for kdb_active // panicstr ? Then I could factor > out some checks I've sprinkled in the USB code. No. kdb active is very different from the scheduler being stopped. The stopped flag is just a different spelling of panicstr != NULL, modulo minor races. panicstr is used as a flag to avoid doing all sorts of things during panics. This is a bit hackish, but SCHEDULER_STOPPED() is worse. Things are not done, and it is correct to not do them, not because the scheduler is stopped, but because the system is panicing. E.g., not doing normal locking is necessary because normal locking might deadlock, but correct because locking is done in another way (by spinlock_enter() and stopping other CPUs); it is not possible to get back to normal locking, but this is correct since a reboot occurs first. Bruce
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20170217203028.K2144>