From: Steven Rostedt <rostedt@goodmis.org>
To: Johannes Weiner <hannes@cmpxchg.org>
Cc: Clark Williams <williams@redhat.com>,
Andrew Morton <akpm@linux-foundation.org>,
Thomas Gleixner <tglx@glx-um.de>,
linux-mm@kvack.org, RT <linux-rt-users@vger.kernel.org>,
Fernando Lopez-Lezcano <nando@ccrma.Stanford.EDU>,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Subject: Re: [RFC][PATCH] mm: ifdef out VM_BUG_ON check on PREEMPT_RT_FULL
Date: Mon, 1 Jun 2015 15:28:23 -0400 [thread overview]
Message-ID: <20150601152823.405157c3@gandalf.local.home> (raw)
In-Reply-To: <20150601190047.GA5879@cmpxchg.org>
On Mon, 1 Jun 2015 15:00:47 -0400
Johannes Weiner <hannes@cmpxchg.org> wrote:
> Andrew's suggestion makes sense, we can probably just delete the check
> as long as we keep the comment.
>
> That being said, I think it's a little weird that this doesn't work:
>
> spin_lock_irq()
> BUG_ON(!irqs_disabled())
> spin_unlock_irq()
>
> I'd expect that if you change the meaning of spin_lock_irq() from
> "mask hardware interrupts" to "disable preemption by tophalf", you
> would update the irqs_disabled() macro to match. Most people using
> this check probably don't care about the hardware state, only that
> they don't get preempted by an interfering interrupt handler, no?
The thing is, in -rt, there's no state to check if a spin_lock_irq()
was done. Adding that would add overhead to the rt_mutexes without much
gain.
The fast path of spin_lock_irq() in -rt looks like this:
migrate_disable();
rt_mutex_cmpxchg(lock, NULL, current);
Now, the migrate_disable() is more like preempt disable.
Although, maybe we could have -rt change irq_disabled() just check
that, and add a raw_irq_disabled() for when we need to make sure
interrupts are really off.
-- Steve
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2015-06-01 19:28 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-29 15:48 [RFC] mm: change irqs_disabled() test to spin_is_locked() in mem_cgroup_swapout Clark Williams
2015-05-29 19:11 ` Johannes Weiner
2015-05-29 19:21 ` Steven Rostedt
2015-05-29 21:26 ` Andrew Morton
2015-06-01 18:14 ` [RFC][PATCH] mm: ifdef out VM_BUG_ON check on PREEMPT_RT_FULL Clark Williams
2015-06-01 19:00 ` Johannes Weiner
2015-06-01 19:28 ` Steven Rostedt [this message]
2015-06-11 11:40 ` Sebastian Andrzej Siewior
2015-06-19 18:00 ` Johannes Weiner
2015-07-08 15:44 ` Sebastian Andrzej Siewior
2015-07-09 15:07 ` Thomas Gleixner
2015-07-09 16:00 ` Johannes Weiner
2015-07-09 16:43 ` Thomas Gleixner
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=20150601152823.405157c3@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=akpm@linux-foundation.org \
--cc=bigeasy@linutronix.de \
--cc=hannes@cmpxchg.org \
--cc=linux-mm@kvack.org \
--cc=linux-rt-users@vger.kernel.org \
--cc=nando@ccrma.Stanford.EDU \
--cc=tglx@glx-um.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
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