From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Johannes Weiner <hannes@cmpxchg.org>
Cc: akpm@linux-foundation.org, linux-mm@kvack.org,
tglx@linutronix.de, rostedt@goodmis.org, williams@redhat.com
Subject: Re: [PATCH] mm: memcontrol: correct the comment in mem_cgroup_swapout()
Date: Fri, 19 Jun 2015 19:18:31 +0200 [thread overview]
Message-ID: <55844EE7.7070508@linutronix.de> (raw)
In-Reply-To: <20150619171118.GA11423@cmpxchg.org>
On 06/19/2015 07:11 PM, Johannes Weiner wrote:
> On Fri, Jun 19, 2015 at 06:34:18PM +0200, Sebastian Andrzej Siewior wrote:
>> Clark stumbled over a VM_BUG_ON() in -RT which was then was removed by
>> Johannes in commit f371763a79d ("mm: memcontrol: fix false-positive
>> VM_BUG_ON() on -rt"). The comment before that patch was a tiny bit
>> better than it is now. While the patch claimed to fix a false-postive on
>> -RT this was not the case. None of the -RT folks ACKed it and it was not a
>> false positive report. That was a *real* problem.
>
> The real problem is that irqs_disabled() on -rt is returning false
> negatives. Having it return false within a spin_lock_irq() section is
> broken.
As I explained it in
http://www.spinics.net/lists/linux-rt-users/msg13499.html
it is not.
>> This patch updates the comment that is improper because it refers to
>> "disabled preemption" as a consequence of that lock being taken. A
>> spin_lock() disables preemption, true, but in this case the code relies on
>> the fact that the lock _also_ disables interrupts once it is acquired. And
>> this is the important detail (which was checked the VM_BUG_ON()) which needs
>> to be pointed out. This is the hint one needs while looking at the code. It
>> was explained by Johannes on the list that the per-CPU variables are protected
>> by local_irq_save(). The BUG_ON() was helpful. This code has been workarounded
>> in -RT in the meantime. I wouldn't mind running into more of those if the code
>> in question uses *special* kind of locking since now there is no no
>> verification (in terms of lockdep or BUG_ON()).
>
> I'd be happy to re-instate the VM_BUG_ON that checks for disabled
> interrupts as before, that was the most obvious documentation.
sure thing, patch follows in a jiffy or two.
Sebastian
--
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-19 17:18 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-19 16:34 Sebastian Andrzej Siewior
2015-06-19 17:11 ` Johannes Weiner
2015-06-19 17:18 ` Sebastian Andrzej Siewior [this message]
2015-06-19 17:28 ` Johannes Weiner
2015-06-19 17:36 ` [PATCH v2] mm: memcontrol: bring back the VM_BUG_ON() " Sebastian Andrzej Siewior
2015-06-19 18:02 ` Johannes Weiner
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=55844EE7.7070508@linutronix.de \
--to=bigeasy@linutronix.de \
--cc=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=linux-mm@kvack.org \
--cc=rostedt@goodmis.org \
--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
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