mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-30 22:21:34 +00:00
78 lines
2.0 KiB
Diff
78 lines
2.0 KiB
Diff
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|
Date: Fri, 30 Oct 2020 13:59:06 +0100
|
|
Subject: [PATCH] highmem: Don't disable preemption on RT in kmap_atomic()
|
|
|
|
Disabling preemption makes it impossible to acquire sleeping locks within
|
|
kmap_atomic() section.
|
|
For PREEMPT_RT it is sufficient to disable migration.
|
|
|
|
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|
---
|
|
include/linux/highmem-internal.h | 27 ++++++++++++++++++++++-----
|
|
1 file changed, 22 insertions(+), 5 deletions(-)
|
|
|
|
--- a/include/linux/highmem-internal.h
|
|
+++ b/include/linux/highmem-internal.h
|
|
@@ -90,7 +90,11 @@ static inline void __kunmap_local(void *
|
|
|
|
static inline void *kmap_atomic_prot(struct page *page, pgprot_t prot)
|
|
{
|
|
- preempt_disable();
|
|
+ if (IS_ENABLED(CONFIG_PREEMPT_RT))
|
|
+ migrate_disable();
|
|
+ else
|
|
+ preempt_disable();
|
|
+
|
|
pagefault_disable();
|
|
return __kmap_local_page_prot(page, prot);
|
|
}
|
|
@@ -102,7 +106,11 @@ static inline void *kmap_atomic(struct p
|
|
|
|
static inline void *kmap_atomic_pfn(unsigned long pfn)
|
|
{
|
|
- preempt_disable();
|
|
+ if (IS_ENABLED(CONFIG_PREEMPT_RT))
|
|
+ migrate_disable();
|
|
+ else
|
|
+ preempt_disable();
|
|
+
|
|
pagefault_disable();
|
|
return __kmap_local_pfn_prot(pfn, kmap_prot);
|
|
}
|
|
@@ -111,7 +119,10 @@ static inline void __kunmap_atomic(void
|
|
{
|
|
kunmap_local_indexed(addr);
|
|
pagefault_enable();
|
|
- preempt_enable();
|
|
+ if (IS_ENABLED(CONFIG_PREEMPT_RT))
|
|
+ migrate_enable();
|
|
+ else
|
|
+ preempt_enable();
|
|
}
|
|
|
|
unsigned int __nr_free_highpages(void);
|
|
@@ -184,7 +195,10 @@ static inline void __kunmap_local(void *
|
|
|
|
static inline void *kmap_atomic(struct page *page)
|
|
{
|
|
- preempt_disable();
|
|
+ if (IS_ENABLED(CONFIG_PREEMPT_RT))
|
|
+ migrate_disable();
|
|
+ else
|
|
+ preempt_disable();
|
|
pagefault_disable();
|
|
return page_address(page);
|
|
}
|
|
@@ -205,7 +219,10 @@ static inline void __kunmap_atomic(void
|
|
kunmap_flush_on_unmap(addr);
|
|
#endif
|
|
pagefault_enable();
|
|
- preempt_enable();
|
|
+ if (IS_ENABLED(CONFIG_PREEMPT_RT))
|
|
+ migrate_enable();
|
|
+ else
|
|
+ preempt_enable();
|
|
}
|
|
|
|
static inline unsigned int nr_free_highpages(void) { return 0; }
|