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: Fri, 06 Dec 2019 21:21:36 -0600	[thread overview]
Message-ID: <3ce4699f987e784e84b2030aa3a1c529b274b498.camel@redhat.com> (raw)
In-Reply-To: <20191206193954.yi5hac366agt7k3o@beryllium.lan>

On Fri, 2019-12-06 at 20:39 +0100, Daniel Wagner wrote:
> Hi Scott,
> 
> 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:
> > > In case the kernel configuration is UP is, the migrate_disable member
> > > in task_struct is missing.
> > > 
> > > linux/lib/smp_processor_id.c: In function ‘check_preemption_disabled’:
> > > linux/lib/smp_processor_id.c:26:13: error: ‘struct task_struct’ has no
> > > member named ‘migrate_disable’
> > >     26 |  if (current->migrate_disable)
> > >        |             ^~
> > > 
> > > Fixes: 425c5b38779a ("sched: Lazy migrate_disable processing")
> > > Cc: Scott Wood <swood@redhat.com>
> > > Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> > > Signed-off-by: Daniel Wagner <dwagner@suse.de>
> > > ---
> > >  lib/smp_processor_id.c | 2 ++
> > >  1 file changed, 2 insertions(+)
> > > 
> > > diff --git a/lib/smp_processor_id.c b/lib/smp_processor_id.c
> > > index 5f2618d346c4..a914f73e3652 100644
> > > --- a/lib/smp_processor_id.c
> > > +++ b/lib/smp_processor_id.c
> > > @@ -23,8 +23,10 @@ unsigned int check_preemption_disabled(const char
> > > *what1, const char *what2)
> > >  	 * Kernel threads bound to a single CPU can safely use
> > >  	 * smp_processor_id():
> > >  	 */
> > > +#if defined(CONFIG_SMP) && defined(CONFIG_PREEMPT_RT_BASE)
> > >  	if (current->migrate_disable)
> > >  		goto out;
> > > +#endif
> > 
> > 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).

-Scott



  reply	other threads:[~2019-12-07  3:22 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 [this message]
2019-12-09 10:04       ` Daniel Wagner
2019-12-10  0:40         ` Scott Wood
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=3ce4699f987e784e84b2030aa3a1c529b274b498.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).