Linux-rt-users archive on lore.kernel.org
 help / color / Atom feed
From: Joel Fernandes <joel@joelfernandes.org>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: "Paul E. McKenney" <paulmck@kernel.org>,
	Josh Triplett <josh@joshtriplett.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	Thomas Glexiner <tglx@linutronix.de>,
	Scott Wood <swood@redhat.com>,
	Clark Williams <williams@redhat.com>,
	Juri Lelli <juri.lelli@redhat.com>,
	linux-rt-users@vger.kernel.org, rcu <rcu@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@kernel.org>
Subject: Re: RCU use of swait
Date: Wed, 18 Mar 2020 20:47:18 -0400
Message-ID: <CAEXW_YSiKrT50mTR1a4tB5x_jQzZKnuAo6JY-Vc5w7r=XLv+OA@mail.gmail.com> (raw)
In-Reply-To: <20200305081135.yg7wryd3hrqzocrm@linutronix.de>

On Thu, Mar 5, 2020 at 3:11 AM Sebastian Andrzej Siewior
<bigeasy@linutronix.de> wrote:
>
> On 2020-03-04 16:35:26 [-0800], Paul E. McKenney wrote:
> > Hello!
> Hi Paul,
>
> > Or is there some other reason why {S,}RCU needs to use swait that I
> > am forgetting?
>
> swait can be used in hardirq-context (on RT) that is in a section within
> local_irq_save() / raw_spin_lock() and so.
> wait on the hand uses spinlock_t which can not be used in this context.
> So if you have no users which fall into that category then you could
> move back to wait.h.

In RCU, there are some truly-atomic code sections containing an
swake_upXX() call, which would be considered atomic also on
PREEMPT_RT, one example is:

rcu_core() contains an local_irq_{save,restore}() section.

        /* No grace period and unregistered callbacks? */
        if (!rcu_gp_in_progress() &&
            rcu_segcblist_is_enabled(&rdp->cblist) && !offloaded) {
                local_irq_save(flags);
                if (!rcu_segcblist_restempty(&rdp->cblist, RCU_NEXT_READY_TAIL))
                        rcu_accelerate_cbs_unlocked(rnp, rdp);
                local_irq_restore(flags);
        }

And rcu_accelerate_cbs_unlocked(rnp, rdp) calls rcu_gp_kthread_wake()
which does an swake_up_one(), so I think we will have to leave it as
swake_up() the way it is.

thanks,

 - Joel

  reply index

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-05  0:35 Paul E. McKenney
2020-03-05  8:11 ` Sebastian Andrzej Siewior
2020-03-19  0:47   ` Joel Fernandes [this message]
2020-03-19  9:25     ` 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='CAEXW_YSiKrT50mTR1a4tB5x_jQzZKnuAo6JY-Vc5w7r=XLv+OA@mail.gmail.com' \
    --to=joel@joelfernandes.org \
    --cc=bigeasy@linutronix.de \
    --cc=jiangshanlai@gmail.com \
    --cc=josh@joshtriplett.org \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mingo@kernel.org \
    --cc=paulmck@kernel.org \
    --cc=rcu@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=swood@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=williams@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

Linux-rt-users archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-rt-users/0 linux-rt-users/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-rt-users linux-rt-users/ https://lore.kernel.org/linux-rt-users \
		linux-rt-users@vger.kernel.org
	public-inbox-index linux-rt-users

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-rt-users


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git