From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Morton Subject: Re: vunmap() on large regions may trigger soft lockup warnings Date: Sat, 14 Dec 2013 00:32:08 -0800 Message-ID: <20131214003208.f99bc37c.akpm@linux-foundation.org> References: <52A899AB.3010506@citrix.com> <20131211133917.dd10cb2c4360dba65d8e6ce2@linux-foundation.org> <52A9B127.9010501@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: Received: from mail.linuxfoundation.org ([140.211.169.12]:55957 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751979Ab3LNIai (ORCPT ); Sat, 14 Dec 2013 03:30:38 -0500 In-Reply-To: <52A9B127.9010501@citrix.com> Sender: linux-acpi-owner@vger.kernel.org List-Id: linux-acpi@vger.kernel.org To: David Vrabel Cc: "linux-kernel@vger.kernel.org" , Len Brown , "Rafael J. Wysocki" , linux-acpi@vger.kernel.org, xen-devel , Dietmar Hahn On Thu, 12 Dec 2013 12:50:47 +0000 David Vrabel 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.