linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Scott Wood <swood@redhat.com>
To: Daniel Wagner <dwagner@suse.de>
Cc: linux-rt-users@vger.kernel.org,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Subject: Re: [PATCH] lib: Check for migrate_disable only on SMP systems
Date: Mon, 09 Dec 2019 18:40:37 -0600	[thread overview]
Message-ID: <1db9c7c960570e975ac0d684d6313ca35a3b1450.camel@redhat.com> (raw)
In-Reply-To: <20191209100447.codml4nop4ibbjkz@beryllium.lan>

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


  reply	other threads:[~2019-12-10  0:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-06 14:21 [PATCH] lib: Check for migrate_disable only on SMP systems Daniel Wagner
2019-12-06 18:49 ` Scott Wood
2019-12-06 19:39   ` Daniel Wagner
2019-12-07  3:21     ` Scott Wood
2019-12-09 10:04       ` Daniel Wagner
2019-12-10  0:40         ` Scott Wood [this message]
2019-12-16 15:21           ` [PATCH RT] " Sebastian Andrzej Siewior
2019-12-16 17:06             ` Scott Wood
2019-12-16 17:09               ` Sebastian Andrzej Siewior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1db9c7c960570e975ac0d684d6313ca35a3b1450.camel@redhat.com \
    --to=swood@redhat.com \
    --cc=bigeasy@linutronix.de \
    --cc=dwagner@suse.de \
    --cc=linux-rt-users@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).