linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@kernel.org>
To: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>,
	linux-mm@kvack.org, linux-rt-devel@lists.linux.dev,
	Ard Biesheuvel <ardb@kernel.org>,
	Clark Williams <clrkwllms@kernel.org>,
	Jason Baron <jbaron@akamai.com>,
	Josh Poimboeuf <jpoimboe@kernel.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Matthew Wilcox <willy@infradead.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Russell King <linux@armlinux.org.uk>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	Steven Rostedt <rostedt@goodmis.org>
Subject: [PATCH 2/4] ARM: Disable HIGHPTE on PREEMPT_RT kernels
Date: Tue, 10 Dec 2024 17:05:54 +0100	[thread overview]
Message-ID: <20241210160556.2341497-3-arnd@kernel.org> (raw)
In-Reply-To: <20241210160556.2341497-1-arnd@kernel.org>

From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

gup_pgd_range() is invoked with disabled interrupts and invokes
__kmap_local_page_prot() via pte_offset_map(), gup_p4d_range().
With HIGHPTE enabled, __kmap_local_page_prot() invokes kmap_high_get()
which uses a spinlock_t via lock_kmap_any(). This leads to an
sleeping-while-atomic error on PREEMPT_RT because spinlock_t becomes a
sleeping lock and must not be acquired in atomic context.

The loop in map_new_virtual() uses wait_queue_head_t for wake up which
also is using a spinlock_t.

Since HIGHPTE is rarely needed at all, turn it off for PREEMPT_RT
to allow the use of get_user_pages_fast().

[arnd: rework patch to turn off HIGHPTE instead of HAVE_PAST_GUP]
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
There is an open question about whether HIGHPTE is still needed
at all, given how rare 32-bit machines with more than 4GB
are on any architecture. If we instead decide to remove HIGHPTE
altogether, this patch is no longer needed.
---
 arch/arm/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index ed850cc0ed3c..4de4e5697bdf 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1231,7 +1231,7 @@ config HIGHMEM
 
 config HIGHPTE
 	bool "Allocate 2nd-level pagetables from highmem" if EXPERT
-	depends on HIGHMEM
+	depends on HIGHMEM && !PREEMPT_RT
 	default y
 	help
 	  The VM uses one page of physical memory for each page table.
-- 
2.39.5



  parent reply	other threads:[~2024-12-10 16:10 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-10 16:05 [PATCH 0/4] ARM: towards 32-bit preempt-rt support Arnd Bergmann
2024-12-10 16:05 ` [PATCH 1/4] ARM: Disable jump-label on PREEMPT_RT Arnd Bergmann
2024-12-11 13:04   ` Linus Walleij
2024-12-11 13:26   ` Sebastian Andrzej Siewior
2024-12-10 16:05 ` Arnd Bergmann [this message]
2024-12-11 13:29   ` [PATCH 2/4] ARM: Disable HIGHPTE on PREEMPT_RT kernels Linus Walleij
2024-12-11 15:22     ` Sebastian Andrzej Siewior
2024-12-13  0:27       ` Linus Walleij
2024-12-13  9:11         ` Russell King (Oracle)
2024-12-14 22:11           ` Matthew Wilcox
2024-12-11 13:48   ` Sebastian Andrzej Siewior
2024-12-11 14:04     ` Sebastian Andrzej Siewior
2024-12-11 14:30       ` Arnd Bergmann
2024-12-11 15:55       ` Russell King (Oracle)
2024-12-20 14:37         ` Arnd Bergmann
2024-12-10 16:05 ` [PATCH 3/4] ARM: drop CONFIG_HIGHPTE support Arnd Bergmann
2024-12-11 13:32   ` Linus Walleij
     [not found]     ` <Z1mYufbtXpeEwTAq@shell.armlinux.org.uk>
2024-12-11 14:31       ` Linus Walleij
2024-12-11 14:25   ` Sebastian Andrzej Siewior
2024-12-14 18:40   ` David Laight
2024-12-20 13:10     ` Linus Walleij
2024-12-20 14:30       ` Arnd Bergmann
2024-12-10 16:05 ` [PATCH 4/4] mm: drop HIGHPTE support altogether Arnd Bergmann
2024-12-11 13:53   ` Linus Walleij
2024-12-11 14:29   ` Sebastian Andrzej Siewior

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=20241210160556.2341497-3-arnd@kernel.org \
    --to=arnd@kernel.org \
    --cc=ardb@kernel.org \
    --cc=arnd@arndb.de \
    --cc=bigeasy@linutronix.de \
    --cc=clrkwllms@kernel.org \
    --cc=jbaron@akamai.com \
    --cc=jpoimboe@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-rt-devel@lists.linux.dev \
    --cc=linux@armlinux.org.uk \
    --cc=mark.rutland@arm.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=willy@infradead.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).