Re: [PATCH] lib: Check for migrate_disable only on SMP systems

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2019-12-09 at 11:04 +0100, Daniel Wagner wrote:
> Hi Scott,
> 
> On Fri, Dec 06, 2019 at 09:21:36PM -0600, Scott Wood wrote:
> > On Fri, 2019-12-06 at 20:39 +0100, Daniel Wagner wrote:
> > > On Fri, Dec 06, 2019 at 12:49:12PM -0600, Scott Wood wrote:
> > > > On Fri, 2019-12-06 at 15:21 +0100, Daniel Wagner wrote:
> > > > Won't this give false positives on UP with CONFIG_PREEMPT_RT_BASE
> > > > and
> > > > CONFIG_DEBUG_PREEMPT? If we have CONFIG_SCHED_DEBUG then we can
> > > > still
> > > > check migrate_disable.
> > > 
> > > Ohhh, I see what you mean. I didn't realize that migrate_disable is
> > > also available with CONFIG_SCHED_DEBUG. So the ifdef should be
> > > something like:
> > > 
> > > #if defined(CONFIG_PREEMP_RT_BASE) && \
> > >     (defined(CONFIG_SMP) || \
> > >       (!defined(CONFIG_SMP) && defined(CONFIG_SCHED_DEBUG)))
> > 
> > That would still leave the issue with false positives if you have
> > CONFIG_DEBUG_PREEMPT but not CONFIG_SCHED_DEBUG (which should be the
> > only
> > config currently experiencing build problems).

Actually it looks like we're saved from the false positives by the
following check for nr_cpus_allowed == 1, which should always be true on
UP.

If we want this check to be effective on UP we'd need some way to keep
track of whether a thread is forced by the kernel to be bound to one CPU,
rather than whether it just happens to have only one CPU in the mask. 
Barring that, we should just stub out check_preemption_disabled() as a
whole on UP.

> I didn't realize that smp_processor_id.c is only build with
> CONFIG_DEBUG_PREEMPT. It should be enough to add
> 
> 	#if defined(CONFIG_SCHED_DEBUG)
> 
> Did I get it finally correct? :)

No, then we *would* get those false positives on SMP without
CONFIG_SCHED_DEBUG, and it wouldn't build without CONFIG_PREEMPT_RT_BASE.

-Scott




[Index of Archives]     [RT Stable]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux