From: Andrew Morton <akpm@linux-foundation.org>
To: Hugh Dickins <hughd@google.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>, linux-mm@kvack.org
Subject: Re: [PATCH] mm: fix UP THP spin_is_locked BUGs
Date: Tue, 7 Feb 2012 16:12:09 -0800 [thread overview]
Message-ID: <20120207161209.52d065e1.akpm@linux-foundation.org> (raw)
In-Reply-To: <alpine.LSU.2.00.1202071556460.7549@eggly.anvils>
On Tue, 7 Feb 2012 16:00:46 -0800 (PST)
Hugh Dickins <hughd@google.com> wrote:
> Fix CONFIG_TRANSPARENT_HUGEPAGE=y CONFIG_SMP=n CONFIG_DEBUG_VM=y
> CONFIG_DEBUG_SPINLOCK=n kernel: spin_is_locked() is then always false,
> and so triggers some BUGs in Transparent HugePage codepaths.
>
> asm-generic/bug.h mentions this problem, and provides a WARN_ON_SMP(x);
> but being too lazy to add VM_BUG_ON_SMP, BUG_ON_SMP, WARN_ON_SMP_ONCE,
> VM_WARN_ON_SMP_ONCE, just test NR_CPUS != 1 in the existing VM_BUG_ONs.
>
> Signed-off-by: Hugh Dickins <hughd@google.com>
> ---
>
> mm/huge_memory.c | 4 ++--
> mm/swap.c | 2 +-
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> --- 3.3-rc2/mm/huge_memory.c 2012-01-20 08:42:35.304020840 -0800
> +++ linux/mm/huge_memory.c 2012-02-07 15:37:18.581666053 -0800
> @@ -2083,7 +2083,7 @@ static void collect_mm_slot(struct mm_sl
> {
> struct mm_struct *mm = mm_slot->mm;
>
> - VM_BUG_ON(!spin_is_locked(&khugepaged_mm_lock));
> + VM_BUG_ON(NR_CPUS != 1 && !spin_is_locked(&khugepaged_mm_lock));
We do have assert_spin_locked(), but I couldn't see any way of using it
while observing these laziness constraints ;)
Should we patch -stable too?
--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2012-02-08 0:12 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-08 0:00 [PATCH] mm: fix UP THP spin_is_locked BUGs Hugh Dickins
2012-02-08 0:12 ` Andrew Morton [this message]
2012-02-08 0:33 ` Hugh Dickins
2012-02-08 2:35 ` Andrew Morton
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=20120207161209.52d065e1.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=aarcange@redhat.com \
--cc=hughd@google.com \
--cc=linux-mm@kvack.org \
/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).