linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Ville Syrjala <ville.syrjala@linux.intel.com>
Cc: linux-kernel@vger.kernel.org,
	"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Ingo Molnar" <mingo@redhat.com>,
	"Borislav Petkov" <bp@alien8.de>,
	"H. Peter Anvin" <hpa@zytor.com>,
	linux-mm@kvack.org, "Jérôme Glisse" <jglisse@redhat.com>,
	"Ralph Campbell" <rcampbell@nvidia.com>,
	"Ira Weiny" <ira.weiny@intel.com>,
	"Jason Gunthorpe" <jgg@mellanox.com>,
	"Daniel Vetter" <daniel.vetter@intel.com>,
	"Andrea Arcangeli" <aarcange@redhat.com>
Subject: Re: [PATCH] mm/khugepaged: Fix might_sleep() warn with CONFIG_HIGHPTE=y
Date: Tue, 29 Oct 2019 14:43:00 -0700	[thread overview]
Message-ID: <20191029144300.160811015055490f042975d6@linux-foundation.org> (raw)
In-Reply-To: <20191029212513.23566-1-ville.syrjala@linux.intel.com>

On Tue, 29 Oct 2019 23:25:13 +0200 Ville Syrjala <ville.syrjala@linux.intel.com> wrote:

> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> I got some khugepaged spew on a 32bit x86:
> 
> [  217.490026] BUG: sleeping function called from invalid context at include/linux/mmu_notifier.h:346
> [  217.492826] in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 25, name: khugepaged
> [  217.495589] INFO: lockdep is turned off.
> [  217.498371] CPU: 1 PID: 25 Comm: khugepaged Not tainted 5.4.0-rc5-elk+ #206
> [  217.501233] Hardware name: System manufacturer P5Q-EM/P5Q-EM, BIOS 2203    07/08/2009
> [  217.501697] Call Trace:
> [  217.501697]  dump_stack+0x66/0x8e
> [  217.501697]  ___might_sleep.cold.96+0x95/0xa6
> [  217.501697]  __might_sleep+0x2e/0x80
> [  217.501697]  collapse_huge_page.isra.51+0x5ac/0x1360
> [  217.501697]  ? __alloc_pages_nodemask+0xec/0xf80
> [  217.501697]  ? __alloc_pages_nodemask+0x191/0xf80
> [  217.501697]  ? trace_hardirqs_on+0x4a/0xf0
> [  217.501697]  khugepaged+0x9a9/0x20f0
> [  217.501697]  ? _raw_spin_unlock+0x21/0x30
> [  217.501697]  ? trace_hardirqs_on+0x4a/0xf0
> [  217.501697]  ? wait_woken+0xa0/0xa0
> [  217.501697]  kthread+0xf5/0x110
> [  217.501697]  ? collapse_pte_mapped_thp+0x3b0/0x3b0
> [  217.501697]  ? kthread_create_worker_on_cpu+0x20/0x20
> [  217.501697]  ret_from_fork+0x2e/0x38
> 
> Looks like it's due to CONFIG_HIGHPTE=y pte_offset_map()->kmap_atomic()
> vs. mmu_notifier_invalidate_range_start(). Let's do the naive approach
> and just reorder the two operations.

Thanks.

I'll add 
Fixes: 810e24e009cf71 ("mm/mmu_notifiers: annotate with might_sleep()")
Cc: <stable@vger.kernel.org>

although 810e24e009cf71 merely exposed the bug.

  reply	other threads:[~2019-10-29 21:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-29 20:15 khugepaged might_sleep() warn due to CONFIG_HIGHPTE=y Ville Syrjälä
2019-10-29 21:02 ` Andrew Morton
2019-10-29 21:25   ` [PATCH] mm/khugepaged: Fix might_sleep() warn with CONFIG_HIGHPTE=y Ville Syrjala
2019-10-29 21:43     ` Andrew Morton [this message]
2019-10-30  7:08     ` Kirill A. Shutemov
2019-10-29 23:15 ` khugepaged might_sleep() warn due to CONFIG_HIGHPTE=y Jason Gunthorpe

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=20191029144300.160811015055490f042975d6@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=aarcange@redhat.com \
    --cc=bp@alien8.de \
    --cc=daniel.vetter@intel.com \
    --cc=hpa@zytor.com \
    --cc=ira.weiny@intel.com \
    --cc=jgg@mellanox.com \
    --cc=jglisse@redhat.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mingo@redhat.com \
    --cc=rcampbell@nvidia.com \
    --cc=tglx@linutronix.de \
    --cc=ville.syrjala@linux.intel.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;
as well as URLs for NNTP newsgroup(s).