All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: David Vrabel <david.vrabel@citrix.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Len Brown <lenb@kernel.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	linux-acpi@vger.kernel.org,
	xen-devel <xen-devel@lists.xenproject.org>,
	Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
Subject: Re: vunmap() on large regions may trigger soft lockup warnings
Date: Sat, 14 Dec 2013 00:32:08 -0800	[thread overview]
Message-ID: <20131214003208.f99bc37c.akpm@linux-foundation.org> (raw)
In-Reply-To: <52A9B127.9010501@citrix.com>

On Thu, 12 Dec 2013 12:50:47 +0000 David Vrabel <david.vrabel@citrix.com> wrote:

> > each time.  But that would require difficult tuning of N.
> > 
> > I suppose we could just do
> > 
> > 	if (!in_interrupt())
> > 		cond_resched();
> > 
> > in vunmap_pmd_range(), but that's pretty specific to ghes.c and doesn't
> > permit unmap-inside-spinlock.
> > 
> > So I can't immediately think of a suitable fix apart from adding a new
> > unmap_kernel_range_atomic().  Then add a `bool atomic' arg to
> > vunmap_page_range() and pass that all the way down.
> 
> That would work for the unmap, but looking at the GHES driver some more
> and it looks like it's call to ioremap_page_range() is already unsafe --
> it may need to allocate a new PTE page with a non-atomic alloc in
> pte_alloc_one_kernel().
> 
> Perhaps what's needed here is a pair of ioremap_page_atomic() and
> iounmap_page_atomic() calls?  With some prep function to sure the PTE
> pages (etc.) are preallocated.

Is ghes.c the only problem source here?  If so then a suitable solution
would be to declare that driver hopelessly busted and proceed as if it
didn't exist :(

Just from a quick look, the thing is doing ioremap() from NMI context! 
ioremap has to do a bunch of memory allocations, takes spinlocks etc.


WARNING: multiple messages have this Message-ID (diff)
From: Andrew Morton <akpm@linux-foundation.org>
To: David Vrabel <david.vrabel@citrix.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Len Brown <lenb@kernel.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	<linux-acpi@vger.kernel.org>,
	xen-devel <xen-devel@lists.xenproject.org>,
	Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
Subject: Re: vunmap() on large regions may trigger soft lockup warnings
Date: Sat, 14 Dec 2013 00:32:08 -0800	[thread overview]
Message-ID: <20131214003208.f99bc37c.akpm@linux-foundation.org> (raw)
In-Reply-To: <52A9B127.9010501@citrix.com>

On Thu, 12 Dec 2013 12:50:47 +0000 David Vrabel <david.vrabel@citrix.com> wrote:

> > each time.  But that would require difficult tuning of N.
> > 
> > I suppose we could just do
> > 
> > 	if (!in_interrupt())
> > 		cond_resched();
> > 
> > in vunmap_pmd_range(), but that's pretty specific to ghes.c and doesn't
> > permit unmap-inside-spinlock.
> > 
> > So I can't immediately think of a suitable fix apart from adding a new
> > unmap_kernel_range_atomic().  Then add a `bool atomic' arg to
> > vunmap_page_range() and pass that all the way down.
> 
> That would work for the unmap, but looking at the GHES driver some more
> and it looks like it's call to ioremap_page_range() is already unsafe --
> it may need to allocate a new PTE page with a non-atomic alloc in
> pte_alloc_one_kernel().
> 
> Perhaps what's needed here is a pair of ioremap_page_atomic() and
> iounmap_page_atomic() calls?  With some prep function to sure the PTE
> pages (etc.) are preallocated.

Is ghes.c the only problem source here?  If so then a suitable solution
would be to declare that driver hopelessly busted and proceed as if it
didn't exist :(

Just from a quick look, the thing is doing ioremap() from NMI context! 
ioremap has to do a bunch of memory allocations, takes spinlocks etc.


  reply	other threads:[~2013-12-14  8:30 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-11 16:58 vunmap() on large regions may trigger soft lockup warnings David Vrabel
2013-12-11 16:58 ` David Vrabel
2013-12-11 21:39 ` Andrew Morton
2013-12-11 21:39 ` Andrew Morton
2013-12-11 21:39   ` Andrew Morton
2013-12-12 12:50   ` David Vrabel
2013-12-12 12:50   ` David Vrabel
2013-12-12 12:50     ` David Vrabel
2013-12-14  8:32     ` Andrew Morton [this message]
2013-12-14  8:32       ` Andrew Morton
2013-12-16 12:56       ` David Vrabel
2013-12-16 12:56       ` David Vrabel
2013-12-16 12:56         ` David Vrabel
2013-12-16 22:57         ` Andrew Morton
2013-12-16 22:57         ` Andrew Morton
2013-12-16 22:57           ` Andrew Morton
2013-12-14  8:32     ` Andrew Morton
  -- strict thread matches above, loose matches on Subject: below --
2013-12-11 16:58 David Vrabel

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=20131214003208.f99bc37c.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=david.vrabel@citrix.com \
    --cc=dietmar.hahn@ts.fujitsu.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=xen-devel@lists.xenproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.