linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Wagner <dwagner@suse.de>
To: Scott Wood <swood@redhat.com>
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, 6 Dec 2019 20:39:54 +0100	[thread overview]
Message-ID: <20191206193954.yi5hac366agt7k3o@beryllium.lan> (raw)
In-Reply-To: <4513f4a584586a4c17ef14f7365f6275042c3071.camel@redhat.com>

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)))

?

Hmm, looks a bit ugly but I haven't found a simplification. Long time
since I did logic algebra...

Thanks,
Daniel

  reply	other threads:[~2019-12-06 19:39 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 [this message]
2019-12-07  3:21     ` Scott Wood
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=20191206193954.yi5hac366agt7k3o@beryllium.lan \
    --to=dwagner@suse.de \
    --cc=bigeasy@linutronix.de \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=swood@redhat.com \
    /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).