linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: joe.korty@concurrent-rt.com
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Julia Cartwright <julia@ni.com>, <tglx@linutronix.de>,
	<rostedt@goodmis.org>, <linux-rt-users@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>,
	Peter Zijlstra <peterz@infradead.org>
Subject: Re: [PATCH RT v2] sched/migrate_disable: fallback to preempt_disable() instead barrier()
Date: Fri, 6 Jul 2018 15:05:02 -0400	[thread overview]
Message-ID: <20180706190502.GA26154@zipoli.concurrent-rt.com> (raw)
In-Reply-To: <20180706105857.5tgi5irdxdryet64@linutronix.de>

On Fri, Jul 06, 2018 at 12:58:57PM +0200, Sebastian Andrzej Siewior wrote:
> On SMP + !RT migrate_disable() is still around. It is not part of spin_lock()
> anymore so it has almost no users. However the futex code has a workaround for
> the !in_atomic() part of migrate disable which fails because the matching
> migrade_disable() is no longer part of spin_lock().
> 
> On !SMP + !RT migrate_disable() is reduced to barrier(). This is not optimal
> because we few spots where a "preempt_disable()" statement was replaced with
> "migrate_disable()".
> 
> We also used the migration_disable counter to figure out if a sleeping lock is
> acquired so RCU does not complain about schedule() during rcu_read_lock() while
> a sleeping lock is held. This changed, we no longer use it, we have now a
> sleeping_lock counter for the RCU purpose.
> 
> This means we can now:
> - for SMP + RT_BASE
>   full migration program, nothing changes here
> 
> - for !SMP + RT_BASE
>   the migration counting is no longer required. It used to ensure that the task
>   is not migrated to another CPU and that this CPU remains online. !SMP ensures
>   that already.
>   Move it to CONFIG_SCHED_DEBUG so the counting is done for debugging purpose
>   only.
> 
> - for all other cases including !RT
>   fallback to preempt_disable(). The only remaining users of migrate_disable()
>   are those which were converted from preempt_disable() and the futex
>   workaround which is already in the preempt_disable() section due to the
>   spin_lock that is held.
> 
> Cc: stable-rt@vger.kernel.org
> Reported-by: joe.korty@concurrent-rt.com
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> ---
> v1???v2: limit migrate_disable to RT only. Use preempt_disable() for !RT
>        if migrate_disable() is used.
> 
>  include/linux/preempt.h |    6 +++---
>  include/linux/sched.h   |    4 ++--
>  kernel/sched/core.c     |   23 +++++++++++------------
>  kernel/sched/debug.c    |    2 +-
>  4 files changed, 17 insertions(+), 18 deletions(-)


Hi Sebastian,
v2 works for me.

I compiled and booted both smp+preempt+!rt and
smp+preempt+rt kernels, no splats on boot for either.

I ran the futex selftests on both kernels, both passed.

I ran a selection of posix tests from an old version of
the Linux Test Project, both kernels passed all tests.

Regards, and thanks,
Joe

  reply	other threads:[~2018-07-06 19:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-04 17:35 [PATCH RT] sample fix for splat in futex_[un]lock_pi for !rt joe.korty
2018-07-05 15:50 ` [PATCH RT] sched/migrate_disable: fallback to preempt_disable() instead barrier() Sebastian Andrzej Siewior
2018-07-05 16:18   ` joe.korty
2018-07-05 16:59     ` Sebastian Andrzej Siewior
2018-07-06 10:58       ` [PATCH RT v2] " Sebastian Andrzej Siewior
2018-07-06 19:05         ` joe.korty [this message]
2018-07-11 15:39         ` Sebastian Andrzej Siewior
2018-07-11 15:43           ` Steven Rostedt
2018-07-05 16:23   ` [PATCH RT] " Steven Rostedt
2018-07-05 16:38     ` 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=20180706190502.GA26154@zipoli.concurrent-rt.com \
    --to=joe.korty@concurrent-rt.com \
    --cc=bigeasy@linutronix.de \
    --cc=julia@ni.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /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).