mm/highmem: Provide a preemptible variant of kmap_atomic & friends
Subsystems (14)
cover mm/highmem: Provide a preemptible variant of kmap_atomic & friends
Rmlyc3Qgb2YgYWxsLCBzb3JyeSBmb3IgdGhlIGhvcnJpYmx5IGJpZyBDYyBsaXN0IQoKRm9sbG93 aW5nIHVwIHRvIHRoZSBkaXNjdXNzaW9uIGluOgoKICBodHRwczovL2xvcmUua2VybmVsLm9yZy9y LzIwMjAwOTE0MjA0MjA5LjI1NjI2NjA5M0BsaW51dHJvbml4LmRlCgp0aGlzIHByb3ZpZGVzIGEg cHJlZW1wdGlibGUgdmFyaWFudCBvZiBrbWFwX2F0b21pYyAmIHJlbGF0ZWQKaW50ZXJmYWNlcy4g VGhpcyBpcyBhY2hpZXZlZCBieToKCiAtIENvbnNvbGlkYXRpbmcgYWxsIGttYXAgYXRvbWljIGlt cGxlbWVudGF0aW9ucyBpbiBnZW5lcmljIGNvZGUKCiAtIFN3aXRjaGluZyBmcm9tIHBlciBDUFUg c3RvcmFnZSBvZiB0aGUga21hcCBpbmRleCB0byBhIHBlciB0YXNrIHN0b3JhZ2UKCiAtIEFkZGlu ZyBhIHB0ZXZhbCBhcnJheSB0byB0aGUgcGVyIHRhc2sgc3RvcmFnZSB3aGljaCBjb250YWlucyB0 aGUgcHRldmFscwogICBvZiB0aGUgY3VycmVudGx5IGFjdGl2ZSB0ZW1wb3Jhcnkga21hcHMKCiAt IEFkZGluZyBjb250ZXh0IHN3aXRjaCBjb2RlIHdoaWNoIGNoZWNrcyB3aGV0aGVyIHRoZSBvdXRn b2luZyBvciB0aGUKICAgaW5jb21pbmcgdGFzayBoYXMgYWN0aXZlIHRlbXBvcmFyeSBrbWFwcy4g SWYgc28sIHRoZSBvdXRnb2luZyB0YXNrJ3MKICAga21hcHMgYXJlIHJlbW92ZWQgYW5kIHRoZSBp bmNvbWluZyB0YXNrJ3Mga21hcHMgYXJlIHJlc3RvcmVkLgoKIC0gQWRkaW5nIG5ldyBpbnRlcmZh Y2VzIGtbdW5dbWFwX3RlbXBvcmFyeSooKSB3aGljaCBhcmUgbm90IGRpc2FibGluZwogICBwcmVl bXB0aW9uIGFuZCBjYW4gYmUgY2FsbGVkIGZyb20gYW55IGNvbnRleHQgKGV4Y2VwdCBOTUkpLgoK ICAgQ29udHJhcnkgdG8ga21hcCgpIHdoaWNoIHByb3ZpZGVzIHByZWVtcHRpYmxlIGFuZCAicGVy c2lzdGFudCIgbWFwcGluZ3MsCiAgIHRoZXNlIGludGVyZmFjZXMgYXJlIG1lYW50IHRvIHJlcGxh Y2UgdGhlIHRlbXBvcmFyeSBtYXBwaW5ncyBwcm92aWRlZCBieQogICBrbWFwX2F0b21pYyooKSB0 b2RheS4KClRoaXMgYWxsb3dzIHRvIGdldCByaWQgb2YgY29uZGl0aW9uYWwgbWFwcGluZyBjaG9p Y2VzIGFuZCBhbGxvd3MgdG8gaGF2ZQpwcmVlbXB0aWJsZSBzaG9ydCB0ZXJtIG1hcHBpbmdzIG9u IDY0Yml0IHdoaWNoIGFyZSB0b2RheSBlbmZvcmNlZCB0byBiZQpub24tcHJlZW1wdGlibGUgZHVl IHRvIHRoZSBoaWdobWVtIGNvbnN0cmFpbnRzLiBJdCBjbGVhcmx5IHB1dHMgb3ZlcmhlYWQgb24K dGhlIGhpZ2htZW0gdXNlcnMsIGJ1dCBoaWdobWVtIGlzIHNsb3cgYW55d2F5LgoKVGhpcyBpcyBu b3QgYSB3aG9sZXNhbGUgY29udmVyc2lvbiB3aGljaCBtYWtlcyBrbWFwX2F0b21pYyBtYWdpY2Fs bHkKcHJlZW1wdGlibGUgYmVjYXVzZSB0aGVyZSBtaWdodCBiZSB1c2FnZSBzaXRlcyB3aGljaCBy ZWx5IG9uIHRoZSBpbXBsaWNpdApwcmVlbXB0IGRpc2FibGUuIFNvIHRoaXMgbmVlZHMgdG8gYmUg ZG9uZSBvbiBhIGNhc2UgYnkgY2FzZSBiYXNpcyBhbmQgdGhlCmNhbGwgc2l0ZXMgY29udmVydGVk IHRvIGttYXBfdGVtcG9yYXJ5LgoKTm90ZSwgdGhhdCB0aGlzIGlzIG9ubHkgbGlnaHRseSB0ZXN0 ZWQgb24gWDg2IGFuZCBjb21wbGV0ZWx5IHVudGVzdGVkIG9uCmFsbCBvdGhlciBhcmNoaXRlY3R1 cmVzLgoKVGhlIGxvdCBpcyBhbHNvIGF2YWlsYWJsZSBmcm9tCgogICBnaXQ6Ly9naXQua2VybmVs Lm9yZy9wdWIvc2NtL2xpbnV4L2tlcm5lbC9naXQvdGdseC9kZXZlbC5naXQgaGlnaG1lbQoKVGhh bmtzLAoKCXRnbHgKLS0tCiBhL2FyY2gvYXJtL21tL2hpZ2htZW0uYyAgICAgICAgICAgICAgIHwg IDEyMSAtLS0tLS0tLS0tLS0tLS0tLS0tLS0KIGEvYXJjaC9taWNyb2JsYXplL21tL2hpZ2htZW0u YyAgICAgICAgfCAgIDc4IC0tLS0tLS0tLS0tLS0KIGEvYXJjaC9uZHMzMi9tbS9oaWdobWVtLmMg ICAgICAgICAgICAgfCAgIDQ4IC0tLS0tLS0tCiBhL2FyY2gvcG93ZXJwYy9tbS9oaWdobWVtLmMg ICAgICAgICAgIHwgICA2NyAtLS0tLS0tLS0tLQogYS9hcmNoL3NwYXJjL21tL2hpZ2htZW0uYyAg ICAgICAgICAgICB8ICAxMTUgLS0tLS0tLS0tLS0tLS0tLS0tLS0KIGFyY2gvYXJjL0tjb25maWcg ICAgICAgICAgICAgICAgICAgICAgfCAgICAxIAogYXJjaC9hcmMvaW5jbHVkZS9hc20vaGlnaG1l bS5oICAgICAgICB8ICAgIDggKwogYXJjaC9hcmMvbW0vaGlnaG1lbS5jICAgICAgICAgICAgICAg ICB8ICAgNDQgLS0tLS0tLQogYXJjaC9hcm0vS2NvbmZpZyAgICAgICAgICAgICAgICAgICAgICB8 ICAgIDEgCiBhcmNoL2FybS9pbmNsdWRlL2FzbS9oaWdobWVtLmggICAgICAgIHwgICAzMCArKyst LQogYXJjaC9hcm0vbW0vTWFrZWZpbGUgICAgICAgICAgICAgICAgICB8ICAgIDEgCiBhcmNoL2Nz a3kvS2NvbmZpZyAgICAgICAgICAgICAgICAgICAgIHwgICAgMSAKIGFyY2gvY3NreS9pbmNsdWRl L2FzbS9oaWdobWVtLmggICAgICAgfCAgICA0IAogYXJjaC9jc2t5L21tL2hpZ2htZW0uYyAgICAg ICAgICAgICAgICB8ICAgNzUgLS0tLS0tLS0tLS0tLQogYXJjaC9taWNyb2JsYXplL0tjb25maWcg ICAgICAgICAgICAgICB8ICAgIDEgCiBhcmNoL21pY3JvYmxhemUvaW5jbHVkZS9hc20vaGlnaG1l bS5oIHwgICAgNiAtCiBhcmNoL21pY3JvYmxhemUvbW0vTWFrZWZpbGUgICAgICAgICAgIHwgICAg MSAKIGFyY2gvbWljcm9ibGF6ZS9tbS9pbml0LmMgICAgICAgICAgICAgfCAgICA2IC0KIGFyY2gv bWlwcy9LY29uZmlnICAgICAgICAgICAgICAgICAgICAgfCAgICAxIAogYXJjaC9taXBzL2luY2x1 ZGUvYXNtL2hpZ2htZW0uaCAgICAgICB8ICAgIDQgCiBhcmNoL21pcHMvbW0vaGlnaG1lbS5jICAg ICAgICAgICAgICAgIHwgICA3NyAtLS0tLS0tLS0tLS0tCiBhcmNoL21pcHMvbW0vaW5pdC5jICAg ICAgICAgICAgICAgICAgIHwgICAgMyAKIGFyY2gvbmRzMzIvS2NvbmZpZy5jcHUgICAgICAgICAg ICAgICAgfCAgICAxIAogYXJjaC9uZHMzMi9pbmNsdWRlL2FzbS9oaWdobWVtLmggICAgICB8ICAg MjEgKystCiBhcmNoL25kczMyL21tL01ha2VmaWxlICAgICAgICAgICAgICAgIHwgICAgMSAKIGFy Y2gvcG93ZXJwYy9LY29uZmlnICAgICAgICAgICAgICAgICAgfCAgICAxIAogYXJjaC9wb3dlcnBj L2luY2x1ZGUvYXNtL2hpZ2htZW0uaCAgICB8ICAgIDYgLQogYXJjaC9wb3dlcnBjL21tL01ha2Vm aWxlICAgICAgICAgICAgICB8ICAgIDEgCiBhcmNoL3Bvd2VycGMvbW0vbWVtLmMgICAgICAgICAg ICAgICAgIHwgICAgNyAtCiBhcmNoL3NwYXJjL0tjb25maWcgICAgICAgICAgICAgICAgICAgIHwg ICAgMSAKIGFyY2gvc3BhcmMvaW5jbHVkZS9hc20vaGlnaG1lbS5oICAgICAgfCAgICA3IC0KIGFy Y2gvc3BhcmMvbW0vTWFrZWZpbGUgICAgICAgICAgICAgICAgfCAgICAzIAogYXJjaC9zcGFyYy9t bS9zcm1tdS5jICAgICAgICAgICAgICAgICB8ICAgIDIgCiBhcmNoL3g4Ni9pbmNsdWRlL2FzbS9m aXhtYXAuaCAgICAgICAgIHwgICAgMSAKIGFyY2gveDg2L2luY2x1ZGUvYXNtL2hpZ2htZW0uaCAg ICAgICAgfCAgIDEyICstCiBhcmNoL3g4Ni9pbmNsdWRlL2FzbS9pb21hcC5oICAgICAgICAgIHwg ICAyOSArKystLQogYXJjaC94ODYvbW0vaGlnaG1lbV8zMi5jICAgICAgICAgICAgICB8ICAgNTkg LS0tLS0tLS0tLQogYXJjaC94ODYvbW0vaW5pdF8zMi5jICAgICAgICAgICAgICAgICB8ICAgMTUg LS0KIGFyY2gveDg2L21tL2lvbWFwXzMyLmMgICAgICAgICAgICAgICAgfCAgIDU3IC0tLS0tLS0t LS0KIGFyY2gveHRlbnNhL0tjb25maWcgICAgICAgICAgICAgICAgICAgfCAgICAxIAogYXJjaC94 dGVuc2EvaW5jbHVkZS9hc20vaGlnaG1lbS5oICAgICB8ICAgIDkgKwogYXJjaC94dGVuc2EvbW0v aGlnaG1lbS5jICAgICAgICAgICAgICB8ICAgNDQgLS0tLS0tLQogYi9hcmNoL3g4Ni9LY29uZmln ICAgICAgICAgICAgICAgICAgICB8ICAgIDMgCiBpbmNsdWRlL2xpbnV4L2hpZ2htZW0uaCAgICAg ICAgICAgICAgIHwgIDE0MSArKysrKysrKysrKysrKystLS0tLS0tLS0KIGluY2x1ZGUvbGludXgv aW8tbWFwcGluZy5oICAgICAgICAgICAgfCAgICAyIAogaW5jbHVkZS9saW51eC9zY2hlZC5oICAg ICAgICAgICAgICAgICB8ICAgIDkgKwoga2VybmVsL3NjaGVkL2NvcmUuYyAgICAgICAgICAgICAg ICAgICB8ICAgMTAgKwogbW0vS2NvbmZpZyAgICAgICAgICAgICAgICAgICAgICAgICAgICB8ICAg IDMgCiBtbS9oaWdobWVtLmMgICAgICAgICAgICAgICAgICAgICAgICAgIHwgIDE5MiArKysrKysr KysrKysrKysrKysrKysrKysrKysrKysrKy0tCiA0OSBmaWxlcyBjaGFuZ2VkLCA0MjIgaW5zZXJ0 aW9ucygrKSwgOTA5IGRlbGV0aW9ucygtKQo
RFC PATCH 1/15 mm/highmem: Un-EXPORT __kmap_atomic_idx()
Nothing in modules can use that.
--- mm/highmem.c | 2 -- 1 file changed, 2 deletions(-)
mm/highmem.c +0 -2
@@ -108,8 +108,6 @@ static inline wait_queue_head_t *get_pkmatomic_long_t _totalhigh_pages__read_mostly ;EXPORT_SYMBOL (_totalhigh_pages); -EXPORT_PER_CPU_SYMBOL (__kmap_atomic_idx); -unsigned int nr_free_highpages (void ) {struct zone *zone;
Re: [patch RFC 01/15] mm/highmem: Un-EXPORT __kmap_atomic_idx()
Quoted 3 lines · Thomas Gleixner
Nothing in modules can use that.
Signed-off-by Thomas Gleixner <[email protected]>
Looks good,
RFC PATCH 2/15 highmem: Provide generic variant of kmap_atomic*
In reply to Thomas GleixnerThe kmap_atomic* interfaces in all architectures are pretty much the same except for post map operations (flush) and pre- and post unmap operations.
Provide a generic variant for that.
--- include/linux/highmem.h | 87 ++++++++++++++++++++++++++++------- mm/Kconfig | 3 + mm/highmem.c | 119 +++++++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 192 insertions(+), 17 deletions(-)
include/linux/highmem.h +71 -16
@@ -31,9 +31,22 @@ static inline void invalidate_kernel_vma#include <asm/kmap_types.h> +/* +* Outside of CONFIG_HIGHMEM to support X86 32bit iomap_atomic() cruft. +*/ +#ifdef CONFIG_KMAP_ATOMIC_GENERIC +void *kmap_atomic_pfn_prot (unsigned long pfn,pgprot_t prot); +void *kmap_atomic_page_prot (struct page *page,pgprot_t prot); +void kunmap_atomic_indexed (void *vaddr); +# ifndef ARCH_NEEDS_KMAP_HIGH_GET +static inline void *arch_kmap_temporary_high_get (struct page *page) +{ +return NULL ; +} +# endif +#endif +#ifdef CONFIG_HIGHMEM -extern void *kmap_atomic_high_prot (struct page *page,pgprot_t prot); -extern void kunmap_atomic_high (void *kvaddr);#include <asm/highmem.h> #ifndef ARCH_HAS_KMAP_FLUSH_TLB
@@ -81,6 +94,11 @@ static inline void kunmap(struct page *p* be used in IRQ contexts, so in some (very limited) cases we need * it. */ + +#ifndef CONFIG_KMAP_ATOMIC_GENERIC +void *kmap_atomic_high_prot (struct page *page,pgprot_t prot); +void kunmap_atomic_high (void *kvaddr); +static inline void *kmap_atomic_prot (struct page *page,pgprot_t prot) {preempt_disable ();
@@ -89,7 +107,38 @@ static inline void *kmap_atomic_prot(strreturn page_address (page);return kmap_atomic_high_prot (page, prot); } -#define kmap_atomic (page) kmap_atomic_prot(page, kmap_prot) + +static inline void __kunmap_atomic (void *vaddr) +{ +kunmap_atomic_high (vaddr); +pagefault_enable (); +} +#else /* !CONFIG_KMAP_ATOMIC_GENERIC */ + +static inline void *kmap_atomic_prot (struct page *page,pgprot_t prot) +{ +preempt_disable (); +return kmap_atomic_page_prot (page, prot); +} + +static inline void *kmap_atomic_pfn (unsigned long pfn) +{ +preempt_disable (); +return kmap_atomic_pfn_prot (pfn, kmap_prot); +} + +static inline void __kunmap_atomic (void *addr) +{ +kumap_atomic_indexed (addr); +} + + +#endif /* CONFIG_KMAP_ATOMIC_GENERIC */ + +static inline void *kmap_atomic (struct page *page) +{ +return kmap_atomic_prot (page, kmap_prot); +}/* declarations for linux/mm/highmem.c */ unsigned int nr_free_highpages (void );
@@ -157,21 +206,29 @@ static inline void *kmap_atomic(struct ppagefault_disable (); return page_address(page); } -#define kmap_atomic_prot (page, prot) kmap_atomic(page) -static inline void kunmap_atomic_high (void *addr) +static inline void *kmap_atomic_prot (struct page *page,pgprot_t prot) +{ +return kmap_atomic (page); +} + +static inline void *kmap_atomic_pfn (unsigned long pfn) +{ +return kmap_atomic (pfn_to_page (pfn)); +} + +static inline void __kunmap_atomic (void *addr) {/* * Mostly nothing to do in the CONFIG_HIGHMEM=n case as kunmap_atomic() -* handles re-enabling faults + preemption +* handles preemption */ #ifdef ARCH_HAS_FLUSH_ON_KUNMAP kunmap_flush_on_unmap (addr);#endif +pagefault_enable (); } -#define kmap_atomic_pfn (pfn) kmap_atomic(pfn_to_page(pfn)) -#define kmap_flush_unused () do {} while(0)#endif /* CONFIG_HIGHMEM */
@@ -213,14 +270,12 @@ static inline void kmap_atomic_idx_pop(v* Prevent people trying to call kunmap_atomic() as if it were kunmap() * kunmap_atomic() should get the return value of kmap_atomic, not the page. */ -#define kunmap_atomic (addr) \ -do { \ - BUILD_BUG_ON(__same_type((addr), struct page *)); \ - kunmap_atomic_high(addr); \ - pagefault_enable(); \ - preempt_enable(); \ -} while (0) - +#define kunmap_atomic (addr) \ + do { \ + BUILD_BUG_ON(__same_type((addr), struct page *)); \ + __kunmap_atomic(addr); \ + preempt_enable(); \ + } while (0)/* when CONFIG_HIGHMEM is not set these will be plain clear/copy_page */ #ifndef clear_user_highpage
mm/Kconfig +3 -0
@@ -868,4 +868,7 @@ config ARCH_HAS_HUGEPD config MAPPING_DIRTY_HELPERS bool +config KMAP_ATOMIC_GENERIC + bool + endmenu
mm/highmem.c +118 -1
132 lines not on this page · raw message
Re: [patch RFC 02/15] highmem: Provide generic variant of kmap_atomic*
include/linux/highmem.h static inline void invalidate_kernel_vma · line 46
Quoted 6 lines
include/linux/highmem.h +6
-0+# ifndef ARCH_NEEDS_KMAP_HIGH_GET +static inline void *arch_kmap_temporary_high_get (struct page *page) +{ +return NULL ; +} +# endif
Turn this into a macro and use #ifndef on the symbol name?
include/linux/highmem.h static inline void *kmap_atomic_prot(str · line 136
Quoted 7 lines
include/linux/highmem.h +7
-0+static inline void __kunmap_atomic (void *addr) +{ +kumap_atomic_indexed (addr); +} + + +#endif /* CONFIG_KMAP_ATOMIC_GENERIC */
Stange double empty line above the endif.
Quoted 4 lines
include/linux/highmem.h +0
-4-#define kunmap_atomic (addr) \ -do { \ - BUILD_BUG_ON(__same_type((addr), struct page *)); \ - kunmap_atomic_high(addr); \
include/linux/highmem.h static inline void kmap_atomic_idx_pop(v · line 278
Quoted 10 lines
include/linux/highmem.h +6
-4-pagefault_enable (); \ -preempt_enable (); \ -}while (0 ) - +#define kunmap_atomic (addr) \ + do { \ + BUILD_BUG_ON(__same_type((addr), struct page *)); \ + __kunmap_atomic(addr); \ + preempt_enable(); \ + } while (0)
Why the strange re-indent to a form that is much less common and less readable?
mm/highmem.c void kunmap_high(struct page *page) · line 440
Quoted 6 lines
mm/highmem.c +6
-0+void *kmap_atomic_pfn_prot (unsigned long pfn,pgprot_t prot) +{ +pagefault_disable (); +return __kmap_atomic_pfn_prot (pfn, prot); +} +EXPORT_SYMBOL (kmap_atomic_pfn_prot);
The existing kmap_atomic_pfn & co implementation is EXPORT_SYMBOL_GPL, and this stuff should preferably stay that way.
RFC PATCH 3/15 x86/mm/highmem: Use generic kmap atomic implementation
In reply to Thomas GleixnerConvert X86 to the generic kmap atomic implementation.
Make the iomap_atomic() naming convention consistent while at it.
--- arch/x86/Kconfig | 3 +- arch/x86/include/asm/fixmap.h | 1 arch/x86/include/asm/highmem.h | 12 ++++++-- arch/x86/include/asm/iomap.h | 17 ++++++----- arch/x86/mm/highmem_32.c | 59 ----------------------------------------- arch/x86/mm/init_32.c | 15 ---------- arch/x86/mm/iomap_32.c | 58 ++-------------------------------------- include/linux/io-mapping.h | 2 - 8 files changed, 25 insertions(+), 142 deletions(-)
arch/x86/Kconfig +2 -1
@@ -14,10 +14,11 @@ config X86_32 select ARCH_WANT_IPC_PARSE_VERSION select CLKSRC_I8253 select CLONE_BACKWARDS + select GENERIC_VDSO_32 select HAVE_DEBUG_STACKOVERFLOW + select KMAP_ATOMIC_GENERIC select MODULES_USE_ELF_REL select OLD_SIGACTION - select GENERIC_VDSO_32 config X86_64 def_bool y
arch/x86/include/asm/fixmap.h +0 -1
@@ -151,7 +151,6 @@ extern void reserve_top_address(unsignedextern int fixmaps_set; -extern pte_t *kmap_pte;extern pte_t *pkmap_page_table;void __native_set_fixmap (enum fixed_addresses idx,pte_t pte);
arch/x86/include/asm/highmem.h +9 -3
@@ -58,11 +58,17 @@ extern unsigned long highstart_pfn, high#define PKMAP_NR (virt) ((virt-PKMAP_BASE) >> PAGE_SHIFT)#define PKMAP_ADDR (nr) (PKMAP_BASE + ((nr) << PAGE_SHIFT)) -void *kmap_atomic_pfn (unsigned long pfn); -void *kmap_atomic_prot_pfn (unsigned long pfn,pgprot_t prot); -#define flush_cache_kmaps () do { } while (0) +#define arch_kmap_temp_post_map (vaddr, pteval) \ + arch_flush_lazy_mmu_mode() + +#define arch_kmap_temp_post_unmap (vaddr) \ + do { \ + flush_tlb_one_kernel((vaddr)); \ + arch_flush_lazy_mmu_mode(); \ + } while (0) +extern void add_highpages_with_active_regions (int nid,unsigned long start_pfn,unsigned long end_pfn);
arch/x86/include/asm/iomap.h +9 -8
@@ -9,19 +9,20 @@#include <linux/fs.h> #include <linux/mm.h> #include <linux/uaccess.h> +#include <linux/highmem.h> #include <asm/cacheflush.h> #include <asm/tlbflush.h> -void __iomem * -iomap_atomic_prot_pfn (unsigned long pfn,pgprot_t prot); +void __iomem *iomap_atomic_pfn_prot (unsigned long pfn,pgprot_t prot); -void -iounmap_atomic (void __iomem *kvaddr); +static inline void iounmap_atomic (void __iomem *vaddr) +{ +kunmap_atomic_indexed ((void __force *)vaddr); +preempt_enable (); +} -int -iomap_create_wc (resource_size_t base,unsigned long size,pgprot_t *prot); +int iomap_create_wc (resource_size_t base,unsigned long size,pgprot_t *prot); -void -iomap_free (resource_size_t base,unsigned long size); +void iomap_free (resource_size_t base,unsigned long size);#endif /* _ASM_X86_IOMAP_H */
arch/x86/mm/highmem_32.c +0 -59
65 lines not on this page · raw message
arch/x86/mm/init_32.c +0 -15
@@ -394,19 +394,6 @@ kernel_physical_mapping_init(unsigned loreturn last_map_addr; } -pte_t *kmap_pte; - -static void __init kmap_init (void ) -{ -unsigned long kmap_vstart; - -/* -* Cache the first kmap pte: -*/ - kmap_vstart =__fix_to_virt (FIX_KMAP_BEGIN ); - kmap_pte =virt_to_kpte (kmap_vstart); -} -#ifdef CONFIG_HIGHMEM static void __init permanent_kmaps_init (pgd_t *pgd_base) {
@@ -712,8 +699,6 @@ void __init paging_init(void)__flush_tlb_all (); -kmap_init (); -/* * NOTE: at this point the bootmem allocator is fully available. */
arch/x86/mm/iomap_32.c +4 -54
68 lines not on this page · raw message
include/linux/io-mapping.h +1 -1
@@ -69,7 +69,7 @@ io_mapping_map_atomic_wc(struct io_mappiBUG_ON (offset >= mapping->size); phys_addr = mapping->base + offset; -return iomap_atomic_prot_pfn (PHYS_PFN (phys_addr), mapping->prot); +return iomap_atomic_pfn_prot (PHYS_PFN (phys_addr), mapping->prot); } static inline void
RFC PATCH 4/15 arc/mm/highmem: Use generic kmap atomic implementation
In reply to Thomas GleixnerAdopt the map ordering to match the other architectures and the generic code.
---
Note: Completely untested
--- arch/arc/Kconfig | 1 arch/arc/include/asm/highmem.h | 8 ++++++- arch/arc/mm/highmem.c | 44 ----------------------------------------- 3 files changed, 9 insertions(+), 44 deletions(-)
arch/arc/Kconfig +1 -0
@@ -508,6 +508,7 @@ config LINUX_RAM_BASE config HIGHMEM bool "High Memory Support" select ARCH_DISCONTIGMEM_ENABLE + select KMAP_ATOMIC_GENERIC help With ARC 2G:2G address split, only upper 2G is directly addressable by kernel. Enable this to potentially allow access to rest of 2G and PAE
arch/arc/include/asm/highmem.h +7 -1
@@ -15,7 +15,10 @@#define FIXMAP_BASE (PAGE_OFFSET - FIXMAP_SIZE - PKMAP_SIZE)#define FIXMAP_SIZE PGDIR_SIZE/* only 1 PGD worth */ #define KM_TYPE_NR ((FIXMAP_SIZE >> PAGE_SHIFT)/NR_CPUS) -#define FIXMAP_ADDR (nr) (FIXMAP_BASE + ((nr) << PAGE_SHIFT)) + +#define FIX_KMAP_BEGIN (0) +#define FIX_KMAP_END ((FIXMAP_SIZE >> PAGE_SHIFT) - 1) +#define FIXADDR_TOP (FIXMAP_BASE + FIXMAP_SIZE - PAGE_SIZE)/* start after fixmap area */ #define PKMAP_BASE (FIXMAP_BASE + FIXMAP_SIZE)
@@ -29,6 +32,9 @@extern void kmap_init (void ); +#define arch_kmap_temp_post_unmap (vaddr) \ + local_flush_tlb_kernel_range(vaddr, vaddr + PAGE_SIZE) +static inline void flush_cache_kmaps (void ) {flush_cache_all ();
arch/arc/mm/highmem.c +1 -43
54 lines not on this page · raw message
RFC PATCH 5/15 ARM: highmem: Switch to generic kmap atomic
In reply to Thomas Gleixner---
Note: Completely untested
--- arch/arm/Kconfig | 1 arch/arm/include/asm/highmem.h | 30 +++++++--- arch/arm/mm/Makefile | 1 arch/arm/mm/highmem.c | 121 ----------------------------------------- 4 files changed, 23 insertions(+), 130 deletions(-)
arch/arm/Kconfig +1 -0
@@ -1499,6 +1499,7 @@ config HAVE_ARCH_PFN_VALID config HIGHMEM bool "High Memory Support" depends on MMU + select KMAP_ATOMIC_GENERIC help The address space of ARM processors is only 4 Gigabytes large and it has to accommodate user address space, kernel address
arch/arm/include/asm/highmem.h +22 -8
@@ -46,19 +46,33 @@ extern pte_t *pkmap_page_table;#ifdef ARCH_NEEDS_KMAP_HIGH_GET extern void *kmap_high_get (struct page *page); + +#ifdef CONFIG_DEBUG_HIGHMEM +extern void *arch_kmap_temporary_high_get (struct page *page);#else +static inline void *arch_kmap_temporary_high_get (struct page *page) +{ +return kmap_high_get (page); +} +#endif /* !CONFIG_DEBUG_HIGHMEM */ + +#else /* ARCH_NEEDS_KMAP_HIGH_GET */ static inline void *kmap_high_get (struct page *page) {return NULL ; } -#endif +#endif /* !ARCH_NEEDS_KMAP_HIGH_GET */ -/* -* The following functions are already defined by <linux/highmem.h> -* when CONFIG_HIGHMEM is not set. -*/ -#ifdef CONFIG_HIGHMEM -extern void *kmap_atomic_pfn (unsigned long pfn); -#endif +#define arch_kmap_temp_post_map (vaddr, pteval) \ + local_flush_tlb_kernel_page(vaddr) + +#define arch_kmap_temp_pre_unmap (vaddr) \ +do { \ + if (cache_is_vivt()) \ + __cpuc_flush_dcache_area((void *)vaddr, PAGE_SIZE); \ +} while (0) + +#define arch_kmap_temp_post_unmap (vaddr) \ + local_flush_tlb_kernel_page(vaddr)#endif
arch/arm/mm/Makefile +0 -1
@@ -19,7 +19,6 @@ obj-$(CONFIG_MODULES) += proc-syms.o obj-$(CONFIG_DEBUG_VIRTUAL) += physaddr.o obj-$(CONFIG_ALIGNMENT_TRAP) += alignment.o -obj-$(CONFIG_HIGHMEM) += highmem.o obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o obj-$(CONFIG_ARM_PV_FIXUP) += pv-fixup-asm.o
arch/arm/mm/highmem.c deleted +0 -121
121 lines not on this page · raw message
RFC PATCH 6/15 csky/mm/highmem: Switch to generic kmap atomic
In reply to Thomas Gleixner---
Note: Completely untested
--- arch/csky/Kconfig | 1 arch/csky/include/asm/highmem.h | 4 +- arch/csky/mm/highmem.c | 75 ---------------------------------------- 3 files changed, 5 insertions(+), 75 deletions(-)
arch/csky/Kconfig +1 -0
@@ -285,6 +285,7 @@ config NR_CPUS config HIGHMEM bool "High Memory Support" depends on !CPU_CK610 + select KMAP_ATOMIC_GENERIC default y config FORCE_MAX_ZONEORDER
arch/csky/include/asm/highmem.h +3 -1
@@ -32,10 +32,12 @@ extern pte_t *pkmap_page_table;#define ARCH_HAS_KMAP_FLUSH_TLB extern void kmap_flush_tlb (unsigned long addr); -extern void *kmap_atomic_pfn (unsigned long pfn);#define flush_cache_kmaps () do {} while (0) +#define arch_kmap_temp_post_map (vaddr, pteval) kmap_flush_tlb(vaddr) +#define arch_kmap_temp_post_unmap (vaddr) kmap_flush_tlb(vaddr) +extern void kmap_init (void );#endif /* __KERNEL__ */
arch/csky/mm/highmem.c +1 -74
90 lines not on this page · raw message
Re: [patch RFC 06/15] csky/mm/highmem: Switch to generic kmap atomic
Quoted 134 lines · Thomas Gleixner
---
Note: Completely untested--- arch/csky/Kconfig | 1 arch/csky/include/asm/highmem.h | 4 +- arch/csky/mm/highmem.c | 75 ---------------------------------------- 3 files changed, 5 insertions(+), 75 deletions(-)arch/csky/Kconfig +1
-0@@ -285,6 +285,7 @@ config NR_CPUS config HIGHMEM bool "High Memory Support" depends on !CPU_CK610 + select KMAP_ATOMIC_GENERIC default y config FORCE_MAX_ZONEORDERarch/csky/include/asm/highmem.h +3
-1@@ -32,10 +32,12 @@ extern pte_t *pkmap_page_table;#define ARCH_HAS_KMAP_FLUSH_TLB extern void kmap_flush_tlb (unsigned long addr); -extern void *kmap_atomic_pfn (unsigned long pfn);#define flush_cache_kmaps () do {} while (0) +#define arch_kmap_temp_post_map (vaddr, pteval) kmap_flush_tlb(vaddr) +#define arch_kmap_temp_post_unmap (vaddr) kmap_flush_tlb(vaddr) +extern void kmap_init (void );#endif /* __KERNEL__ */ arch/csky/mm/highmem.c +1
-74@@ -9,8 +9,6 @@#include <asm/tlbflush.h> #include <asm/cacheflush.h> -static pte_t *kmap_pte; -unsigned long highstart_pfn, highend_pfn;void kmap_flush_tlb (unsigned long addr)@@ -19,67 +17,7 @@ void kmap_flush_tlb(unsigned long addr) }EXPORT_SYMBOL (kmap_flush_tlb); -void *kmap_atomic_high_prot (struct page *page,pgprot_t prot) -{ -unsigned long vaddr; -int idx, type; - - type =kmap_atomic_idx_push (); - idx = type +KM_TYPE_NR *smp_processor_id (); - vaddr =__fix_to_virt (FIX_KMAP_BEGIN + idx); -#ifdef CONFIG_DEBUG_HIGHMEM -BUG_ON (!pte_none (*(kmap_pte - idx))); -#endif -set_pte (kmap_pte-idx,mk_pte (page, prot)); -flush_tlb_one ((unsigned long )vaddr); - -return (void *)vaddr; -} -EXPORT_SYMBOL (kmap_atomic_high_prot); - -void kunmap_atomic_high (void *kvaddr) -{ -unsigned long vaddr = (unsigned long ) kvaddr &PAGE_MASK ; -int idx; - -if (vaddr <FIXADDR_START ) -return ; - -#ifdef CONFIG_DEBUG_HIGHMEM - idx =KM_TYPE_NR *smp_processor_id () +kmap_atomic_idx (); - -BUG_ON (vaddr !=__fix_to_virt (FIX_KMAP_BEGIN + idx)); - -pte_clear (&init_mm, vaddr, kmap_pte - idx); -flush_tlb_one (vaddr); -#else - (void ) idx;/* to kill a warning */ -#endif -kmap_atomic_idx_pop (); -} -EXPORT_SYMBOL (kunmap_atomic_high); - -/* -* This is the same as kmap_atomic() but can map memory that doesn't -* have a struct page associated with it. -*/ -void *kmap_atomic_pfn (unsigned long pfn) -{ -unsigned long vaddr; -int idx, type; - -pagefault_disable (); - - type =kmap_atomic_idx_push (); - idx = type +KM_TYPE_NR *smp_processor_id (); - vaddr =__fix_to_virt (FIX_KMAP_BEGIN + idx); -set_pte (kmap_pte-idx,pfn_pte (pfn,PAGE_KERNEL )); -flush_tlb_one (vaddr); - -return (void *) vaddr; -} - -static void __init kmap_pages_init (void ) +void __init kmap_init (void ) {unsigned long vaddr;pgd_t *pgd;@@ -96,14 +34,3 @@ static void __init kmap_pages_init(void) pte =pte_offset_kernel (pmd, vaddr); pkmap_page_table = pte; } - -void __init kmap_init (void ) -{ -unsigned long vaddr; - -kmap_pages_init (); - - vaddr =__fix_to_virt (FIX_KMAP_BEGIN ); - - kmap_pte =pte_offset_kernel ((pmd_t *)pgd_offset_k (vaddr), vaddr); -}
Signature · 4 lines
Best Regards Guo Ren ML: https://lore.kernel.org/linux-csky/
RFC PATCH 7/15 microblaze/mm/highmem: Switch to generic kmap atomic
In reply to Thomas Gleixner---
Note: Completely untested
--- arch/microblaze/Kconfig | 1 arch/microblaze/include/asm/highmem.h | 6 ++ arch/microblaze/mm/Makefile | 1 arch/microblaze/mm/highmem.c | 78 ---------------------------------- arch/microblaze/mm/init.c | 6 -- 5 files changed, 6 insertions(+), 86 deletions(-)
arch/microblaze/Kconfig +1 -0
@@ -170,6 +170,7 @@ config XILINX_UNCACHED_SHADOW config HIGHMEM bool "High memory support" depends on MMU + select KMAP_ATOMIC_GENERIC help The address space of Microblaze processors is only 4 Gigabytes large and it has to accommodate user address space, kernel address
arch/microblaze/include/asm/highmem.h +5 -1
@@ -25,7 +25,6 @@#include <linux/uaccess.h> #include <asm/fixmap.h> -extern pte_t *kmap_pte;extern pte_t *pkmap_page_table;/*
@@ -52,6 +51,11 @@ extern pte_t *pkmap_page_table;#define flush_cache_kmaps () { flush_icache(); flush_dcache(); } +#define arch_kmap_temp_post_map (vaddr, pteval) \ + local_flush_tlb_page(NULL, vaddr); +#define arch_kmap_temp_post_unmap (vaddr) \ + local_flush_tlb_page(NULL, vaddr); +#endif /* __KERNEL__ */ #endif /* _ASM_HIGHMEM_H */
arch/microblaze/mm/Makefile +0 -1
@@ -6,4 +6,3 @@ obj-y := consistent.o init.o obj-$(CONFIG_MMU) += pgtable.o mmu_context.o fault.o -obj-$(CONFIG_HIGHMEM) += highmem.o
arch/microblaze/mm/highmem.c deleted +0 -78
78 lines not on this page · raw message
arch/microblaze/mm/init.c +0 -6
@@ -49,17 +49,11 @@ unsigned long lowmem_size;EXPORT_SYMBOL (min_low_pfn);EXPORT_SYMBOL (max_low_pfn); -#ifdef CONFIG_HIGHMEM -pte_t *kmap_pte; -EXPORT_SYMBOL (kmap_pte); -static void __init highmem_init (void ) {pr_debug ("%x\n" , (u32 )PKMAP_BASE );map_page (PKMAP_BASE ,0 ,0 );/* XXX gross */ pkmap_page_table =virt_to_kpte (PKMAP_BASE ); - - kmap_pte =virt_to_kpte (__fix_to_virt (FIX_KMAP_BEGIN )); }static void highmem_setup (void )
RFC PATCH 8/15 mips/mm/highmem: Switch to generic kmap atomic
In reply to Thomas Gleixner---
Note: Completely untested
--- arch/mips/Kconfig | 1 arch/mips/include/asm/highmem.h | 4 +- arch/mips/mm/highmem.c | 77 ---------------------------------------- arch/mips/mm/init.c | 3 - 4 files changed, 3 insertions(+), 82 deletions(-)
arch/mips/Kconfig +1 -0
@@ -2654,6 +2654,7 @@ config MIPS_CRC_SUPPORT config HIGHMEM bool "High Memory Support" depends on 32BIT && CPU_SUPPORTS_HIGHMEM && SYS_SUPPORTS_HIGHMEM && !CPU_MIPS32_3_5_EVA + select KMAP_ATOMIC_GENERIC config CPU_SUPPORTS_HIGHMEM bool
arch/mips/include/asm/highmem.h +2 -2
@@ -48,11 +48,11 @@ extern pte_t *pkmap_page_table;#define ARCH_HAS_KMAP_FLUSH_TLB extern void kmap_flush_tlb (unsigned long addr); -extern void *kmap_atomic_pfn (unsigned long pfn);#define flush_cache_kmaps () BUG_ON(cpu_has_dc_aliases) -extern void kmap_init (void ); +#define arch_kmap_temp_post_map (vaddr, pteval) local_flush_tlb_one(vaddr) +#define arch_kmap_temp_post_unmap (vaddr) local_flush_tlb_one(vaddr)#endif /* __KERNEL__ */
arch/mips/mm/highmem.c +0 -77
86 lines not on this page · raw message
arch/mips/mm/init.c +0 -3
@@ -402,9 +402,6 @@ void __init paging_init(void)pagetable_init (); -#ifdef CONFIG_HIGHMEM -kmap_init (); -#endif #ifdef CONFIG_ZONE_DMA max_zone_pfns[ZONE_DMA ] =MAX_DMA_PFN ;#endif
RFC PATCH 9/15 nds32/mm/highmem: Switch to generic kmap atomic
In reply to Thomas GleixnerThe mapping code is odd and looks broken. See FIXME in the comment.
---
Note: Completely untested
--- arch/nds32/Kconfig.cpu | 1 arch/nds32/include/asm/highmem.h | 21 +++++++++++++---- arch/nds32/mm/Makefile | 1 arch/nds32/mm/highmem.c | 48 --------------------------------------- 4 files changed, 17 insertions(+), 54 deletions(-)
arch/nds32/Kconfig.cpu +1 -0
@@ -157,6 +157,7 @@ config HW_SUPPORT_UNALIGNMENT_ACCESS config HIGHMEM bool "High Memory Support" depends on MMU && !CPU_CACHE_ALIASING + select KMAP_ATOMIC_GENERIC help The address space of Andes processors is only 4 Gigabytes large and it has to accommodate user address space, kernel address
arch/nds32/include/asm/highmem.h +16 -5
@@ -45,11 +45,22 @@ extern pte_t *pkmap_page_table;extern void kmap_init (void );/* -* The following functions are already defined by <linux/highmem.h> -* when CONFIG_HIGHMEM is not set. +* FIXME: The below looks broken vs. a kmap_atomic() in task context which +* is interupted and another kmap_atomic() happens in interrupt context. +* But what do I know about nds32. -- tglx */ -#ifdef CONFIG_HIGHMEM -extern void *kmap_atomic_pfn (unsigned long pfn); -#endif +#define arch_kmap_temp_post_map (vaddr, pteval) \ + do { \ + __nds32__tlbop_inv(vaddr); \ + __nds32__mtsr_dsb(vaddr, NDS32_SR_TLB_VPN); \ + __nds32__tlbop_rwr(pteval); \ + __nds32__isb(); \ + } while (0) + +#define arch_kmap_temp_pre_unmap (vaddr, pte) \ + do { \ + __nds32__tlbop_inv(vaddr); \ + __nds32__isb(); \ + } while (0)#endif
arch/nds32/mm/Makefile +0 -1
@@ -3,7 +3,6 @@ obj-y := extable.o tlb.o fault.o init mm-nds32.o cacheflush.o proc.o obj-$(CONFIG_ALIGNMENT_TRAP) += alignment.o -obj-$(CONFIG_HIGHMEM) += highmem.o ifdef CONFIG_FUNCTION_TRACER CFLAGS_REMOVE_proc.o = $(CC_FLAGS_FTRACE)
arch/nds32/mm/highmem.c deleted +0 -48
48 lines not on this page · raw message
RFC PATCH 10/15 powerpc/mm/highmem: Switch to generic kmap atomic
In reply to Thomas Gleixner---
Note: Completely untested
--- arch/powerpc/Kconfig | 1 arch/powerpc/include/asm/highmem.h | 6 ++- arch/powerpc/mm/Makefile | 1 arch/powerpc/mm/highmem.c | 67 ------------------------------------- arch/powerpc/mm/mem.c | 7 --- 5 files changed, 6 insertions(+), 76 deletions(-)
arch/powerpc/Kconfig +1 -0
@@ -406,6 +406,7 @@ menu "Kernel options" config HIGHMEM bool "High memory support" depends on PPC32 + select KMAP_ATOMIC_GENERIC source "kernel/Kconfig.hz"
arch/powerpc/include/asm/highmem.h +5 -1
@@ -29,7 +29,6 @@#include <asm/page.h> #include <asm/fixmap.h> -extern pte_t *kmap_pte;extern pte_t *pkmap_page_table;/*
@@ -60,6 +59,11 @@ extern pte_t *pkmap_page_table;#define flush_cache_kmaps () flush_cache_all() +#define arch_kmap_temp_post_map (vaddr, pteval) \ + local_flush_tlb_page(NULL, vaddr) +#define arch_kmap_temp_post_unmap (vaddr) \ + local_flush_tlb_page(NULL, vaddr) +#endif /* __KERNEL__ */ #endif /* _ASM_HIGHMEM_H */
arch/powerpc/mm/Makefile +0 -1
@@ -16,7 +16,6 @@ obj-$(CONFIG_NEED_MULTIPLE_NODES) += num obj-$(CONFIG_PPC_MM_SLICES) += slice.o obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o obj-$(CONFIG_NOT_COHERENT_CACHE) += dma-noncoherent.o -obj-$(CONFIG_HIGHMEM) += highmem.o obj-$(CONFIG_PPC_COPRO_BASE) += copro_fault.o obj-$(CONFIG_PPC_PTDUMP) += ptdump/ obj-$(CONFIG_KASAN) += kasan/
arch/powerpc/mm/highmem.c deleted +0 -67
67 lines not on this page · raw message
arch/powerpc/mm/mem.c +0 -7
@@ -60,11 +60,6 @@unsigned long long memory_limit;bool init_mem_is_free; -#ifdef CONFIG_HIGHMEM -pte_t *kmap_pte; -EXPORT_SYMBOL (kmap_pte); -#endif -pgprot_t phys_mem_access_prot (struct file *file,unsigned long pfn,unsigned long size,pgprot_t vma_prot) {
@@ -233,8 +228,6 @@ void __init paging_init(void)map_kernel_page (PKMAP_BASE ,0 ,__pgprot (0 ));/* XXX gross */ pkmap_page_table =virt_to_kpte (PKMAP_BASE ); - - kmap_pte =virt_to_kpte (__fix_to_virt (FIX_KMAP_BEGIN ));#endif /* CONFIG_HIGHMEM */ printk(KERN_DEBUG "Top of RAM: 0x%llx, Total RAM: 0x%llx\n",
RFC PATCH 11/15 sparc/mm/highmem: Switch to generic kmap atomic
In reply to Thomas Gleixner---
Note: Completely untested
--- arch/sparc/Kconfig | 1 arch/sparc/include/asm/highmem.h | 7 +- arch/sparc/mm/Makefile | 3 - arch/sparc/mm/highmem.c | 115 --------------------------------------- arch/sparc/mm/srmmu.c | 2 5 files changed, 6 insertions(+), 122 deletions(-)
arch/sparc/Kconfig +1 -0
@@ -137,6 +137,7 @@ config MMU config HIGHMEM bool default y if SPARC32 + select KMAP_ATOMIC_GENERIC config ZONE_DMA bool
arch/sparc/include/asm/highmem.h +5 -2
@@ -33,8 +33,6 @@ extern unsigned long highstart_pfn, high#define kmap_prot __pgprot(SRMMU_ET_PTE | SRMMU_PRIV | SRMMU_CACHE)extern pte_t *pkmap_page_table; -void kmap_init (void )__init ; -/* * Right now we initialize only a single pte table. It can be extended * easily, subsequent pte tables have to be allocated in one physical
@@ -53,6 +51,11 @@ void kmap_init(void) __init;#define flush_cache_kmaps () flush_cache_all() +/* FIXME: Use __flush_tlb_one(vaddr) instead of flush_cache_all() -- Anton */ +#define arch_kmap_temp_post_map (vaddr, pteval) flush_cache_all() +#define arch_kmap_temp_post_unmap (vaddr) flush_cache_all() + +#endif /* __KERNEL__ */ #endif /* _ASM_HIGHMEM_H */
arch/sparc/mm/Makefile +0 -3
@@ -15,6 +15,3 @@ obj-$(CONFIG_SPARC32) += leon_mm.o # Only used by sparc64 obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o - -# Only used by sparc32 -obj-$(CONFIG_HIGHMEM) += highmem.o
arch/sparc/mm/highmem.c deleted +0 -115
115 lines not on this page · raw message
arch/sparc/mm/srmmu.c +0 -2
@@ -971,8 +971,6 @@ void __init srmmu_paging_init(void)sparc_context_init (num_contexts); -kmap_init (); - {unsigned long max_zone_pfn[MAX_NR_ZONES ] = {0 };
RFC PATCH 12/15 xtensa/mm/highmem: Switch to generic kmap atomic
In reply to Thomas Gleixner---
Note: Completely untested
--- arch/xtensa/Kconfig | 1 arch/xtensa/include/asm/highmem.h | 9 +++++++ arch/xtensa/mm/highmem.c | 44 +++----------------------------------- 3 files changed, 14 insertions(+), 40 deletions(-)
arch/xtensa/Kconfig +1 -0
@@ -679,6 +679,7 @@ endchoice config HIGHMEM bool "High Memory Support" depends on MMU + select KMAP_ATOMIC_GENERIC help Linux can use the full amount of RAM in the system by default. However, the default MMUv2 setup only maps the
arch/xtensa/include/asm/highmem.h +9 -0
@@ -68,6 +68,15 @@ static inline void flush_cache_kmaps(voi flush_cache_all(); } +enum fixed_addresses kmap_temp_map_idx (int type,unsigned long pfn); +#define arch_kmap_temp_map_idx kmap_temp_map_idx + +enum fixed_addresses kmap_temp_unmap_idx (int type,unsigned long addr); +#define arch_kmap_temp_unmap_idx kmap_temp_unmap_idx + +#define arch_kmap_temp_post_unmap (vaddr) \ + local_flush_tlb_kernel_range(vaddr, vaddr + PAGE_SIZE) +void kmap_init (void );#endif
arch/xtensa/mm/highmem.c +4 -40
67 lines not on this page · raw message
RFC PATCH 13/15 mm/highmem: Remove the old kmap_atomic cruft
In reply to Thomas Gleixner--- include/linux/highmem.h | 65 ++---------------------------------------------- mm/highmem.c | 28 +++++++++++++++++--- 2 files changed, 28 insertions(+), 65 deletions(-)
include/linux/highmem.h +4 -61
@@ -94,27 +94,6 @@ static inline void kunmap(struct page *p* be used in IRQ contexts, so in some (very limited) cases we need * it. */ - -#ifndef CONFIG_KMAP_ATOMIC_GENERIC -void *kmap_atomic_high_prot (struct page *page,pgprot_t prot); -void kunmap_atomic_high (void *kvaddr); - -static inline void *kmap_atomic_prot (struct page *page,pgprot_t prot) -{ -preempt_disable (); -pagefault_disable (); -if (!PageHighMem (page)) -return page_address (page); -return kmap_atomic_high_prot (page, prot); -} - -static inline void __kunmap_atomic (void *vaddr) -{ -kunmap_atomic_high (vaddr); -pagefault_enable (); -} -#else /* !CONFIG_KMAP_ATOMIC_GENERIC */ -static inline void *kmap_atomic_prot (struct page *page,pgprot_t prot) {preempt_disable ();
@@ -127,17 +106,14 @@ static inline void *kmap_atomic_pfn(unsireturn kmap_atomic_pfn_prot (pfn, kmap_prot); } -static inline void __kunmap_atomic (void *addr) +static inline void *kmap_atomic (struct page *page) { -kumap_atomic_indexed (addr); +return kmap_atomic_prot (page, kmap_prot); } - -#endif /* CONFIG_KMAP_ATOMIC_GENERIC */ - -static inline void *kmap_atomic (struct page *page) +static inline void __kunmap_atomic (void *addr) { -return kmap_atomic_prot (page, kmap_prot); +kumap_atomic_indexed (addr); }/* declarations for linux/mm/highmem.c */
@@ -233,39 +209,6 @@ static inline void __kunmap_atomic(void#endif /* CONFIG_HIGHMEM */ -#if defined(CONFIG_HIGHMEM ) || defined(CONFIG_X86_32 ) - -DECLARE_PER_CPU (int, __kmap_atomic_idx); - -static inline int kmap_atomic_idx_push (void ) -{ -int idx =__this_cpu_inc_return (__kmap_atomic_idx) -1 ; - -#ifdef CONFIG_DEBUG_HIGHMEM -WARN_ON_ONCE (in_irq () && !irqs_disabled ()); -BUG_ON (idx >=KM_TYPE_NR ); -#endif -return idx; -} - -static inline int kmap_atomic_idx (void ) -{ -return __this_cpu_read (__kmap_atomic_idx) -1 ; -} - -static inline void kmap_atomic_idx_pop (void ) -{ -#ifdef CONFIG_DEBUG_HIGHMEM -int idx =__this_cpu_dec_return (__kmap_atomic_idx); - -BUG_ON (idx <0 ); -#else -__this_cpu_dec (__kmap_atomic_idx); -#endif -} - -#endif -/* * Prevent people trying to call kunmap_atomic() as if it were kunmap() * kunmap_atomic() should get the return value of kmap_atomic, not the page.
mm/highmem.c +24 -4
@@ -31,10 +31,6 @@#include <asm/tlbflush.h> #include <linux/vmalloc.h> -#if defined(CONFIG_HIGHMEM ) || defined(CONFIG_X86_32 ) -DEFINE_PER_CPU (int, __kmap_atomic_idx); -#endif -/* * Virtual_count is not a pure "count". * 0 means that it is not mapped, and has not been mapped
@@ -380,6 +376,30 @@ static inline void kmap_high_unmap_tempo#endif /* CONFIG_HIGHMEM */ #ifdef CONFIG_KMAP_ATOMIC_GENERIC + +static DEFINE_PER_CPU(int, __kmap_atomic_idx); + +static inline int kmap_atomic_idx_push (void ) +{ +int idx =__this_cpu_inc_return (__kmap_atomic_idx) -1 ; + +WARN_ON_ONCE (in_irq () && !irqs_disabled ()); +BUG_ON (idx >=KM_TYPE_NR ); +return idx; +} + +static inline int kmap_atomic_idx (void ) +{ +return __this_cpu_read (__kmap_atomic_idx) -1 ; +} + +static inline void kmap_atomic_idx_pop (void ) +{ +int idx =__this_cpu_dec_return (__kmap_atomic_idx); + +BUG_ON (idx <0 ); +} +#ifndef arch_kmap_temp_post_map# define arch_kmap_temp_post_map (vaddr, pteval) do { } while (0)#endif
RFC PATCH 14/15 sched: highmem: Store temporary kmaps in task struct
In reply to Thomas GleixnerInstead of storing the map per CPU provide and use per task storage. That prepares for temporary kmaps which are preemptible.
The context switch code is preparatory and not yet in use because kmap_atomic() runs with preemption disabled. Will be made usable in the next step.
--- include/linux/highmem.h | 1 include/linux/sched.h | 9 +++++++ kernel/sched/core.c | 10 ++++++++ mm/highmem.c | 59 ++++++++++++++++++++++++++++++++++++++++++------ 4 files changed, 72 insertions(+), 7 deletions(-)
include/linux/highmem.h +1 -0
@@ -38,6 +38,7 @@ static inline void invalidate_kernel_vmavoid *kmap_atomic_pfn_prot (unsigned long pfn,pgprot_t prot);void *kmap_atomic_page_prot (struct page *page,pgprot_t prot);void kunmap_atomic_indexed (void *vaddr); +void kmap_switch_temporary (struct task_struct *prev,struct task_struct *next);# ifndef ARCH_NEEDS_KMAP_HIGH_GET static inline void *arch_kmap_temporary_high_get (struct page *page) {
include/linux/sched.h +9 -0
@@ -34,6 +34,7 @@#include <linux/rseq.h> #include <linux/seqlock.h> #include <linux/kcsan.h> +#include <asm/kmap_types.h> /* task_struct member predeclarations (sorted alphabetically): */ struct audit_context ;
@@ -628,6 +629,13 @@ struct wake_q_node {struct wake_q_node *next; }; +struct kmap_ctrl { +#ifdef CONFIG_KMAP_ATOMIC_GENERIC +int idx; +pte_t pteval[KM_TYPE_NR ]; +#endif +}; +struct task_struct {#ifdef CONFIG_THREAD_INFO_IN_TASK /*
@@ -1280,6 +1288,7 @@ struct task_struct {unsigned int sequential_io;unsigned int sequential_io_avg;#endif +struct kmap_ctrl kmap_ctrl;#ifdef CONFIG_DEBUG_ATOMIC_SLEEP unsigned long task_state_change;#endif
kernel/sched/core.c +10 -0
@@ -3529,6 +3529,15 @@ static inline void finish_lock_switch(st# define finish_arch_post_lock_switch () do { } while (0)#endif +static inline void kmap_temp_switch (struct task_struct *prev, +struct task_struct *next) +{ +#ifdef CONFIG_HIGHMEM +if (unlikely (prev->kmap_ctrl.idx || next->kmap_ctrl.idx)) +kmap_switch_temporary (prev, next); +#endif +} +/** * prepare_task_switch - prepare to switch tasks * @rq: the runqueue preparing to switch
@@ -3551,6 +3560,7 @@ prepare_task_switch(struct rq *rq, strucperf_event_task_sched_out (prev, next);rseq_preempt (prev);fire_sched_out_preempt_notifiers (prev, next); +kmap_temp_switch (prev, next);prepare_task (next);prepare_arch_switch (next); }
mm/highmem.c +52 -7
100 lines not on this page · raw message
RFC PATCH 15/15 mm/highmem: Provide kmap_temporary*
In reply to Thomas GleixnerNow that the kmap atomic index is stored in task struct provide a preemptible variant. On context switch the maps of an outgoing task are removed and the map of the incoming task are restored. That's obviously slow, but highmem is slow anyway.
The kmap_temporary and iomap_temporary interfaces can be invoked from both preemptible and atomic context.
A wholesale conversion of kmap_atomic to be fully preemptible is not possible because some of the usage sites might rely on the preemption disable for serialization or per CPUness. Needs to be done on a case by case basis.
--- arch/x86/include/asm/iomap.h | 16 ++++++++- arch/x86/mm/iomap_32.c | 7 +--- include/linux/highmem.h | 70 +++++++++++++++++++++++++++++++++---------- mm/highmem.c | 18 +++++------ 4 files changed, 80 insertions(+), 31 deletions(-)
arch/x86/include/asm/iomap.h +14 -2
@@ -13,11 +13,23 @@#include <asm/cacheflush.h> #include <asm/tlbflush.h> -void __iomem *iomap_atomic_pfn_prot (unsigned long pfn,pgprot_t prot); +void __iomem *iomap_temporary_pfn_prot (unsigned long pfn,pgprot_t prot); + +static inline void __iomem *iomap_atomic_pfn_prot (unsigned long pfn, +pgprot_t prot) +{ +preempt_disable (); +return iomap_temporary_pfn_prot (pfn, prot); +} + +static inline void iounmap_temporary (void __iomem *vaddr) +{ +kunmap_temporary_indexed ((void __force *)vaddr); +}static inline void iounmap_atomic (void __iomem *vaddr) { -kunmap_atomic_indexed ((void __force *)vaddr); +iounmap_temporary (vaddr);preempt_enable (); }
arch/x86/mm/iomap_32.c +3 -4
@@ -44,7 +44,7 @@ void iomap_free(resource_size_t base, un }EXPORT_SYMBOL_GPL (iomap_free); -void __iomem *iomap_atomic_pfn_prot (unsigned long pfn,pgprot_t prot) +void __iomem *iomap_temporary_pfn_prot (unsigned long pfn,pgprot_t prot) {/* * For non-PAT systems, translate non-WB request to UC- just in
@@ -60,7 +60,6 @@ void __iomem *iomap_atomic_pfn_prot(unsi/* Filter out unsupported __PAGE_KERNEL* bits: */ pgprot_val (prot) &= __default_kernel_pte_mask; -preempt_disable (); -return (void __force __iomem *)kmap_atomic_pfn_prot (pfn, prot); +return (void __force __iomem *)__kmap_temporary_pfn_prot (pfn, prot); } -EXPORT_SYMBOL_GPL (iomap_atomic_pfn_prot); +EXPORT_SYMBOL_GPL (iomap_temporary_pfn_prot);
include/linux/highmem.h +54 -16
116 lines not on this page · raw message
mm/highmem.c +9 -9
@@ -432,7 +432,7 @@ static pte_t *kmap_get_pte(void)return __kmap_pte; } -static void *__kmap_atomic_pfn_prot (unsigned long pfn,pgprot_t prot) +static void *do_kmap_temporary_pfn_prot (unsigned long pfn,pgprot_t prot) {pte_t pteval, *kmap_pte =kmap_get_pte ();unsigned long vaddr;
@@ -451,14 +451,14 @@ static void *__kmap_atomic_pfn_prot(unsireturn (void *)vaddr; } -void *kmap_atomic_pfn_prot (unsigned long pfn,pgprot_t prot) +void *__kmap_temporary_pfn_prot (unsigned long pfn,pgprot_t prot) {pagefault_disable (); -return __kmap_atomic_pfn_prot (pfn, prot); +return do_kmap_temporary_pfn_prot (pfn, prot); } -EXPORT_SYMBOL (kmap_atomic_pfn_prot); +EXPORT_SYMBOL (__kmap_temporary_pfn_prot); -void *kmap_atomic_page_prot (struct page *page,pgprot_t prot) +void *__kmap_temporary_page_prot (struct page *page,pgprot_t prot) {void *kmap;
@@ -471,11 +471,11 @@ void *kmap_atomic_page_prot(struct pageif (kmap)return kmap; -return __kmap_atomic_pfn_prot (page_to_pfn (page), prot); +return do_kmap_temporary_pfn_prot (page_to_pfn (page), prot); } -EXPORT_SYMBOL (kmap_atomic_page_prot); +EXPORT_SYMBOL (__kmap_temporary_page_prot); -void kunmap_atomic_indexed (void *vaddr) +void kunmap_temporary_indexed (void *vaddr) {unsigned long addr = (unsigned long ) vaddr &PAGE_MASK ;pte_t *kmap_pte =kmap_get_pte ();
@@ -503,7 +503,7 @@ void kunmap_atomic_indexed(void *vaddr)preempt_enable ();pagefault_enable (); } -EXPORT_SYMBOL (kunmap_atomic_indexed); +EXPORT_SYMBOL (kunmap_temporary_indexed);void kmap_switch_temporary (struct task_struct *prev,struct task_struct *next) {
Patchwork
CI[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for mm/highmem: Provide a preemptible variant of kmap_atomic & friends
In reply to Thomas Gleixner== Series Details ==
== Series Details ==
Series: mm/highmem: Provide a preemptible variant of kmap_atomic & friends
URL : https://patchwork.freedesktop.org/series/81869/
State : warning
== Summary ==
$ dim checkpatch origin/drm-tip 09e63fe3f428 mm/highmem: Un-EXPORT __kmap_atomic_idx() 255bffcadf05 highmem: Provide generic variant of kmap_atomic* -:84: CHECK:LINE_SPACING: Please don't use multiple blank lines #84: FILE: include/linux/highmem.h:135: + +
-:141: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'addr' - possible side-effects? #141: FILE: include/linux/highmem.h:273:
+#define kunmap_atomic(addr) \
+ do { \
+ BUILD_BUG_ON(__same_type((addr), struct page *)); \
+ __kunmap_atomic(addr); \
+ preempt_enable(); \
+ } while (0)
-:236: WARNING:AVOID_BUG: Avoid crashing the kernel - try using WARN_ON & recovery code rather than BUG() or BUG_ON() #236: FILE: mm/highmem.c:426:
+ BUG_ON(!pte_none(*(kmap_pte - idx)));
-:271: CHECK:SPACING: No space is necessary after a cast #271: FILE: mm/highmem.c:461:
+ unsigned long addr = (unsigned long) vaddr & PAGE_MASK;
total: 0 errors, 1 warnings, 3 checks, 267 lines checked625148d57afa x86/mm/highmem: Use generic kmap atomic implementation 1832cad138d0 arc/mm/highmem: Use generic kmap atomic implementation -:45: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'vaddr' - possible side-effects? #45: FILE: arch/arc/include/asm/highmem.h:35:
+#define arch_kmap_temp_post_unmap(vaddr) \
+ local_flush_tlb_kernel_range(vaddr, vaddr + PAGE_SIZE)
total: 0 errors, 0 warnings, 1 checks, 81 lines checked 65fec7d3aa8d ARM: highmem: Switch to generic kmap atomic
-:7: WARNING:COMMIT_MESSAGE: Missing commit description - Add an appropriate one
-:33: CHECK:AVOID_EXTERNS: extern prototypes should be avoided in .h files #33: FILE: arch/arm/include/asm/highmem.h:51:
+extern void *arch_kmap_temporary_high_get(struct page *page);
-:82: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating? #82:
deleted file mode 100644
total: 0 errors, 2 warnings, 1 checks, 55 lines checked 5290cbab1bf8 csky/mm/highmem: Switch to generic kmap atomic
-:7: WARNING:COMMIT_MESSAGE: Missing commit description - Add an appropriate one
total: 0 errors, 1 warnings, 0 checks, 99 lines checked dbf59e6698e3 microblaze/mm/highmem: Switch to generic kmap atomic -:7: WARNING:COMMIT_MESSAGE: Missing commit description - Add an appropriate one
-:37: WARNING:TRAILING_SEMICOLON: macros should not use a trailing semicolon #37: FILE: arch/microblaze/include/asm/highmem.h:54:
+#define arch_kmap_temp_post_map(vaddr, pteval) \
+ local_flush_tlb_page(NULL, vaddr);
-:39: WARNING:TRAILING_SEMICOLON: macros should not use a trailing semicolon #39: FILE: arch/microblaze/include/asm/highmem.h:56:
+#define arch_kmap_temp_post_unmap(vaddr) \
+ local_flush_tlb_page(NULL, vaddr);
-:55: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating? #55:
deleted file mode 100644
total: 0 errors, 4 warnings, 0 checks, 45 lines checked 3e35d9f89ec7 mips/mm/highmem: Switch to generic kmap atomic
-:7: WARNING:COMMIT_MESSAGE: Missing commit description - Add an appropriate one
total: 0 errors, 1 warnings, 0 checks, 40 lines checked7e666c270f0c nds32/mm/highmem: Switch to generic kmap atomic
-:36: WARNING:TYPO_SPELLING: 'interupted' may be misspelled - perhaps 'interrupted'? #36: FILE: arch/nds32/include/asm/highmem.h:49:
+ * is interupted and another kmap_atomic() happens in interrupt context.
-:42: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'vaddr' - possible side-effects? #42: FILE: arch/nds32/include/asm/highmem.h:52:
+#define arch_kmap_temp_post_map(vaddr, pteval) \
+ do { \
+ __nds32__tlbop_inv(vaddr); \
+ __nds32__mtsr_dsb(vaddr, NDS32_SR_TLB_VPN); \
+ __nds32__tlbop_rwr(pteval); \
+ __nds32__isb(); \
+ } while (0)
-:70: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating? #70:
deleted file mode 100644
total: 0 errors, 2 warnings, 1 checks, 41 lines checked 48674c7f32cf powerpc/mm/highmem: Switch to generic kmap atomic
-:7: WARNING:COMMIT_MESSAGE: Missing commit description - Add an appropriate one
-:61: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating? #61:
deleted file mode 100644
total: 0 errors, 2 warnings, 0 checks, 51 lines checked f2cb65d888e1 sparc/mm/highmem: Switch to generic kmap atomic
-:7: WARNING:COMMIT_MESSAGE: Missing commit description - Add an appropriate one
-:43: CHECK:LINE_SPACING: Please don't use multiple blank lines #43: FILE: arch/sparc/include/asm/highmem.h:58:
+
+
-:59: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating? #59:
deleted file mode 100644
total: 0 errors, 2 warnings, 1 checks, 37 lines checked e199affb975e xtensa/mm/highmem: Switch to generic kmap atomic
-:7: WARNING:COMMIT_MESSAGE: Missing commit description - Add an appropriate one
-:37: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'vaddr' - possible side-effects? #37: FILE: arch/xtensa/include/asm/highmem.h:77:
+#define arch_kmap_temp_post_unmap(vaddr) \
+ local_flush_tlb_kernel_range(vaddr, vaddr + PAGE_SIZE)
total: 0 errors, 1 warnings, 1 checks, 89 lines checked 70e9cf2abd92 mm/highmem: Remove the old kmap_atomic cruft
-:7: WARNING:COMMIT_MESSAGE: Missing commit description - Add an appropriate one
-:129: WARNING:AVOID_BUG: Avoid crashing the kernel - try using WARN_ON & recovery code rather than BUG() or BUG_ON() #129: FILE: mm/highmem.c:387:
+ BUG_ON(idx >= KM_TYPE_NR);
-:142: WARNING:AVOID_BUG: Avoid crashing the kernel - try using WARN_ON & recovery code rather than BUG() or BUG_ON() #142: FILE: mm/highmem.c:400:
+ BUG_ON(idx < 0);
total: 0 errors, 3 warnings, 0 checks, 127 lines checked256adfec14ec sched: highmem: Store temporary kmaps in task struct
-:128: WARNING:AVOID_BUG: Avoid crashing the kernel - try using WARN_ON & recovery code rather than BUG() or BUG_ON() #128: FILE: mm/highmem.c:398:
+ BUG_ON(current->kmap_ctrl.idx < 0);
total: 0 errors, 1 warnings, 0 checks, 156 lines checkedc03e21031fb7 mm/highmem: Provide kmap_temporary*
-:191: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'addr' - possible side-effects? #191: FILE: include/linux/highmem.h:256:
+#define kunmap_temporary(addr) \
+ do { \
+ BUILD_BUG_ON(__same_type((addr), struct page *)); \
+ __kunmap_temporary(addr); \
+ } while (0)
total: 0 errors, 0 warnings, 1 checks, 206 lines checked
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI[Intel-gfx] ✗ Fi.CI.SPARSE: warning for mm/highmem: Provide a preemptible variant of kmap_atomic & friends
In reply to Thomas Gleixner== Series Details ==
== Series Details ==
Series: mm/highmem: Provide a preemptible variant of kmap_atomic & friends
URL : https://patchwork.freedesktop.org/series/81869/
State : warning
== Summary ==
$ dim sparse --fast origin/drm-tip Sparse version: v0.6.2 Fast mode used, each commit won't be checked separately. +drivers/gpu/drm/amd/amdgpu/amdgpu_ioc32.c:37:6: warning: symbol 'amdgpu_kms_compat_ioctl' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/dc/basics/conversion.c:34:10: warning: symbol 'fixed_point_to_int_frac' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/dc/basics/conversion.c:81:6: warning: symbol 'convert_float_matrix' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/dc/basics/vector.c:55:6: warning: symbol 'dal_vector_presized_costruct' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser2.c:1010:17: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser2.c:1478:9: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser2.c:1487:31: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser2.c:1488:30: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser2.c:1492:9: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser2.c:1494:9: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser2.c:1496:9: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser2.c:1498:9: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser2.c:1500:9: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser2.c:1502:9: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser2.c:1504:9: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser2.c:1514:17: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser2.c:1518:25: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser2.c:1522:25: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser2.c:1525:17: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser2.c:1534:33: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser2.c:370:25: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser2.c:378:18: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser2.c:412:25: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser2.c:460:18: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser2.c:517:27: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser2.c:539:18: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser2.c:548:36: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser2.c:875:38: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser2.c:877:51: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser2.c:883:53: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser2.c:885:49: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser2.c:891:51: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser2.c:892:51: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser2.c:893:50: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser2.c:894:49: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser2.c:895:48: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:1036:21: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:1059:25: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:1061:35: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:1063:36: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:1130:23: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:1150:35: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:1234:17: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:1237:17: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:1243:25: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:1246:25: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:1252:17: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:1254:17: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:1256:17: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:1258:17: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:1260:17: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:1286:30: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:1352:25: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:1355:25: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:1361:17: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:1364:17: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:1370:17: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:1372:17: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:1374:17: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:1376:17: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:1378:17: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:1516:18: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:154:17: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:1661:23: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:167:19: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:1716:17: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:1751:17: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:1796:27: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:1802:18: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:1810:36: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:183:14: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:1846:27: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:1853:18: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:1866:25: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:1868:25: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:1870:25: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:1872:25: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:1874:25: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:1876:25: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:1878:25: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:1880:25: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:1957:26: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:1961:26: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:1965:26: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:1971:26: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:1987:49: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:2004:18: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:2240:38: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:2241:34: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:2242:35: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:2247:25: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:2250:25: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:2254:17: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:2256:17: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:2266:31: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:2267:30: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:2269:17: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:2271:17: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:2275:17: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:2278:17: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:2281:47: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:2282:47: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:2284:28: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:2286:17: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:2288:17: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:2289:34: warning: too many warnings +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:235:18: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:298:18: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:358:29: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:360:44: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:438:17: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:440:17: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:442:17: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:444:17: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:446:17: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:489:17: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:491:17: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:493:17: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:495:17: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:497:17: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:499:17: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:501:17: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:575:17: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:577:17: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:579:17: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:581:17: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:583:17: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:585:17: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:587:17: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:642:37: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:668:18: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:715:33: warning: cast to restricted __le32 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:717:43: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:719:44: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:862:17: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/bios_parser.c:876:18: warning: cast to restricted __le16 +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/command_table_helper.c:209:34: expected unsigned short [usertype] usPixelClock +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/command_table_helper.c:209:34: got restricted __le16 [usertype] +drivers/gpu/drm/amd/amdgpu/../display/dc/bios/command_table_helper.c:209:34: warning: incorrect type in assignment (different base types) +drivers/gpu/drm/amd/amdgpu/../display/dc/calcs/dcn_calcs.c:739:14: warning: symbol 'get_highest_allowed_voltage_level' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/dc/clk_mgr/dcn10/rv1_clk_mgr.c:37:6: warning: symbol 'rv1_init_clocks' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/dc/clk_mgr/dcn10/rv1_clk_mgr_vbios_smu.c:102:5: warning: symbol 'rv1_vbios_smu_send_msg_with_param' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/dc/clk_mgr/dcn10/rv1_clk_mgr_vbios_smu.c:123:5: warning: symbol 'rv1_vbios_smu_set_dispclk' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/dc/clk_mgr/dcn10/rv1_clk_mgr_vbios_smu.c:146:5: warning: symbol 'rv1_vbios_smu_set_dprefclk' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/dc/clk_mgr/dcn20/dcn20_clk_mgr.c:339:6: warning: symbol 'dcn2_enable_pme_wa' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/dc/clk_mgr/dcn21/rn_clk_mgr.c:106:6: warning: symbol 'rn_update_clocks' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/dc/clk_mgr/dcn21/rn_clk_mgr.c:388:6: warning: symbol 'rn_get_clk_states' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/dc/clk_mgr/dcn21/rn_clk_mgr.c:398:6: warning: symbol 'rn_enable_pme_wa' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/dc/clk_mgr/dcn21/rn_clk_mgr.c:405:6: warning: symbol 'rn_init_clocks' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/dc/clk_mgr/dcn21/rn_clk_mgr.c:58:5: warning: symbol 'rn_get_active_display_cnt_wa' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/dc/clk_mgr/dcn21/rn_clk_mgr.c:97:6: warning: symbol 'rn_set_low_power_state' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/dc/clk_mgr/dcn21/rn_clk_mgr_vbios_smu.c:110:5: warning: symbol 'rn_vbios_smu_get_smu_version' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/dc/clk_mgr/dcn21/rn_clk_mgr_vbios_smu.c:119:5: warning: symbol 'rn_vbios_smu_set_dispclk' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/dc/clk_mgr/dcn21/rn_clk_mgr_vbios_smu.c:142:5: warning: symbol 'rn_vbios_smu_set_dprefclk' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/dc/clk_mgr/dcn21/rn_clk_mgr_vbios_smu.c:156:5: warning: symbol 'rn_vbios_smu_set_hard_min_dcfclk' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/dc/clk_mgr/dcn21/rn_clk_mgr_vbios_smu.c:171:5: warning: symbol 'rn_vbios_smu_set_min_deep_sleep_dcfclk' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/dc/clk_mgr/dcn21/rn_clk_mgr_vbios_smu.c:186:6: warning: symbol 'rn_vbios_smu_set_phyclk' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/dc/clk_mgr/dcn21/rn_clk_mgr_vbios_smu.c:194:5: warning: symbol 'rn_vbios_smu_set_dppclk' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/dc/clk_mgr/dcn21/rn_clk_mgr_vbios_smu.c:206:6: warning: symbol 'rn_vbios_smu_set_dcn_low_power_state' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/dc/clk_mgr/dcn21/rn_clk_mgr_vbios_smu.c:221:6: warning: symbol 'rn_vbios_smu_enable_48mhz_tmdp_refclk_pwrdwn' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/dc/clk_mgr/dcn21/rn_clk_mgr_vbios_smu.c:229:6: warning: symbol 'rn_vbios_smu_enable_pme_wa' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/dc/clk_mgr/dcn21/rn_clk_mgr_vbios_smu.c:237:5: warning: symbol 'rn_vbios_smu_is_periodic_retraining_disabled' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/dc/clk_mgr/dcn21/rn_clk_mgr_vbios_smu.c:89:5: warning: symbol 'rn_vbios_smu_send_msg_with_param' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c:719:31: int enum dce_version +drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c:719:31: unsigned int enum dce_environment +drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c:719:31: warning: mixing different enum types: +drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c:777:6: warning: symbol 'apply_ctx_interdependent_lock' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_hw_sequencer.c:180:26: warning: symbol 'get_color_space_type' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_dp.c:3663:19: warning: symbol 'linkRateInKHzToLinkRateMultiplier' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_dp.c:4209:54: int enum dc_status +drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_dp.c:4209:54: unsigned int enum ddc_result +drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_dp.c:4209:54: warning: mixing different enum types: +drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:1099:5: warning: symbol 'shift_border_left_to_dst' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:1110:6: warning: symbol 'restore_border_left_from_dst' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:1804:16: warning: Using plain integer as NULL pointer +drivers/gpu/drm/amd/amdgpu/../display/dc/dce100/dce100_resource.c:1161:22: warning: symbol 'dce100_create_resource_pool' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/dc/dce100/dce100_resource.c:280:9: also defined here +drivers/gpu/drm/amd/amdgpu/../display/dc/dce100/dce100_resource.c:280:9: warning: Initializer entry defined twice +drivers/gpu/drm/amd/amdgpu/../display/dc/dce100/dce100_resource.c:284:9: also defined here +drivers/gpu/drm/amd/amdgpu/../display/dc/dce100/dce100_resource.c:284:9: warning: Initializer entry defined twice +drivers/gpu/drm/amd/amdgpu/../display/dc/dce100/dce100_resource.c:544:17: also defined here +drivers/gpu/drm/amd/amdgpu/../display/dc/dce100/dce100_resource.c:544:17: warning: Initializer entry defined twice +drivers/gpu/drm/amd/amdgpu/../display/dc/dce100/dce100_resource.c:549:17: also defined here +drivers/gpu/drm/amd/amdgpu/../display/dc/dce100/dce100_resource.c:549:17: warning: Initializer entry defined twice +drivers/gpu/drm/amd/amdgpu/../display/dc/dce100/dce100_resource.c:554:9: also defined here +drivers/gpu/drm/amd/amdgpu/../display/dc/dce100/dce100_resource.c:554:9: warning: Initializer entry defined twice +drivers/gpu/drm/amd/amdgpu/../display/dc/dce100/dce100_resource.c:558:9: also defined here +drivers/gpu/drm/amd/amdgpu/../display/dc/dce100/dce100_resource.c:558:9: warning: Initializer entry defined twice +drivers/gpu/drm/amd/amdgpu/../display/dc/dce100/dce100_resource.c:621:21: warning: symbol 'dce100_link_encoder_create' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/dc/dce100/dce100_resource.c:660:31: warning: symbol 'dce100_opp_create' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/dc/dce100/dce100_resource.c:675:16: warning: symbol 'dce100_aux_engine_create' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/dc/dce100/dce100_resource.c:713:19: warning: symbol 'dce100_i2c_hw_create' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/dc/dce100/dce100_resource.c:728:21: warning: symbol 'dce100_clock_source_create' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/dc/dce100/dce100_resource.c:752:6: warning: symbol 'dce100_clock_source_destroy' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/dc/dce100/dce100_resource.c:841:6: warning: symbol 'dce100_validate_bandwidth' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/dc/dce100/dce100_resource.c:886:16: warning: symbol 'dce100_validate_global' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/dc/dce100/dce100_resource.c:896:16: warning: symbol 'dce100_add_stream_to_ctx' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/dc/dce100/dce100_resource.c:923:16: warning: symbol 'dce100_validate_plane' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/dc/dce100/dce100_resource.c:932:23: warning: symbol 'dce100_find_first_free_match_stream_enc_for_link' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_compressor.c:415:6: warning: symbol 'dce110_get_required_compressed_surfacesize' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_compressor.c:459:14: warning: symbol 'controller_id_to_index' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_hw_sequencer.c:1454:84: warning: Using plain integer as NULL pointer +drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_hw_sequencer.c:2538:84: warning: Using plain integer as NULL pointer +drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_hw_sequencer.c:2700:6: warning: symbol 'dce110_set_cursor_position' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_hw_sequencer.c:2745:6: warning: symbol 'dce110_set_cursor_attribute' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_mem_input_v.c:1008:6: warning: symbol 'dce110_free_mem_input_v' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_mem_input_v.c:1034:6: warning: symbol 'dce110_mem_input_v_construct' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_mem_input_v.c:471:6: warning: symbol 'dce_mem_input_v_is_surface_pending' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_mem_input_v.c:486:6: warning: symbol 'dce_mem_input_v_program_surface_flip_and_addr' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_mem_input_v.c:563:6: warning: symbol 'dce_mem_input_v_program_pte_vm' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_mem_input_v.c:636:6: warning: symbol 'dce_mem_input_v_program_surface_config' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_mem_input_v.c:922:6: warning: symbol 'dce_mem_input_v_program_display_marks' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_mem_input_v.c:945:6: warning: symbol 'dce_mem_input_program_chroma_display_marks' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_mem_input_v.c:966:6: warning: symbol 'dce110_allocate_mem_input_v' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:1044:16: warning: symbol 'dce110_validate_plane' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:1099:16: warning: symbol 'dce110_validate_global' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:1343:28: warning: symbol 'dce110_resource_cap' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:266:9: also defined here +drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:266:9: warning: Initializer entry defined twice +drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:267:9: also defined here +drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:267:9: warning: Initializer entry defined twice +drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:268:9: also defined here +drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:268:9: warning: Initializer entry defined twice +drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:272:17: also defined here +drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:272:17: warning: Initializer entry defined twice +drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:276:17: also defined here +drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:276:17: warning: Initializer entry defined twice +drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:292:9: also defined here +drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:292:9: warning: Initializer entry defined twice +drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:296:9: also defined here +drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:296:9: warning: Initializer entry defined twice +drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:314:9: also defined here +drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:314:9: warning: Initializer entry defined twice +drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:318:9: also defined here +drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:318:9: warning: Initializer entry defined twice +drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:560:17: also defined here +drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:560:17: warning: Initializer entry defined twice +drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:564:17: also defined here +drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:564:17: warning: Initializer entry defined twice +drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:601:17: also defined here +drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:601:17: warning: Initializer entry defined twice +drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:606:17: also defined here +drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:606:17: warning: Initializer entry defined twice +drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:725:16: warning: symbol 'dce110_aux_engine_create' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:763:19: warning: symbol 'dce110_i2c_hw_create' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:778:21: warning: symbol 'dce110_clock_source_create' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_resource.c:802:6: warning: symbol 'dce110_clock_source_destroy' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/dc/dce112/dce112_resource.c:1015:16: warning: symbol 'dce112_add_stream_to_ctx' was not declared. Should it be static? +drivers/gpu/drm/amd/amdgpu/../display/dc/dce112/dce112_resource.c:1034:16:
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI[Intel-gfx] ✓ Fi.CI.BAT: success for mm/highmem: Provide a preemptible variant of kmap_atomic & friends
In reply to Thomas Gleixner== Series Details ==
== Series Details ==
Series: mm/highmem: Provide a preemptible variant of kmap_atomic & friends
URL : https://patchwork.freedesktop.org/series/81869/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_9025 -> Patchwork_18535
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18535/index.html
Known issues
------------
Here are the changes found in Patchwork_18535 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@i915_module_load@reload:
- fi-byt-j1900: [PASS][1] -> [DMESG-WARN][2] ([i915#1982])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9025/fi-byt-j1900/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18535/fi-byt-j1900/igt@[email protected]
* igt@vgem_basic@unload:
- fi-skl-guc: [PASS][3] -> [DMESG-WARN][4] ([i915#2203])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9025/fi-skl-guc/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18535/fi-skl-guc/igt@[email protected]
- fi-kbl-x1275: [PASS][5] -> [DMESG-WARN][6] ([i915#62] / [i915#92] / [i915#95])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9025/fi-kbl-x1275/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18535/fi-kbl-x1275/igt@[email protected]
#### Possible fixes ####
* {igt@core_hotunplug@unbind-rebind}:
- fi-kbl-x1275: [DMESG-WARN][7] ([i915#62] / [i915#92]) -> [PASS][8]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9025/fi-kbl-x1275/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18535/fi-kbl-x1275/igt@[email protected]
* igt@kms_busy@basic@flip:
- fi-kbl-x1275: [DMESG-WARN][9] ([i915#62] / [i915#92] / [i915#95]) -> [PASS][10]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9025/fi-kbl-x1275/igt@kms_busy@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18535/fi-kbl-x1275/igt@kms_busy@[email protected]
* igt@kms_chamelium@common-hpd-after-suspend:
- fi-kbl-7500u: [DMESG-WARN][11] ([i915#2203]) -> [PASS][12]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9025/fi-kbl-7500u/igt@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18535/fi-kbl-7500u/igt@[email protected]
* igt@kms_cursor_legacy@basic-busy-flip-before-cursor-legacy:
- fi-icl-u2: [DMESG-WARN][13] ([i915#1982]) -> [PASS][14] +2 similar issues
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9025/fi-icl-u2/igt@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18535/fi-icl-u2/igt@[email protected]
* igt@kms_flip@basic-flip-vs-dpms@d-dsi1:
- {fi-tgl-dsi}: [DMESG-WARN][15] ([i915#1982]) -> [PASS][16]
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9025/fi-tgl-dsi/igt@kms_flip@[email protected]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18535/fi-tgl-dsi/igt@kms_flip@[email protected]
* igt@kms_flip@basic-flip-vs-wf_vblank@c-hdmi-a2:
- fi-skl-guc: [DMESG-WARN][17] ([i915#2203]) -> [PASS][18]
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9025/fi-skl-guc/igt@kms_flip@[email protected]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18535/fi-skl-guc/igt@kms_flip@[email protected]
#### Warnings ####
* igt@gem_exec_suspend@basic-s0:
- fi-kbl-x1275: [DMESG-WARN][19] ([i915#1982] / [i915#62] / [i915#92] / [i915#95]) -> [DMESG-WARN][20] ([i915#62] / [i915#92] / [i915#95])
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9025/fi-kbl-x1275/igt@[email protected]
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18535/fi-kbl-x1275/igt@[email protected]
* igt@i915_module_load@reload:
- fi-icl-u2: [DMESG-WARN][21] ([i915#289]) -> [DMESG-WARN][22] ([i915#1982] / [i915#289])
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9025/fi-icl-u2/igt@[email protected]
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18535/fi-icl-u2/igt@[email protected]
* igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-c:
- fi-kbl-x1275: [DMESG-WARN][23] ([i915#62] / [i915#92] / [i915#95]) -> [DMESG-WARN][24] ([i915#62] / [i915#92]) +5 similar issues
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9025/fi-kbl-x1275/igt@[email protected]
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18535/fi-kbl-x1275/igt@[email protected]
* igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
- fi-kbl-x1275: [DMESG-WARN][25] ([i915#62] / [i915#92]) -> [DMESG-WARN][26] ([i915#62] / [i915#92] / [i915#95]) +2 similar issues
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9025/fi-kbl-x1275/igt@[email protected]
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18535/fi-kbl-x1275/igt@[email protected]
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[i915#1982]: https://gitlab.freedesktop.org/drm/intel/issues/1982
[i915#2203]: https://gitlab.freedesktop.org/drm/intel/issues/2203
[i915#289]: https://gitlab.freedesktop.org/drm/intel/issues/289
[i915#62]: https://gitlab.freedesktop.org/drm/intel/issues/62
[i915#92]: https://gitlab.freedesktop.org/drm/intel/issues/92
[i915#95]: https://gitlab.freedesktop.org/drm/intel/issues/95
Participating hosts (45 -> 38)
------------------------------
Missing (7): fi-kbl-soraka fi-ilk-m540 fi-byt-squawks fi-bsw-cyan fi-tgl-y fi-byt-clapper fi-bdw-samus
Build changes
-------------
* Linux: CI_DRM_9025 -> Patchwork_18535
CI-20190529: 20190529
CI_DRM_9025: 955d04e2ed0cf4bb4679f594a852cc2eebe8266b @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5787: 0ec962017c8131de14e0cb038f7f76b1f17ed637 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_18535: c03e21031fb7ef6adb75d27990329e1bcfe2f765 @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
c03e21031fb7 mm/highmem: Provide kmap_temporary* 256adfec14ec sched: highmem: Store temporary kmaps in task struct 70e9cf2abd92 mm/highmem: Remove the old kmap_atomic cruft e199affb975e xtensa/mm/highmem: Switch to generic kmap atomic f2cb65d888e1 sparc/mm/highmem: Switch to generic kmap atomic 48674c7f32cf powerpc/mm/highmem: Switch to generic kmap atomic 7e666c270f0c nds32/mm/highmem: Switch to generic kmap atomic 3e35d9f89ec7 mips/mm/highmem: Switch to generic kmap atomic dbf59e6698e3 microblaze/mm/highmem: Switch to generic kmap atomic 5290cbab1bf8 csky/mm/highmem: Switch to generic kmap atomic 65fec7d3aa8d ARM: highmem: Switch to generic kmap atomic 1832cad138d0 arc/mm/highmem: Use generic kmap atomic implementation 625148d57afa x86/mm/highmem: Use generic kmap atomic implementation 255bffcadf05 highmem: Provide generic variant of kmap_atomic* 09e63fe3f428 mm/highmem: Un-EXPORT __kmap_atomic_idx()
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18535/index.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 38 lines · Thomas Gleixner
First of all, sorry for the horribly big Cc list!
Following up to the discussion in:
https://lore.kernel.org/r/[email protected]
this provides a preemptible variant of
kmap_atomic& related interfaces. This is achieved by:- Consolidating all kmap atomic implementations in generic code
- Switching from per CPU storage of the kmap index to a per task storage
- Adding a pteval array to the per task storage which contains the ptevals of the currently active temporary kmaps
- Adding context switch code which checks whether the outgoing or the incoming task has active temporary kmaps. If so, the outgoing task's kmaps are removed and the incoming task's kmaps are restored.
- Adding new interfaces k[un]map_temporary*() which are not disabling preemption and can be called from any context (except NMI).
Contrary to
kmap()which provides preemptible and "persistant" mappings, these interfaces are meant to replace the temporary mappings provided by kmap_atomic*() today.This allows to get rid of conditional mapping choices and allows to have preemptible short term mappings on 64bit which are today enforced to be non-preemptible due to the highmem constraints. It clearly puts overhead on the highmem users, but highmem is slow anyway.
This is not a wholesale conversion which makes
kmap_atomicmagically preemptible because there might be usage sites which rely on the implicit preempt disable. So this needs to be done on a case by case basis and the call sites converted tokmap_temporary.
Quoted 6 lines
Note, that this is only lightly tested on X86 and completely untested on all other architectures.
The lot is also available from
git://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.githighmem
I think it should be the case, but I want to double check: Will copy_*_user be allowed within a kmap_temporary section? This would allow us to ditch an absolute pile of slowpaths. -Daniel
Quoted 55 lines
Thanks,
tglx
--- a/arch/arm/mm/highmem.c | 121 --------------------- a/arch/microblaze/mm/highmem.c | 78 ------------- a/arch/nds32/mm/highmem.c | 48 -------- a/arch/powerpc/mm/highmem.c | 67 ----------- a/arch/sparc/mm/highmem.c | 115 -------------------- arch/arc/Kconfig | 1 arch/arc/include/asm/highmem.h | 8 + arch/arc/mm/highmem.c | 44 ------- arch/arm/Kconfig | 1 arch/arm/include/asm/highmem.h | 30 +++-- arch/arm/mm/Makefile | 1 arch/csky/Kconfig | 1 arch/csky/include/asm/highmem.h | 4 arch/csky/mm/highmem.c | 75 ------------- arch/microblaze/Kconfig | 1 arch/microblaze/include/asm/highmem.h | 6 - arch/microblaze/mm/Makefile | 1 arch/microblaze/mm/init.c | 6 - arch/mips/Kconfig | 1 arch/mips/include/asm/highmem.h | 4 arch/mips/mm/highmem.c | 77 ------------- arch/mips/mm/init.c | 3 arch/nds32/Kconfig.cpu | 1 arch/nds32/include/asm/highmem.h | 21 ++- arch/nds32/mm/Makefile | 1 arch/powerpc/Kconfig | 1 arch/powerpc/include/asm/highmem.h | 6 - arch/powerpc/mm/Makefile | 1 arch/powerpc/mm/mem.c | 7 - arch/sparc/Kconfig | 1 arch/sparc/include/asm/highmem.h | 7 - arch/sparc/mm/Makefile | 3 arch/sparc/mm/srmmu.c | 2 arch/x86/include/asm/fixmap.h | 1 arch/x86/include/asm/highmem.h | 12 +- arch/x86/include/asm/iomap.h | 29 +++-- arch/x86/mm/highmem_32.c | 59 ---------- arch/x86/mm/init_32.c | 15 -- arch/x86/mm/iomap_32.c | 57 ---------- arch/xtensa/Kconfig | 1 arch/xtensa/include/asm/highmem.h | 9 + arch/xtensa/mm/highmem.c | 44 ------- b/arch/x86/Kconfig | 3 include/linux/highmem.h | 141 +++++++++++++++--------- include/linux/io-mapping.h | 2 include/linux/sched.h | 9 + kernel/sched/core.c | 10 + mm/Kconfig | 3 mm/highmem.c | 192 ++++++++++++++++++++++++++++++++-- 49 files changed, 422 insertions(+), 909 deletions(-)
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
Quoted 43 lines · Daniel Vetter
Quoted 41 lines · Thomas Gleixner
First of all, sorry for the horribly big Cc list!
Following up to the discussion in:
https://lore.kernel.org/r/[email protected]
this provides a preemptible variant of
kmap_atomic& related interfaces. This is achieved by:- Consolidating all kmap atomic implementations in generic code
- Switching from per CPU storage of the kmap index to a per task storage
- Adding a pteval array to the per task storage which contains the ptevals of the currently active temporary kmaps
- Adding context switch code which checks whether the outgoing or the incoming task has active temporary kmaps. If so, the outgoing task's kmaps are removed and the incoming task's kmaps are restored.
- Adding new interfaces k[un]map_temporary*() which are not disabling preemption and can be called from any context (except NMI).
Contrary to
kmap()which provides preemptible and "persistant" mappings, these interfaces are meant to replace the temporary mappings provided by kmap_atomic*() today.This allows to get rid of conditional mapping choices and allows to have preemptible short term mappings on 64bit which are today enforced to be non-preemptible due to the highmem constraints. It clearly puts overhead on the highmem users, but highmem is slow anyway.
This is not a wholesale conversion which makes
kmap_atomicmagically preemptible because there might be usage sites which rely on the implicit preempt disable. So this needs to be done on a case by case basis and the call sites converted tokmap_temporary.Note, that this is only lightly tested on X86 and completely untested on all other architectures.
Quoted 7 lines
Quoted 3 lines
The lot is also available from
git://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.githighmemI think it should be the case, but I want to double check: Will copy_*_user be allowed within a
kmap_temporarysection? This would allow us to ditch an absolute pile of slowpaths.
(coffee just kicked in) copy_*_user is ofc allowed, but if you hit a page fault you get a short read/write. This looks like it would remove the need to handle these in a slowpath, since page faults can now be served in this new kmap_temporary sections. But this sounds too good to be true, so I'm wondering what I'm missing.
-Daniel
Quoted 63 lines
Quoted 48 lines
Thanks,
tglx
--- a/arch/arm/mm/highmem.c | 121 --------------------- a/arch/microblaze/mm/highmem.c | 78 ------------- a/arch/nds32/mm/highmem.c | 48 -------- a/arch/powerpc/mm/highmem.c | 67 ----------- a/arch/sparc/mm/highmem.c | 115 -------------------- arch/arc/Kconfig | 1 arch/arc/include/asm/highmem.h | 8 + arch/arc/mm/highmem.c | 44 ------- arch/arm/Kconfig | 1 arch/arm/include/asm/highmem.h | 30 +++-- arch/arm/mm/Makefile | 1 arch/csky/Kconfig | 1 arch/csky/include/asm/highmem.h | 4 arch/csky/mm/highmem.c | 75 ------------- arch/microblaze/Kconfig | 1 arch/microblaze/include/asm/highmem.h | 6 - arch/microblaze/mm/Makefile | 1 arch/microblaze/mm/init.c | 6 - arch/mips/Kconfig | 1 arch/mips/include/asm/highmem.h | 4 arch/mips/mm/highmem.c | 77 ------------- arch/mips/mm/init.c | 3 arch/nds32/Kconfig.cpu | 1 arch/nds32/include/asm/highmem.h | 21 ++- arch/nds32/mm/Makefile | 1 arch/powerpc/Kconfig | 1 arch/powerpc/include/asm/highmem.h | 6 - arch/powerpc/mm/Makefile | 1 arch/powerpc/mm/mem.c | 7 - arch/sparc/Kconfig | 1 arch/sparc/include/asm/highmem.h | 7 - arch/sparc/mm/Makefile | 3 arch/sparc/mm/srmmu.c | 2 arch/x86/include/asm/fixmap.h | 1 arch/x86/include/asm/highmem.h | 12 +- arch/x86/include/asm/iomap.h | 29 +++-- arch/x86/mm/highmem_32.c | 59 ---------- arch/x86/mm/init_32.c | 15 -- arch/x86/mm/iomap_32.c | 57 ---------- arch/xtensa/Kconfig | 1 arch/xtensa/include/asm/highmem.h | 9 + arch/xtensa/mm/highmem.c | 44 -------Quoted 8 lines
b/arch/x86/Kconfig | 3 include/linux/highmem.h | 141 +++++++++++++++--------- include/linux/io-mapping.h | 2 include/linux/sched.h | 9 + kernel/sched/core.c | 10 + mm/Kconfig | 3 mm/highmem.c | 192 ++++++++++++++++++++++++++++++++-- 49 files changed, 422 insertions(+), 909 deletions(-)--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
Quoted 10 lines · Daniel Vetter
Quoted 3 lines · Daniel Vetter
I think it should be the case, but I want to double check: Will copy_*_user be allowed within a
kmap_temporarysection? This would allow us to ditch an absolute pile of slowpaths.(coffee just kicked in) copy_*_user is ofc allowed, but if you hit a page fault you get a short read/write. This looks like it would remove the need to handle these in a slowpath, since page faults can now be served in this new
kmap_temporarysections. But this sounds too good to be true, so I'm wondering what I'm missing.
In principle we could allow pagefaults, but not with the currently proposed interface which can be called from any context. Obviously if called from atomic context it can't handle user page faults.
In theory we could make a variant which does not disable pagefaults, but that's what kmap() already provides.
Thanks,
tglx
Quoted 12 lines · Thomas Gleixner
Quoted 10 lines · Daniel Vetter
Quoted 3 lines · Daniel Vetter
I think it should be the case, but I want to double check: Will copy_*_user be allowed within a
kmap_temporarysection? This would allow us to ditch an absolute pile of slowpaths.(coffee just kicked in) copy_*_user is ofc allowed, but if you hit a page fault you get a short read/write. This looks like it would remove the need to handle these in a slowpath, since page faults can now be served in this new
kmap_temporarysections. But this sounds too good to be true, so I'm wondering what I'm missing.
Quoted 3 lines
In principle we could allow pagefaults, but not with the currently proposed interface which can be called from any context. Obviously if called from atomic context it can't handle user page faults.
Yeah that's clear, but does the implemention need to disable pagefaults unconditionally?
Quoted 2 lines
In theory we could make a variant which does not disable pagefaults, but that's what
kmap()already provides.
Currently we have a bunch of code which roughly does
kmap_atomic();
copy_*_user();
kunmap_atomic();
if (short_copy_user) {
kmap();
copy_*_user(remaining_stuff);
kunmap();
}And the only reason is that kmap is a notch slower, hence the fastpath. If we get a kmap which is fast and allows pagefaults (only in contexts that allow pagefaults already ofc) then we can ditch a pile of kmap users.
Cheers, Daniel
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
Quoted 13 lines · Daniel Vetter
Quoted 12 lines · Thomas Gleixner
Quoted 10 lines · Daniel Vetter
Quoted 3 lines · Daniel Vetter
I think it should be the case, but I want to double check: Will copy_*_user be allowed within a
kmap_temporarysection? This would allow us to ditch an absolute pile of slowpaths.(coffee just kicked in) copy_*_user is ofc allowed, but if you hit a page fault you get a short read/write. This looks like it would remove the need to handle these in a slowpath, since page faults can now be served in this new
kmap_temporarysections. But this sounds too good to be true, so I'm wondering what I'm missing.
Quoted 6 lines
Quoted 3 lines
In principle we could allow pagefaults, but not with the currently proposed interface which can be called from any context. Obviously if called from atomic context it can't handle user page faults.
Yeah that's clear, but does the implemention need to disable pagefaults unconditionally?
As I wrote in the other reply it's not required and the final interface will neither disable preemption nor pagefaults (except for the atomic wrapper around it).
Thanks,
tglx
Patchwork
CI[Intel-gfx] ✓ Fi.CI.IGT: success for mm/highmem: Provide a preemptible variant of kmap_atomic & friends
In reply to Thomas Gleixner== Series Details ==
== Series Details ==
Series: mm/highmem: Provide a preemptible variant of kmap_atomic & friends
URL : https://patchwork.freedesktop.org/series/81869/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_9025_full -> Patchwork_18535_full
====================================================
Summary
-------
**SUCCESS**
No regressions found.
Known issues
------------
Here are the changes found in Patchwork_18535_full that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_exec_create@forked:
- shard-glk: [PASS][1] -> [DMESG-WARN][2] ([i915#118] / [i915#95]) +1 similar issue
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9025/shard-glk2/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18535/shard-glk1/igt@[email protected]
* igt@gem_exec_reloc@basic-many-active@vecs0:
- shard-glk: [PASS][3] -> [FAIL][4] ([i915#2389])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9025/shard-glk2/igt@gem_exec_reloc@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18535/shard-glk1/igt@gem_exec_reloc@[email protected]
* igt@gen9_exec_parse@allowed-all:
- shard-kbl: [PASS][5] -> [DMESG-WARN][6] ([i915#1436] / [i915#716])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9025/shard-kbl2/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18535/shard-kbl7/igt@[email protected]
* igt@i915_pm_rc6_residency@rc6-fence:
- shard-hsw: [PASS][7] -> [WARN][8] ([i915#1519])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9025/shard-hsw8/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18535/shard-hsw1/igt@[email protected]
* igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic:
- shard-skl: [PASS][9] -> [DMESG-WARN][10] ([i915#1982]) +4 similar issues
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9025/shard-skl7/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18535/shard-skl9/igt@[email protected]
* igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions:
- shard-skl: [PASS][11] -> [FAIL][12] ([i915#2346])
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9025/shard-skl3/igt@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18535/shard-skl9/igt@[email protected]
* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-indfb-pgflip-blt:
- shard-apl: [PASS][13] -> [DMESG-WARN][14] ([i915#1635] / [i915#1982])
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9025/shard-apl4/igt@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18535/shard-apl1/igt@[email protected]
* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-shrfb-pgflip-blt:
- shard-iclb: [PASS][15] -> [DMESG-WARN][16] ([i915#1982])
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9025/shard-iclb6/igt@[email protected]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18535/shard-iclb3/igt@[email protected]
* igt@kms_frontbuffer_tracking@psr-1p-primscrn-pri-indfb-draw-mmap-wc:
- shard-skl: [PASS][17] -> [FAIL][18] ([i915#49])
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9025/shard-skl5/igt@kms_frontbuffer_tracking@psr-1p-primscrn-pri-indfb-draw-mmap-wc.html
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18535/shard-skl8/igt@kms_frontbuffer_tracking@psr-1p-primscrn-pri-indfb-draw-mmap-wc.html
* igt@kms_frontbuffer_tracking@psr-1p-primscrn-pri-shrfb-draw-render:
- shard-tglb: [PASS][19] -> [DMESG-WARN][20] ([i915#1982]) +4 similar issues
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9025/shard-tglb5/igt@kms_frontbuffer_tracking@psr-1p-primscrn-pri-shrfb-draw-render.html
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18535/shard-tglb7/igt@kms_frontbuffer_tracking@psr-1p-primscrn-pri-shrfb-draw-render.html
* igt@kms_hdr@bpc-switch:
- shard-skl: [PASS][21] -> [FAIL][22] ([i915#1188])
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9025/shard-skl8/igt@[email protected]
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18535/shard-skl1/igt@[email protected]
* igt@kms_hdr@bpc-switch-suspend:
- shard-kbl: [PASS][23] -> [DMESG-WARN][24] ([i915#180]) +4 similar issues
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9025/shard-kbl3/igt@[email protected]
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18535/shard-kbl3/igt@[email protected]
* igt@kms_plane_alpha_blend@pipe-a-coverage-7efc:
- shard-skl: [PASS][25] -> [FAIL][26] ([fdo#108145] / [i915#265])
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9025/shard-skl5/igt@[email protected]
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18535/shard-skl8/igt@[email protected]
* igt@kms_psr@psr2_cursor_render:
- shard-iclb: [PASS][27] -> [SKIP][28] ([fdo#109441]) +3 similar issues
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9025/shard-iclb2/igt@kms_psr@psr2_cursor_render.html
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18535/shard-iclb1/igt@kms_psr@psr2_cursor_render.html
* igt@perf@polling-small-buf:
- shard-iclb: [PASS][29] -> [FAIL][30] ([i915#1722])
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9025/shard-iclb6/igt@[email protected]
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18535/shard-iclb3/igt@[email protected]
#### Possible fixes ####
* igt@gem_eio@suspend:
- shard-iclb: [INCOMPLETE][31] ([i915#2483]) -> [PASS][32]
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9025/shard-iclb3/igt@[email protected]
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18535/shard-iclb7/igt@[email protected]
* igt@gem_userptr_blits@sync-unmap-cycles:
- shard-skl: [TIMEOUT][33] ([i915#1958] / [i915#2424]) -> [PASS][34]
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9025/shard-skl8/igt@[email protected]
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18535/shard-skl4/igt@[email protected]
* igt@gen9_exec_parse@allowed-single:
- shard-skl: [DMESG-WARN][35] ([i915#1436] / [i915#716]) -> [PASS][36]
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9025/shard-skl1/igt@[email protected]
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18535/shard-skl2/igt@[email protected]
* igt@i915_selftest@mock@contexts:
- shard-apl: [INCOMPLETE][37] ([i915#1635] / [i915#2278]) -> [PASS][38]
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9025/shard-apl2/igt@i915_selftest@[email protected]
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18535/shard-apl2/igt@i915_selftest@[email protected]
* igt@kms_cursor_legacy@2x-cursor-vs-flip-atomic:
- shard-hsw: [INCOMPLETE][39] ([CI#80]) -> [PASS][40]
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9025/shard-hsw8/igt@[email protected]
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18535/shard-hsw7/igt@[email protected]
* igt@kms_cursor_legacy@2x-long-flip-vs-cursor-legacy:
- shard-glk: [FAIL][41] ([i915#72]) -> [PASS][42]
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9025/shard-glk5/igt@[email protected]
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18535/shard-glk4/igt@[email protected]
* igt@kms_flip@2x-dpms-vs-vblank-race@ab-vga1-hdmi-a1:
- shard-hsw: [DMESG-WARN][43] ([i915#1982]) -> [PASS][44]
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9025/shard-hsw6/igt@kms_flip@[email protected]
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18535/shard-hsw4/igt@kms_flip@[email protected]
* igt@kms_flip@2x-flip-vs-suspend-interruptible@bc-vga1-hdmi-a1:
- shard-hsw: [INCOMPLETE][45] ([i915#2055]) -> [PASS][46]
[45]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9025/shard-hsw8/igt@kms_flip@[email protected]
[46]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18535/shard-hsw7/igt@kms_flip@[email protected]
* igt@kms_flip@flip-vs-suspend@c-dp1:
- shard-kbl: [DMESG-WARN][47] ([i915#180]) -> [PASS][48] +3 similar issues
[47]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9025/shard-kbl7/igt@kms_flip@[email protected]
[48]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18535/shard-kbl2/igt@kms_flip@[email protected]
* igt@kms_flip@plain-flip-ts-check-interruptible@c-edp1:
- shard-skl: [FAIL][49] ([i915#2122]) -> [PASS][50]
[49]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9025/shard-skl1/igt@kms_flip@[email protected]
[50]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18535/shard-skl2/igt@kms_flip@[email protected]
* igt@kms_frontbuffer_tracking@fbcpsr-1p-pri-indfb-multidraw:
- shard-iclb: [DMESG-WARN][51] ([i915#1982]) -> [PASS][52]
[51]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9025/shard-iclb7/igt@[email protected]
[52]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18535/shard-iclb6/igt@[email protected]
* igt@kms_plane_alpha_blend@pipe-c-constant-alpha-min:
- shard-skl: [FAIL][53] ([fdo#108145] / [i915#265]) -> [PASS][54]
[53]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9025/shard-skl5/igt@[email protected]
[54]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18535/shard-skl10/igt@[email protected]
* igt@kms_plane_scaling@pipe-b-scaler-with-clipping-clamping:
- shard-skl: [DMESG-WARN][55] ([i915#1982]) -> [PASS][56] +3 similar issues
[55]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9025/shard-skl5/igt@[email protected]
[56]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18535/shard-skl7/igt@[email protected]
* igt@kms_psr@psr2_sprite_mmap_gtt:
- shard-iclb: [SKIP][57] ([fdo#109441]) -> [PASS][58] +2 similar issues
[57]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9025/shard-iclb7/igt@kms_psr@psr2_sprite_mmap_gtt.html
[58]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18535/shard-iclb2/igt@kms_psr@psr2_sprite_mmap_gtt.html
* igt@kms_vblank@pipe-b-query-busy:
- shard-apl: [DMESG-WARN][59] ([i915#1635] / [i915#1982]) -> [PASS][60] +2 similar issues
[59]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9025/shard-apl7/igt@[email protected]
[60]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18535/shard-apl1/igt@[email protected]
#### Warnings ####
* igt@kms_flip@flip-vs-suspend@a-edp1:
- shard-skl: [INCOMPLETE][61] ([i915#198] / [i915#1982]) -> [DMESG-WARN][62] ([i915#1982])
[61]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9025/shard-skl2/igt@kms_flip@[email protected]
[62]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18535/shard-skl5/igt@kms_flip@[email protected]
* igt@kms_plane_alpha_blend@pipe-c-coverage-7efc:
- shard-skl: [DMESG-WARN][63] ([i915#1982]) -> [DMESG-FAIL][64] ([fdo#108145] / [i915#1982])
[63]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9025/shard-skl8/igt@[email protected]
[64]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18535/shard-skl4/igt@[email protected]
[CI#80]: https://gitlab.freedesktop.org/gfx-ci/i915-infra/issues/80
[fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
[fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
[i915#118]: https://gitlab.freedesktop.org/drm/intel/issues/118
[i915#1188]: https://gitlab.freedesktop.org/drm/intel/issues/1188
[i915#1436]: https://gitlab.freedesktop.org/drm/intel/issues/1436
[i915#1519]: https://gitlab.freedesktop.org/drm/intel/issues/1519
[i915#1635]: https://gitlab.freedesktop.org/drm/intel/issues/1635
[i915#1722]: https://gitlab.freedesktop.org/drm/intel/issues/1722
[i915#180]: https://gitlab.freedesktop.org/drm/intel/issues/180
[i915#1958]: https://gitlab.freedesktop.org/drm/intel/issues/1958
[i915#198]: https://gitlab.freedesktop.org/drm/intel/issues/198
[i915#1982]: https://gitlab.freedesktop.org/drm/intel/issues/1982
[i915#2055]: https://gitlab.freedesktop.org/drm/intel/issues/2055
[i915#2122]: https://gitlab.freedesktop.org/drm/intel/issues/2122
[i915#2278]: https://gitlab.freedesktop.org/drm/intel/issues/2278
[i915#2346]: https://gitlab.freedesktop.org/drm/intel/issues/2346
[i915#2389]: https://gitlab.freedesktop.org/drm/intel/issues/2389
[i915#2424]: https://gitlab.freedesktop.org/drm/intel/issues/2424
[i915#2483]: https://gitlab.freedesktop.org/drm/intel/issues/2483
[i915#265]: https://gitlab.freedesktop.org/drm/intel/issues/265
[i915#49]: https://gitlab.freedesktop.org/drm/intel/issues/49
[i915#716]: https://gitlab.freedesktop.org/drm/intel/issues/716
[i915#72]: https://gitlab.freedesktop.org/drm/intel/issues/72
[i915#95]: https://gitlab.freedesktop.org/drm/intel/issues/95
Participating hosts (11 -> 11)
------------------------------
No changes in participating hosts
Build changes
-------------
* Linux: CI_DRM_9025 -> Patchwork_18535
CI-20190529: 20190529
CI_DRM_9025: 955d04e2ed0cf4bb4679f594a852cc2eebe8266b @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5787: 0ec962017c8131de14e0cb038f7f76b1f17ed637 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_18535: c03e21031fb7ef6adb75d27990329e1bcfe2f765 @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18535/index.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 3 lines · Thomas Gleixner
this provides a preemptible variant of
kmap_atomic& related interfaces. This is achieved by:
Ack. This looks really nice, even apart from the new capability.
The only thing I really reacted to is that the name doesn't make sense to me: "kmap_temporary()" seems a bit odd.
Particularly for an interface that really is basically meant as a better replacement of "kmap_atomic()" (but is perhaps also a better replacement for "kmap()").
I think I understand how the name came about: I think the "temporary" is there as a distinction from the "longterm" regular kmap(). So I think it makes some sense from an internal implementation angle, but I don't think it makes a lot of sense from an interface name.
I don't know what might be a better name, but if we want to emphasize that it's thread-private and a one-off, maybe "local" would be a better naming, and make it distinct from the "global" nature of the old kmap() interface?
However, another solution might be to just use this new preemptible "local" kmap(), and remove the old global one entirely. Yes, the old global one caches the page table mapping and that sounds really efficient and nice. But it's actually horribly horribly bad, because it means that we need to use locking for them. Your new "temporary" implementation seems to be fundamentally better locking-wise, and only need preemption disabling as locking (and is equally fast for the non-highmem case).
So I wonder if the single-page TLB flush isn't a better model, and whether it wouldn't be a lot simpler to just get rid of the old complex kmap() entirely, and replace it with this?
I agree we can't replace the kmap_atomic() version, because maybe people depend on the preemption disabling it also implied. But what about replacing the non-atomic kmap()?
Maybe I've missed something. Is it because the new interface still does "pagefault_disable()" perhaps?
But does it even need the pagefault_disable() at all? Yes, the *atomic* one obviously needed it. But why does this new one need to disable page faults?
[ I'm just reading the patches, I didn't try to apply them and look at the end result, so I might have missed something ]
The only other worry I would have is just test coverage of this change. I suspect very few developers use HIGHMEM. And I know the various test robots don't tend to test 32-bit either.
But apart from that question about naming (and perhaps replacing kmap() entirely), I very much like it.
Linus
Quoted 33 lines · Linus Torvalds
Quoted 3 lines · Thomas Gleixner
this provides a preemptible variant of
kmap_atomic& related interfaces. This is achieved by:Ack. This looks really nice, even apart from the new capability.
The only thing I really reacted to is that the name doesn't make sense to me: "
kmap_temporary()" seems a bit odd.Particularly for an interface that really is basically meant as a better replacement of "
kmap_atomic()" (but is perhaps also a better replacement for "kmap()").I think I understand how the name came about: I think the "temporary" is there as a distinction from the "longterm" regular
kmap(). So I think it makes some sense from an internal implementation angle, but I don't think it makes a lot of sense from an interface name.I don't know what might be a better name, but if we want to emphasize that it's thread-private and a one-off, maybe "local" would be a better naming, and make it distinct from the "global" nature of the old
kmap()interface?However, another solution might be to just use this new preemptible "local"
kmap(), and remove the old global one entirely. Yes, the old global one caches the page table mapping and that sounds really efficient and nice. But it's actually horribly horribly bad, because it means that we need to use locking for them. Your new "temporary" implementation seems to be fundamentally better locking-wise, and only need preemption disabling as locking (and is equally fast for the non-highmem case).
Quoted 7 lines
So I wonder if the single-page TLB flush isn't a better model, and whether it wouldn't be a lot simpler to just get rid of the old complex
kmap()entirely, and replace it with this?I agree we can't replace the
kmap_atomic()version, because maybe people depend on the preemption disabling it also implied. But what about replacing the non-atomickmap()?
My concern with that is people might use kmap() and then pass the address to a different task. So we need to audit the current users of kmap() and convert any that do that into using vmap() instead.
I like kmap_local(). Or kmap_thread().
Quoted 4 lines · Matthew Wilcox
My concern with that is people might use
kmap()and then pass the address to a different task. So we need to audit the current users ofkmap()and convert any that do that into usingvmap()instead.
Ahh. Yes, I guess they might do that. It sounds strange, but not entirely crazy - I could imagine some "PIO thread" that does IO to a page that has been set up by somebody else using kmap(). Or similar.
Linus
Quoted 38 lines · Matthew Wilcox
Quoted 37 lines · Linus Torvalds
Quoted 3 lines · Thomas Gleixner
this provides a preemptible variant of
kmap_atomic& related interfaces. This is achieved by:Ack. This looks really nice, even apart from the new capability.
The only thing I really reacted to is that the name doesn't make sense to me: "
kmap_temporary()" seems a bit odd.Particularly for an interface that really is basically meant as a better replacement of "
kmap_atomic()" (but is perhaps also a better replacement for "kmap()").I think I understand how the name came about: I think the "temporary" is there as a distinction from the "longterm" regular
kmap(). So I think it makes some sense from an internal implementation angle, but I don't think it makes a lot of sense from an interface name.I don't know what might be a better name, but if we want to emphasize that it's thread-private and a one-off, maybe "local" would be a better naming, and make it distinct from the "global" nature of the old
kmap()interface?However, another solution might be to just use this new preemptible "local"
kmap(), and remove the old global one entirely. Yes, the old global one caches the page table mapping and that sounds really efficient and nice. But it's actually horribly horribly bad, because it means that we need to use locking for them. Your new "temporary" implementation seems to be fundamentally better locking-wise, and only need preemption disabling as locking (and is equally fast for the non-highmem case).So I wonder if the single-page TLB flush isn't a better model, and whether it wouldn't be a lot simpler to just get rid of the old complex
kmap()entirely, and replace it with this?
Quoted 8 lines
Quoted 3 lines
I agree we can't replace the
kmap_atomic()version, because maybe people depend on the preemption disabling it also implied. But what about replacing the non-atomickmap()?My concern with that is people might use
kmap()and then pass the address to a different task. So we need to audit the current users ofkmap()and convert any that do that into usingvmap()instead.
I've done some of this work.[3] PKS and pmem stray write protection[2] depend on kmap to enable the correct PKS settings. After working through the exception handling we realized that some users of kmap() seem to be doing just this; passing the address to a different task.
From what I have found ~90% of kmap() callers are 'kmap_thread()' and the other ~10% are kmap().[3] But of those 10% I'm not familiar with the code enough to know if they really require a 'global' map. What I do know is they save an address which appears to be used in other threads. But I could be wrong.
For PKS I added a 'global' implementation which could then be called by kmap() and added a new kmap_thread() call which used the original 'local' version of the PKS interface. The PKS work is still being reviewed internally for the TIP core code. But I've pushed it all to git hub for purposes of this discussion.[1]
Quoted 1 line
I like
kmap_local(). Orkmap_thread().
I chose kmap_thread() so that makes sense to me. I also thought about using kmap_global() as an alternative interface which would change just ~10% of the callers and make the series much smaller. But internal discussions lead me to chose kmap_thread() as the new interface so that we don't change the semantics of kmap().
Ira
[1] https://github.com/weiny2/linux-kernel/tree/lm-pks-pmem-for-5.10-v3
[2] https://lore.kernel.org/lkml/[email protected]/
[3]
12:42:06 > git grep ' kmap(' *.c | grep -v '* ' | wc -l 22
12:43:32 > git grep ' kmap_thread(' *.c | grep -v '* ' | wc -l 204
Here are the callers which hand an address to another thread.
12:45:25 > git grep ' kmap(' *.c | grep -v '* '
arch/x86/mm/dump_pagetables.c: [PKMAP_BASE_NR] = { 0UL, "Persistent kmap() Area" },
drivers/firewire/net.c: ptr = kmap(dev->broadcast_rcv_buffer.pages[u]);
drivers/gpu/drm/i915/gem/i915_gem_pages.c: return kmap(sg_page(sgt->sgl));
drivers/gpu/drm/i915/selftests/i915_perf.c: scratch = kmap(ce->vm->scratch[0].base.page);
drivers/gpu/drm/ttm/ttm_bo_util.c: map->virtual = kmap(map->page);
drivers/infiniband/hw/qib/qib_user_sdma.c: mpage = kmap(page);
drivers/misc/vmw_vmci/vmci_host.c: context->notify = kmap(context->notify_page) + (uva & (PAGE_SIZE - 1));
drivers/misc/xilinx_sdfec.c: addr = kmap(pages[i]);
drivers/mmc/host/usdhi6rol0.c: host->pg.mapped = kmap(host->pg.page);
drivers/mmc/host/usdhi6rol0.c: host->pg.mapped = kmap(host->pg.page);
drivers/mmc/host/usdhi6rol0.c: host->pg.mapped = kmap(host->pg.page);
drivers/nvme/target/tcp.c: iov->iov_base = kmap(sg_page(sg)) + sg->offset + sg_offset;
drivers/scsi/libiscsi_tcp.c: segment->sg_mapped = kmap(sg_page(sg));
drivers/target/iscsi/iscsi_target.c: iov[i].iov_base = kmap(sg_page(sg)) + sg->offset + page_off;
drivers/target/target_core_transport.c: return kmap(sg_page(sg)) + sg->offset;
fs/btrfs/check-integrity.c: block_ctx->datav[i] = kmap(block_ctx->pagev[i]);
fs/ceph/dir.c: cache_ctl->dentries = kmap(cache_ctl->page);
fs/ceph/inode.c: ctl->dentries = kmap(ctl->page);
lib/scatterlist.c: miter->addr = kmap(miter->page) + miter->__offset;
net/ceph/pagelist.c: pl->mapped_tail = kmap(page);
net/ceph/pagelist.c: pl->mapped_tail = kmap(page);
virt/kvm/kvm_main.c: hva = kmap(page);Quoted 9 lines · Linus Torvalds
Quoted 3 lines · Thomas Gleixner
this provides a preemptible variant of
kmap_atomic& related interfaces. This is achieved by:Ack. This looks really nice, even apart from the new capability.
The only thing I really reacted to is that the name doesn't make sense to me: "
kmap_temporary()" seems a bit odd.
Yeah. Couldn't come up with something useful.
Quoted 9 lines
Particularly for an interface that really is basically meant as a better replacement of "
kmap_atomic()" (but is perhaps also a better replacement for "kmap()").I think I understand how the name came about: I think the "temporary" is there as a distinction from the "longterm" regular
kmap(). So I think it makes some sense from an internal implementation angle, but I don't think it makes a lot of sense from an interface name.
Quoted 4 lines
I don't know what might be a better name, but if we want to emphasize that it's thread-private and a one-off, maybe "local" would be a better naming, and make it distinct from the "global" nature of the old
kmap()interface?
Right, _local or _thread would be more intuitive.
Quoted 17 lines
However, another solution might be to just use this new preemptible "local"
kmap(), and remove the old global one entirely. Yes, the old global one caches the page table mapping and that sounds really efficient and nice. But it's actually horribly horribly bad, because it means that we need to use locking for them. Your new "temporary" implementation seems to be fundamentally better locking-wise, and only need preemption disabling as locking (and is equally fast for the non-highmem case).So I wonder if the single-page TLB flush isn't a better model, and whether it wouldn't be a lot simpler to just get rid of the old complex
kmap()entirely, and replace it with this?I agree we can't replace the
kmap_atomic()version, because maybe people depend on the preemption disabling it also implied. But what about replacing the non-atomickmap()?
Quoted 6 lines
Maybe I've missed something. Is it because the new interface still does "
pagefault_disable()" perhaps?But does it even need the
pagefault_disable()at all? Yes, the *atomic* one obviously needed it. But why does this new one need to disable page faults?
It disables pagefaults because it can be called from atomic and non-atomic context. That was the point to get rid of
if (preeemptible())
kmap();
else
kmap_atomic();If it does not disable pagefaults, then it's just a lightweight variant of kmap() for short lived mappings.
Quoted 2 lines
But apart from that question about naming (and perhaps replacing
kmap()entirely), I very much like it.
I thought about it, but then I figured that kmap pointers can be handed to other contexts from the thread which sets up the mapping because it's 'permanent'.
I'm not sure whether that actually happens, so we'd need to audit all kmap() users to be sure. If there is no such use case, then we surely can get of rid of kmap() completely. It's only 300+ instances to stare at and quite some of them are wrapped into other functions.
Highmem sucks no matter what and the only sane solution is to remove it completely.
Thanks,
tglx
Quoted 11 lines · Thomas Gleixner
Quoted 6 lines · Linus Torvalds
Maybe I've missed something. Is it because the new interface still does "
pagefault_disable()" perhaps?But does it even need the
pagefault_disable()at all? Yes, the *atomic* one obviously needed it. But why does this new one need to disable page faults?It disables pagefaults because it can be called from atomic and non-atomic context. That was the point to get rid of
Quoted 7 lines
if (preeemptible()) kmap(); else kmap_atomic();If it does not disable pagefaults, then it's just a lightweight variant of
kmap()for short lived mappings.
Actually most usage sites of kmap atomic do not need page faults to be disabled at all. As Daniel pointed out the implicit pagefault disable enforces copy_from_user_inatomic() even in places which are clearly preemptible task context.
As we need to look at each instance anyway we can add the PF disable explicitely to the very few places which actually need it.
Thanks,
tglx
Quoted 3 lines · Thomas Gleixner
Actually most usage sites of kmap atomic do not need page faults to be disabled at all.
Right. I think the pagefault disabling has (almost) nothing at all to do with the kmap() itself - it comes from the "atomic" part, not the "kmap" part.
I say *almost*, because there is one issue that needs some thought:
the amount of kmap nesting.
The kmap_atomic() interface - and your local/temporary/whatever versions of it - depends very much inherently on being strictly nesting. In fact, it depends so much on it that maybe that should be part of the new name?
It's very wrong to do
addr1 = kmap_atomic();
addr2 = kmap_atomic();
..do something with addr 1..
kunmap_atomic(addr1);
.. do something with addr 2..
kunmap_atomic(addr2);because the way we allocate the slots is by using a percpu-atomic inc-return (and we deallocate using dec).
So it's fundamentally a stack.
And that's perfectly fine for page faults - if they do any kmaps, those will obviously nest.
So the only issue with page faults might be that the stack grows _larger_. And that might need some thought. We already make the kmap stack bigger for CONFIG_DEBUG_HIGHMEM, and it's possibly that if we allow page faults we need to make the kmap stack bigger still.
Btw, looking at the stack code, Ithink your new implementation of it is a bit scary:
static inline int kmap_atomic_idx_push(void)
{
- int idx = __this_cpu_inc_return(__kmap_atomic_idx) - 1;
+ int idx = current->kmap_ctrl.idx++;
and now that 'current->kmap_ctrl.idx' is not atomic wrt
(a) NMI's (this may be ok, maybe we never do kmaps in NMIs, and with
nesting I think it's fine anyway - the NMI will undo whatever it did)
(b) the prev/next switch
And that (b) part worries me. You do the kmap_switch_temporary() to switch the entries, but you do that *separately* from actually switching 'current' to the new value.
So kmap_switch_temporary() looks safe, but I don't think it actually is. Because while it first unmaps the old entries and then remaps the new ones, an interrupt can come in, and at that point it matters what is *CURRENT*.
And regardless of whether 'current' is 'prev' or 'next', that kmap_switch_temporary() loop may be doing the wrong thing, depending on which one had the deeper stack. The interrupt will be using whatever "current->kmap_ctrl.idx" is, but that might overwrite entries that are in the process of being restored (if current is still 'prev', but kmap_switch_temporary() is in the "restore @next's kmaps" pgase), or it might stomp on entries that have been pte_clear()'ed by the 'prev' thing.
I dunno. The latter may be one of those "it works anyway, it overwrites things we don't care about", but the former will most definitely not work.
And it will be completely impossible to debug, because it will depend on an interrupt that uses kmap_local/atomic/whatever() coming in _just_ at the right point in the scheduler, and only when the scheduler has been entered with the right number of kmap entries on the prev/next stack.
And no developer will ever see this with any amount of debug code enabled, because it will only hit on legacy platforms that do this kmap anyway.
So honestly, that code scares me. I think it's buggy. And even if it "happens to work", it does so for all the wrong reasons, and is very fragile.
So I would suggest:
- continue to use an actual per-cpu kmap_atomic_idx
- make the switching code save the old idx, then unmap the old
entries one by one (while doing the proper "pop" action), and then map the new entries one by one (while doing the proper "push" action).
which would mean that the only index that is actually ever *USED* is the percpu one, and it's always up-to-date and pushed/popped for individual entries, rather than this - imho completely bogus - optimization where you use "p->kmap_ctrl.idx" directly and very very unsafely.
Alternatively, that process counter would need about a hundred lines of commentary about exactly why it's safe. Because I don't think it is.
Linus
Quoted 9 lines · Linus Torvalds
On Sun, Sep 20, 2020 at 1:49 AM Thomas Gleixner <[email protected]> wrote:
Btw, looking at the stack code, Ithink your new implementation of it is a bit scary:static inline int
kmap_atomic_idx_push(void)
{
- int idx =__this_cpu_inc_return(__kmap_atomic_idx)- 1;
+ int idx = current->kmap_ctrl.idx++;
Quoted 4 lines
and now that '
current->kmap_ctrl.idx' is not atomic wrt(a) NMI's (this may be ok, maybe we never do kmaps in NMIs, and with
nesting I think it's fine anyway - the NMI will undo whatever it did)
Right. Nesting should be a non issue, but I don't think we have kmap_atomic() in NMI context.
Quoted 11 lines
(b) the prev/next switch
And that (b) part worries me. You do the
kmap_switch_temporary()to switch the entries, but you do that *separately* from actually switching 'current' to the new value.So
kmap_switch_temporary()looks safe, but I don't think it actually is. Because while it first unmaps the old entries and then remaps the new ones, an interrupt can come in, and at that point it matters what is *CURRENT*.
Quoted 8 lines
And regardless of whether 'current' is 'prev' or 'next', that
kmap_switch_temporary()loop may be doing the wrong thing, depending on which one had the deeper stack. The interrupt will be using whatever "current->kmap_ctrl.idx" is, but that might overwrite entries that are in the process of being restored (if current is still 'prev', butkmap_switch_temporary()is in the "restore @next's kmaps" pgase), or it might stomp on entries that have been pte_clear()'ed by the 'prev' thing.
Duh yes. Never thought about that.
Quoted 3 lines
Alternatively, that process counter would need about a hundred lines of commentary about exactly why it's safe. Because I don't think it is.
I think the more obvious solution is to split the whole exercise:
schedule()
prepare_switch()
unmap()
switch_to()
finish_switch()
map()That's safe because neither the unmap() nor the map() code changes kmap_ctrl.idx. So if there is an interrupt coming in between unmap() and switch_to() then a kmap_local() there will use the next entry. So we could even do the unmap() with interrupts enabled (preemption disabled). Same for the map() part.
To explain that we need only a few lines of commentry methinks.
Thanks,
tglx
Quoted 11 lines · Thomas Gleixner
I think the more obvious solution is to split the whole exercise:
schedule()prepare_switch() unmap() switch_to() finish_switch() map()
Yeah, that looks much easier to explain. Ack.
Linus
Quoted 2 lines · Linus Torvalds
Yeah, that looks much easier to explain. Ack.
Btw, one thing that might be a good idea at least initially is to add a check for p->kmap_ctrl.idx being zero at fork, exit and maybe syscall return time (but that last one may be too cumbersome to really worry about).
The kmap_atomic() interface basically has a lot of coverage for leaked as part of all the "might_sleep()" checks sprinkled around, The new kmap_temporary/local/whatever wouldn't have that kind of incidental debug checking, and any leaked kmap indexes would be rather hard to debug (much) later when they cause index overflows or whatever.
Linus
Quoted 8 lines · Linus Torvalds
Quoted 7 lines · Thomas Gleixner
I think the more obvious solution is to split the whole exercise:
schedule()prepare_switch() unmap()
Quoted 6 lines
Quoted 4 lines
switch_to() finish_switch() map()Yeah, that looks much easier to explain. Ack.
So far so good, but Peter Z. just pointed out to me that I completely missed the fact that this cannot work.
If a task is migrated to a different CPU then the mapping address will change which will explode in colourful ways.
On RT kernels this works because we ping the task to the CPU via migrate_disable(). On a !RT kernel migrate_disable() maps to preempt_disable() which brings us back to square one.
/me goes back to the drawing board.
Thanks,
tglx
Quoted 3 lines · Thomas Gleixner
If a task is migrated to a different CPU then the mapping address will change which will explode in colourful ways.
Heh.
Right you are.
Maybe we really *could* call this new kmap functionality something like "kmap_percpu()" (or maybe "local" is good enough), and make it act like your RT code does for spinlocks - not disable preemption, but only disabling CPU migration.
That would probably be good enough for a lot of users that don't want to expose excessive latencies, but where it's really not a huge deal to say "stick to this CPU for a short while".
The crypto code certainly sounds like one such case.
Linus
Quoted 11 lines · Linus Torvalds
Quoted 3 lines · Thomas Gleixner
If a task is migrated to a different CPU then the mapping address will change which will explode in colourful ways.
Right you are.
Maybe we really *could* call this new kmap functionality something like "
kmap_percpu()" (or maybe "local" is good enough), and make it act like your RT code does for spinlocks - not disable preemption, but only disabling CPU migration.
I"m all for it, but the scheduler people have opinions :)
Quoted 5 lines
That would probably be good enough for a lot of users that don't want to expose excessive latencies, but where it's really not a huge deal to say "stick to this CPU for a short while".
The crypto code certainly sounds like one such case.
I looked at a lot of the kmap_atomic() places and quite some of them only require migration to be disabled to keep the temporary map stable.
Quite some code could be simplified significantly especially those places which need to do copy_from/to_user inside these sections. Graphics is the main example here as Daniel pointed out.
Alternatively this could of course be solved with per CPU page tables which will come around some day anyway I fear.
Thanks,
tglx
[email protected]
maintainerQuoted 6 lines · Thomas Gleixner
Quoted 5 lines · Linus Torvalds
Quoted 3 lines · Thomas Gleixner
If a task is migrated to a different CPU then the mapping address will change which will explode in colourful ways.
Quoted 8 lines
Quoted 6 lines
Right you are.
Maybe we really *could* call this new kmap functionality something like "
kmap_percpu()" (or maybe "local" is good enough), and make it act like your RT code does for spinlocks - not disable preemption, but only disabling CPU migration.I"m all for it, but the scheduler people have opinions :)
Right, so I'm concerned. migrate_disable() wrecks pretty much all Real-Time scheduler theory we have, and PREEMPRT_RT bringing it in is somewhat ironic.
Yes, it allows breaking up non-preemptible regions of non-deterministic duration, and thereby both reduce and bound the scheduling latency, the cost for doing that is that the theory on CPU utilization/bandwidth go out the window.
To easily see this consider an SMP system with a number of tasks equal to the number of CPUs. On a regular (preempt_disable) kernel we can always run each task, by virtue of always having an idle CPU to take the task.
However, with migrate_disable() we can have each task preempted in a migrate_disable() region, worse we can stack them all on the _same_ CPU (super ridiculous odds, sure). And then we end up only able to run one task, with the rest of the CPUs picking their nose.
The end result is that, like with unbounded latency, we will still miss our deadline, simply because we got starved for CPU.
Now, while we could (with a _lot_ of work) rework the kernel to not rely on the implicit per-cpu ness of things like spinlock_t, the moment we bring in basic primitives that rely on migrate_disable() we're stuck with it.
The problem is; afaict there's been no research into this problem. There might be scheduling (read: balancing) schemes that can mitigate/solve this problem, or it might prove to be a 'hard' problem, I just don't know. But once we start down this road, it's going to be hell to get rid of it.
That's why I've been arguing (for many years) to strictly limit this to PREEMPT_RT and only as a gap-stop, not a fundamental primitive to build on.
Quoted 3 lines · peterz
Right, so I'm concerned.
migrate_disable()wrecks pretty much all Real-Time scheduler theory we have, andPREEMPRT_RTbringing it in is somewhat ironic.
It's even more ironic that the approach of PREEMPT_RT has been 'pragmatic ignorance of theory' from the very beginning and despite violating all theories it still works. :)
Quoted 4 lines
Yes, it allows breaking up non-preemptible regions of non-deterministic duration, and thereby both reduce and bound the scheduling latency, the cost for doing that is that the theory on CPU utilization/bandwidth go out the window.
I agree, that the theory goes out of the window, but does it matter in practice? I've yet to see a report of migrate disable stacking being the culprit of a missed deadline and I surely have stared at lots of reports in the past 10+ years.
Quoted 5 lines
To easily see this consider an SMP system with a number of tasks equal to the number of CPUs. On a regular (
preempt_disable) kernel we can always run each task, by virtue of always having an idle CPU to take the task.
Quoted 7 lines
However, with
migrate_disable()we can have each task preempted in amigrate_disable()region, worse we can stack them all on the _same_ CPU (super ridiculous odds, sure). And then we end up only able to run one task, with the rest of the CPUs picking their nose.The end result is that, like with unbounded latency, we will still miss our deadline, simply because we got starved for CPU.
I'm well aware of that.
Quoted 4 lines
Now, while we could (with a _lot_ of work) rework the kernel to not rely on the implicit per-cpu ness of things like
spinlock_t, the moment we bring in basic primitives that rely onmigrate_disable()we're stuck with it.
Right, but we are stuck with per CPUness and distangling that is just infeasible IMO.
Quoted 1 line
The problem is; afaict there's been no research into this problem.
There is no research on a lot of things the kernel does :)
Quoted 3 lines
There might be scheduling (read: balancing) schemes that can mitigate/solve this problem, or it might prove to be a 'hard' problem, I just don't know.
In practive balancing surely can take the number of preempted tasks which are in a migrate disable section into account which would be just another measure to work around the fact that the kernel is not adhering to the theories. It never did that even w/o migrate disable.
Quoted 2 lines
But once we start down this road, it's going to be hell to get rid of it.
Like most of the other things the kernel came up with to deal with the oddities of modern hardware :)
Quoted 3 lines
That's why I've been arguing (for many years) to strictly limit this to
PREEMPT_RTand only as a gap-stop, not a fundamental primitive to build on.
I know, but short of rewriting the world, I'm not seing the faintest plan to remove the stop gap. :)
As we discussed not long ago we have too many inconsistent preemption models already. RT is adding yet another one. And that's worse than introducing migrate disable as a general available facility.
IMO, reaching a point of consistency where our different preemption models (NONE, VOLUNTARY, PREEMPT. RT) build on each other is far more important.
For !RT migrate disable is far less of an danger than for RT kernels because the amount of code which will use it is rather limited compared to code which still will disable preemption implicit through spin and rw locks.
On RT converting these locks to 'sleepable spinlocks' is just possible because RT forces almost everything into task context and migrate disable is just the obvious decomposition of preempt disable which implicitely disables migration.
But that means that RT is by orders of magnitude more prone to run into the scheduling trainwreck you are worried about. It just refuses to do so at least with real world work loads.
I'm surely in favour of having solid theories behind implementation, but at some point you just have to bite the bullet and chose pragmatism in order to make progress.
Proliferating inconsistency is not real progress, as it is violating the most fundamental engineering principles. That's by far more dangerous than violating scheduling theories which are built on perfect models and therefore enforce violation by practical implementations anyway.
Thanks,
tglx
Steven Rostedt
reviewerQuoted 4 lines · On Wed, 23 Sep 2020 10:40:32 +0200 [email protected] wrote:
However, with
migrate_disable()we can have each task preempted in amigrate_disable()region, worse we can stack them all on the _same_ CPU (super ridiculous odds, sure). And then we end up only able to run one task, with the rest of the CPUs picking their nose.
What if we just made migrate_disable() a local_lock() available for !RT?
I mean make it a priority inheritance PER CPU lock.
That is, no two tasks could do a migrate_disable() on the same CPU? If one task does a migrate_disable() and then gets preempted and the preempting task does a migrate_disable() on the same CPU, it will block and wait for the first task to do a migrate_enable().
No two tasks on the same CPU could enter the migrate_disable() section simultaneously, just like no two tasks could enter a preempt_disable() section.
In essence, we just allow local_lock() to be used for both RT and !RT.
Perhaps make migrate_disable() an anonymous local_lock()?
This should lower the SHC in theory, if you can't have stacked migrate disables on the same CPU.
-- Steve
Quoted 21 lines · Steven Rostedt
Quoted 4 lines · On Wed, 23 Sep 2020 10:40:32 +0200 [email protected] wrote:
However, with
migrate_disable()we can have each task preempted in amigrate_disable()region, worse we can stack them all on the _same_ CPU (super ridiculous odds, sure). And then we end up only able to run one task, with the rest of the CPUs picking their nose.What if we just made
migrate_disable()alocal_lock()available for !RT?I mean make it a priority inheritance PER CPU lock.
That is, no two tasks could do a
migrate_disable()on the same CPU? If one task does amigrate_disable()and then gets preempted and the preempting task does amigrate_disable()on the same CPU, it will block and wait for the first task to do amigrate_enable().No two tasks on the same CPU could enter the
migrate_disable()section simultaneously, just like no two tasks could enter apreempt_disable()section.
Quoted 6 lines
In essence, we just allow
local_lock()to be used for both RT and !RT.Perhaps make
migrate_disable()an anonymouslocal_lock()?This should lower the SHC in theory, if you can't have stacked migrate disables on the same CPU.
I'm pretty sure this ends up in locking hell pretty fast and aside of that it's not working for scenarios like:
kmap_local();
migrate_disable();
...
copy_from_user()
-> #PF
-> schedule()which brought us into that discussion in the first place. You would stop any other migrate disable user from running until the page fault is resolved...
Thanks,
tglx
Steven Rostedt
reviewerQuoted 16 lines · On Wed, 23 Sep 2020 22:55:54 +0200 Thomas Gleixner <[email protected]> wrote:
Quoted 4 lines
Perhaps make
migrate_disable()an anonymouslocal_lock()?This should lower the SHC in theory, if you can't have stacked migrate disables on the same CPU.
I'm pretty sure this ends up in locking hell pretty fast and aside of that it's not working for scenarios like:
kmap_local(); migrate_disable(); ... copy_from_user() -> #PF -> schedule()
Quoted 3 lines
which brought us into that discussion in the first place. You would stop any other migrate disable user from running until the page fault is resolved...
Then scratch the idea of having anonymous local_lock() and just bring local_lock in directly? Then have a kmap local lock, which would only block those that need to do a kmap.
Now as for migration disabled nesting, at least now we would have groupings of this, and perhaps the theorists can handle that. I mean, how is this much different that having a bunch of tasks blocked on a mutex with the owner is pinned on a CPU?
migrate_disable() is a BKL of pinning affinity. If we only have local_lock() available (even on !RT), then it makes the blocking in groups. At least this way you could grep for all the different local_locks in the system and plug that into the algorithm for WCS, just like one would with a bunch of mutexes.
-- Steve
Quoted 4 lines · Steven Rostedt
On Wed, 23 Sep 2020 22:55:54 +0200
Then scratch the idea of having anonymouslocal_lock()and just bringlocal_lockin directly? Then have a kmap local lock, which would only block those that need to do a kmap.
That's still going to end up in lock ordering nightmares and you lose the ability to use kmap_local from arbitrary contexts which was again one of the goals of this exercise.
Aside of that you're imposing reentrancy protections on something which does not need it in the first place.
Quoted 6 lines
Now as for migration disabled nesting, at least now we would have groupings of this, and perhaps the theorists can handle that. I mean, how is this much different that having a bunch of tasks blocked on a mutex with the owner is pinned on a CPU?
migrate_disable()is a BKL of pinning affinity.
No. That's just wrong. preempt disable is a concurrency control, i.e. protecting against reentrancy on a given CPU. But it's a cpu global protection which means that it's not protecting a specific code path.
Contrary to preempt disable, migrate disable is not protecting against reentrancy on a given CPU. It's a temporary restriction to the scheduler on placement.
The fact that disabling preemption implicitely disables migration does not make them semantically equivalent.
Quoted 4 lines
If we only have
local_lock()available (even on !RT), then it makes the blocking in groups. At least this way you could grep for all the differentlocal_locksin the system and plug that into the algorithm for WCS, just like one would with a bunch of mutexes.
You cannot do that on RT at all where migrate disable is substituting preempt disable in spin and rw locks. The result would be the same as with a !RT kernel just with horribly bad performance.
That means the stacking problem has to be solved anyway.
So why on earth do you want to create yet another special duct tape case for kamp_local() which proliferates inconsistency instead of aiming for consistency accross all preemption models?
Thanks,
tglx
Steven Rostedt
reviewerQuoted 8 lines · On Thu, 24 Sep 2020 08:57:52 +0200 Thomas Gleixner <[email protected]> wrote:
Quoted 6 lines
Now as for migration disabled nesting, at least now we would have groupings of this, and perhaps the theorists can handle that. I mean, how is this much different that having a bunch of tasks blocked on a mutex with the owner is pinned on a CPU?
migrate_disable()is a BKL of pinning affinity.No. That's just wrong. preempt disable is a concurrency control,
I think you totally misunderstood what I was saying. The above wasn't about comparing preempt_disable to migrate_disable. It was comparing migrate_disable to a chain of tasks blocked on mutexes where the top owner has preempt_disable set. You still have a bunch of tasks that can't move to other CPUs.
Quoted 8 lines
Quoted 4 lines
If we only have
local_lock()available (even on !RT), then it makes the blocking in groups. At least this way you could grep for all the differentlocal_locksin the system and plug that into the algorithm for WCS, just like one would with a bunch of mutexes.You cannot do that on RT at all where migrate disable is substituting preempt disable in spin and rw locks. The result would be the same as with a !RT kernel just with horribly bad performance.
Note, the spin and rwlocks already have a lock associated with them. Why would it be any different on RT? I wasn't suggesting adding another lock inside a spinlock. Why would I recommend THAT? I wasn't recommending blindly replacing migrate_disable() with local_lock(). I just meant expose local_lock() but not migrate_disable().
Quoted 6 lines
That means the stacking problem has to be solved anyway.
So why on earth do you want to create yet another special duct tape case for
kamp_local()which proliferates inconsistency instead of aiming for consistency accross all preemption models?
The idea was to help with the scheduling issue.
Anyway, instead of blocking. What about having a counter of number of migrate disabled tasks per cpu, and when taking a migrate_disable(), and there's already another task with migrate_disabled() set, and the current task has an affinity greater than 1, it tries to migrate to another CPU?
This way migrate_disable() is less likely to have a bunch of tasks blocked on one CPU serialized by each task exiting the migrate_disable() section.
Yes, there's more overhead, but it only happens if multiple tasks are in a migrate disable section on the same CPU.
-- Steve
Peter Zijlstra
maintainerQuoted 4 lines · Steven Rostedt
Anyway, instead of blocking. What about having a counter of number of migrate disabled tasks per cpu, and when taking a
migrate_disable(), and there's already another task withmigrate_disabled()set, and the current task has an affinity greater than 1, it tries to migrate to another CPU?
That doesn't solve the problem. On wakeup we should already prefer an idle CPU over one running a (RT) task, but you can always wake more tasks than there's CPUs around and you'll _have_ to stack at some point.
The trick is how to unstack them correctly. We need to detect when a migrate_disable() task _should_ start running again, and migrate away whoever is in the way at that point.
It turns out, that getting selected for pull-balance is exactly that condition, and clearly a migrate_disable() task cannot be pulled, but we can use that signal to try and pull away the running task that's in the way.
Steven Rostedt
reviewerQuoted 9 lines · On Thu, 24 Sep 2020 14:42:41 +0200 Peter Zijlstra <[email protected]> wrote:
Quoted 4 lines · Steven Rostedt
Anyway, instead of blocking. What about having a counter of number of migrate disabled tasks per cpu, and when taking a
migrate_disable(), and there's already another task withmigrate_disabled()set, and the current task has an affinity greater than 1, it tries to migrate to another CPU?That doesn't solve the problem. On wakeup we should already prefer an idle CPU over one running a (RT) task, but you can always wake more tasks than there's CPUs around and you'll _have_ to stack at some point.
Yes, understood.
Quoted 9 lines
The trick is how to unstack them correctly. We need to detect when a
migrate_disable()task _should_ start running again, and migrate away whoever is in the way at that point.It turns out, that getting selected for pull-balance is exactly that condition, and clearly a
migrate_disable()task cannot be pulled, but we can use that signal to try and pull away the running task that's in the way.
Unless of course that running task is in a migrate disable section itself ;-)
But I guess we will always have that SHC, and there will always be a scenario that you can't balance properly. But hopefully in practice we wont see that.
How to handle kmap_local(), will migrate_disable() be used only for 32bit or, for consistency, will it also apply to 64bit?
-- Steve
Peter Zijlstra
maintainerQuoted 7 lines · Steven Rostedt
Quoted 4 lines
It turns out, that getting selected for pull-balance is exactly that condition, and clearly a
migrate_disable()task cannot be pulled, but we can use that signal to try and pull away the running task that's in the way.Unless of course that running task is in a migrate disable section itself ;-)
See my ramblings here:
https://lkml.kernel.org/r/[email protected]
My plan was to have the migrate_enable() of the running task trigger the migration in that case.
Quoted 10 lines · Steven Rostedt
Quoted 7 lines · On Thu, 24 Sep 2020 08:57:52 +0200 Thomas Gleixner <[email protected]> wrote:
Quoted 6 lines
Now as for migration disabled nesting, at least now we would have groupings of this, and perhaps the theorists can handle that. I mean, how is this much different that having a bunch of tasks blocked on a mutex with the owner is pinned on a CPU?
migrate_disable()is a BKL of pinning affinity.
Quoted 7 lines
Quoted 1 line
No. That's just wrong. preempt disable is a concurrency control,
I think you totally misunderstood what I was saying. The above wasn't about comparing
preempt_disabletomigrate_disable. It was comparingmigrate_disableto a chain of tasks blocked on mutexes where the top owner haspreempt_disableset. You still have a bunch of tasks that can't move to other CPUs.
What? The top owner does not prevent any task from moving. The tasks cannot move because they are blocked on the mutex, which means they are not runnable and non runnable tasks are not migrated at all.
I really don't understand what you are trying to say.
Quoted 9 lines
Quoted 8 lines
Quoted 4 lines
If we only have
local_lock()available (even on !RT), then it makes the blocking in groups. At least this way you could grep for all the differentlocal_locksin the system and plug that into the algorithm for WCS, just like one would with a bunch of mutexes.You cannot do that on RT at all where migrate disable is substituting preempt disable in spin and rw locks. The result would be the same as with a !RT kernel just with horribly bad performance.
Quoted 5 lines
Note, the spin and rwlocks already have a lock associated with them. Why would it be any different on RT? I wasn't suggesting adding another lock inside a spinlock. Why would I recommend THAT? I wasn't recommending blindly replacing
migrate_disable()withlocal_lock(). I just meant exposelocal_lock()but notmigrate_disable().
We already exposed local_lock() to non RT and it's for places which do preempt_disable() or local_irq_disable() without having a lock associated. But both primitives are scope less and therefore behave like CPU local BKLs. What local_lock() provides in these cases is:
- Making the protection scope clear by associating a named local lock which is coverred by lockdep.
- It still maps to preempt_disable() or local_irq_disable() in !RT kernels
- The scope and the named lock allows RT kernels to substitute with real (recursion aware) locking primitives which keep preemption and interupts enabled, but provide the fine grained protection for the scoped critical section.
So how would you substitute migrate_disable() with a local_lock()? You can't. Again migrate_disable() is NOT a concurrency control and therefore it cannot be substituted by any concurrency control primitive.
Quoted 7 lines
Quoted 5 lines
That means the stacking problem has to be solved anyway.
So why on earth do you want to create yet another special duct tape case for
kamp_local()which proliferates inconsistency instead of aiming for consistency accross all preemption models?The idea was to help with the scheduling issue.
I don't see how mixing concepts and trying to duct tape a problem which is clearly in the realm of the scheduler, i.e. load balancing and placing algorithms, is helpful.
Thanks,
tglx
Steven Rostedt
reviewerQuoted 19 lines · On Thu, 24 Sep 2020 19:55:10 +0200 Thomas Gleixner <[email protected]> wrote:
Quoted 10 lines · Steven Rostedt
Quoted 7 lines · On Thu, 24 Sep 2020 08:57:52 +0200 Thomas Gleixner <[email protected]> wrote:
Quoted 6 lines
Now as for migration disabled nesting, at least now we would have groupings of this, and perhaps the theorists can handle that. I mean, how is this much different that having a bunch of tasks blocked on a mutex with the owner is pinned on a CPU?
migrate_disable()is a BKL of pinning affinity.Quoted 7 lines
Quoted 1 line
No. That's just wrong. preempt disable is a concurrency control,
I think you totally misunderstood what I was saying. The above wasn't about comparing
preempt_disabletomigrate_disable. It was comparingmigrate_disableto a chain of tasks blocked on mutexes where the top owner haspreempt_disableset. You still have a bunch of tasks that can't move to other CPUs.
Quoted 3 lines
What? The top owner does not prevent any task from moving. The tasks cannot move because they are blocked on the mutex, which means they are not runnable and non runnable tasks are not migrated at all.
And neither are migrated disabled tasks preempted by a high priority task.
Quoted 2 lines
I really don't understand what you are trying to say.
Don't worry about it. I was just making a high level comparison of how migrate disabled tasks blocked on a higher priority task is similar to that of tasks blocked on a mutex held by a pinned task that is preempted by a high priority task. But we can forget this analogy as it's not appropriate for the current conversation.
Quoted 24 lines
Quoted 10 lines
Quoted 9 lines
Quoted 5 lines
If we only have
local_lock()available (even on !RT), then it makes the blocking in groups. At least this way you could grep for all the differentlocal_locksin the system and plug that into the algorithm for WCS, just like one would with a bunch of mutexes.You cannot do that on RT at all where migrate disable is substituting preempt disable in spin and rw locks. The result would be the same as with a !RT kernel just with horribly bad performance.
Quoted 5 lines
Note, the spin and rwlocks already have a lock associated with them. Why would it be any different on RT? I wasn't suggesting adding another lock inside a spinlock. Why would I recommend THAT? I wasn't recommending blindly replacing
migrate_disable()withlocal_lock(). I just meant exposelocal_lock()but notmigrate_disable().We already exposed
local_lock()to non RT and it's for places which dopreempt_disable()orlocal_irq_disable()without having a lock associated. But both primitives are scope less and therefore behave like CPU local BKLs. Whatlocal_lock()provides in these cases is:- Making the protection scope clear by associating a named local lock which is coverred by lockdep.
Quoted 7 lines
- It still maps to
preempt_disable()orlocal_irq_disable()in !RT kernels- The scope and the named lock allows RT kernels to substitute with real (recursion aware) locking primitives which keep preemption and interupts enabled, but provide the fine grained protection for the scoped critical section.
I'm very much aware of the above.
Quoted 4 lines
So how would you substitute
migrate_disable()with alocal_lock()? You can't. Againmigrate_disable()is NOT a concurrency control and therefore it cannot be substituted by any concurrency control primitive.
When I was first writing my email, I was writing about a way to replace migrate_disable with a construct similar to local locks without actually mentioning local locks, but then rewrote it to state local locks, trying to simplify what I was writing. I shouldn't have done that, because it portrayed that I wanted to use local_lock() unmodified. I was actually thinking of a new construct that was similar but not exactly the same as local lock.
But this will just make things more complex and we can forget about it.
I'll wait to see what Peter produces.
-- Steve
[email protected]
maintainerQuoted 9 lines · Steven Rostedt
Quoted 4 lines · On Wed, 23 Sep 2020 10:40:32 +0200 [email protected] wrote:
However, with
migrate_disable()we can have each task preempted in amigrate_disable()region, worse we can stack them all on the _same_ CPU (super ridiculous odds, sure). And then we end up only able to run one task, with the rest of the CPUs picking their nose.What if we just made
migrate_disable()alocal_lock()available for !RT?
Can't, neiter migrate_disable() nor migrate_enable() are allowed to block -- which is what makes their implementation so 'interesting'.
Quoted 2 lines
This should lower the SHC in theory, if you can't have stacked migrate disables on the same CPU.
See this email in that other thread (you're on Cc too IIRC):
https://lkml.kernel.org/r/[email protected]
I think that is we 'frob' the balance PULL, we'll end up with something similar.
Whichever way around we turn this thing, the migrate_disable() runtime (we'll have to add a tracer for that), will be an interference term on the lower priority task, exactly like preempt_disable() would be. We'll just not exclude a higher priority task from running.
AFAICT; the best case is a single migrate_disable() nesting, where a higher priority task preempts in a migrate_disable() section -- this is per design.
When this preempted task becomes elegible to run under the ideal model (IOW it becomes one of the M highest priority tasks), it might still have to wait for the preemptee's migrate_disable() section to complete. Thereby suffering interference in the exact duration of migrate_disable() section.
Per this argument, the change from preempt_disable() to migrate_disable() gets us:
- higher priority tasks gain reduced wake-up latency
- lower priority tasks are unchanged and are subject to the exact same interference term as if the higher priority task were using preempt_disable().
Since we've already established this term is unbounded, any task but the highest priority task is basically buggered.
TL;DR, if we get balancing fixed and achieve (near) the optimal case above, migrate_disable() is an over-all win. But it's provably non-deterministic as long as the migrate_disable() sections are non-deterministic.
The reason this all mostly works in practise is (I think) because:
- People care most about the higher prio RT tasks and craft them to mostly avoid the migrate_disable() infected code.
- The preemption scenario is most pronounced at higher utilization scenarios, and I suspect this is fairly rare to begin with.
- And while many of these migrate_disable() regions are unbound in theory, in practise they're often fairly reasonable.
So my current todo list is:
- Change RT PULL
- Change DL PULL
- Add migrate_disable() tracer; exactly like preempt/irqoff, except measuring task-runtime instead of cpu-time.
- Add a mode that measures actual interference.
- Add a traceevent to detect preemption in migrate_disable().
And then I suppose I should twist Daniel's arm to update his model to include these scenarios and numbers.
Quoted 10 lines · On 9/24/20 10:27 AM, [email protected] wrote:
So my current todo list is:
- Change RT PULL
- Change DL PULL
- Addmigrate_disable()tracer; exactly like preempt/irqoff, except measuring task-runtime instead of cpu-time.
- Add a mode that measures actual interference.
- Add a traceevent to detect preemption inmigrate_disable().
Quoted 2 lines
And then I suppose I should twist Daniel's arm to update his model to include these scenarios and numbers.
Challenge accepted :-)
-- Daniel
[email protected]
maintainerQuoted 2 lines · Thomas Gleixner
Alternatively this could of course be solved with per CPU page tables which will come around some day anyway I fear.
Previously (with PTI) we looked at making the entire kernel map per-CPU, and that takes a 2K copy on switch_mm() (or more general, the user part of whatever the top level directory is for architectures that have a shared kernel/user page-table setup in the first place).
The idea was having a fixed per-cpu kernel page-table, share a bunch of (kernel) page-tables between all CPUs and then copy in the user part on switch.
I've forgotten what the plan was for ASID/PCID in that scheme.
For x86_64 we've been fearing the performance of that 2k copy, but I don't think we've ever actually bit the bullet and implemented it to see how bad it really is.
Quoted 13 lines · peterz
Quoted 2 lines · Thomas Gleixner
Alternatively this could of course be solved with per CPU page tables which will come around some day anyway I fear.
Previously (with PTI) we looked at making the entire kernel map per-CPU, and that takes a 2K copy on
switch_mm()(or more general, the user part of whatever the top level directory is for architectures that have a shared kernel/user page-table setup in the first place).The idea was having a fixed per-cpu kernel page-table, share a bunch of (kernel) page-tables between all CPUs and then copy in the user part on switch.
Quoted 5 lines
I've forgotten what the plan was for ASID/PCID in that scheme.
For
x86_64we've been fearing the performance of that 2k copy, but I don't think we've ever actually bit the bullet and implemented it to see how bad it really is.
I actually did at some point and depending on the workload the overhead was clearly measurable. And yes, it fell apart with PCID and I could not come up with a scheme for it which did not suck horribly. So I burried the patches in the poison cabinet.
Aside of that, we'd need to implement that for a eight other architectures as well...
Thanks,
tglx
Quoted 8 lines · Thomas Gleixner
Quoted 5 lines · Linus Torvalds
On Mon, Sep 21, 2020 at 12:39 AM Thomas Gleixner <[email protected]> wrote:
Maybe we really *could* call this new kmap functionality something like "kmap_percpu()" (or maybe "local" is good enough), and make it act like your RT code does for spinlocks - not disable preemption, but only disabling CPU migration.I"m all for it, but the scheduler people have opinions :)
I just took the latest version of migrate disable patches
https://lore.kernel.org/r/[email protected]
removed the RT dependency on top of them and adopted the kmap stuff (addressing the various comments while at it and unbreaking ARM).
I'm not going to post that until there is consensus about the general availability of migrate disable, but for those who want to play with it I've pushed the resulting combo out to:
git://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git highmem
For testing I've tweaked a few places to use the new _local() variants and it survived testing so far and I've verified that there is actual preemption which means zap/restore of the thread local kmaps.
Thanks,
tglx