Re: [v2 PATCH 0/3] arch: mm, vdso: consolidate PAGE_SIZE definition

2024-03-06 Thread Thomas Gleixner
On Wed, Mar 06 2024 at 15:14, Arnd Bergmann wrote: > From: Arnd Bergmann > > Naresh noticed that the newly added usage of the PAGE_SIZE macro in > include/vdso/datapage.h introduced a build regression. I had an older > patch that I revived to have this defined through Kconfig rather than > through

Re: [PATCH v2 3/3] arch: define CONFIG_PAGE_SIZE_*KB on all architectures

2024-03-06 Thread Thomas Gleixner
n one and allow > only the hardware page size to be selected. > > Acked-by: Guo Ren > Acked-by: Heiko Carstens > Acked-by: Stafford Horne > Acked-by: Johannes Berg > Signed-off-by: Arnd Bergmann Reviewed-by: Thomas Gleixner ___ li

Re: [PATCH v2 2/3] arch: simplify architecture specific page size configuration

2024-03-06 Thread Thomas Gleixner
e > leaving the arhcitecture specific ones as the user visible > place for configuring it, to avoid breaking user configs. > > Reviewed-by: Christophe Leroy (powerpc32) > Acked-by: Catalin Marinas > Acked-by: Helge Deller # parisc > Signed-off-by: Arnd Ber

Re: [PATCH v2 1/3] arch: consolidate existing CONFIG_PAGE_SIZE_*KB definitions

2024-03-06 Thread Thomas Gleixner
off-by: Arnd Bergmann Reviewed-by: Thomas Gleixner ___ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc

Re: [PATCH tty v1 00/74] serial: wrappers for uart port lock

2023-09-15 Thread Thomas Gleixner
On Thu, Sep 14 2023 at 20:01, Maciej W. Rozycki wrote: > On Thu, 14 Sep 2023, John Ogness wrote: > >> Patches 2-74 switch all uart port locking call sites to use the new >> wrappers. These patches were automatically generated using coccinelle. > > Hmm, no need to do this for drivers/tty/serial/zs

Re: [patch V3 10/37] ARM: highmem: Switch to generic kmap atomic

2020-11-12 Thread Thomas Gleixner
Marek, On Thu, Nov 12 2020 at 09:10, Marek Szyprowski wrote: > On 03.11.2020 10:27, Thomas Gleixner wrote: > > I can do more tests to help fixing this issue. Just let me know what to do. Just sent out the fix before I saw your report. https://lore.kernel.org/r/8

Re: [patch V3 22/37] highmem: High implementation details and document API

2020-11-03 Thread Thomas Gleixner
On Tue, Nov 03 2020 at 09:48, Linus Torvalds wrote: > I have no complaints about the patch, but it strikes me that if people > want to actually have much better debug coverage, this is where it > should be (I like the "every other address" thing too, don't get me > wrong). > > In particular, instea

[patch V4 24/37] sched: highmem: Store local kmaps in task struct

2020-11-03 Thread Thomas Gleixner
. Going back to user space with an active kmap local is a nono. Signed-off-by: Thomas Gleixner --- V4: Use the version which actually compiles and works V3: Handle the debug case correctly --- include/linux/highmem-internal.h | 10 +++ include/linux/sched.h|9 +++ kernel/entry

Re: [patch V3 24/37] sched: highmem: Store local kmaps in task struct

2020-11-03 Thread Thomas Gleixner
On Tue, Nov 03 2020 at 10:27, Thomas Gleixner wrote: > +struct kmap_ctrl { > +#ifdef CONFIG_KMAP_LOCAL > + int idx; > + pte_t pteval[KM_TYPE_NR]; I'm a moron. Fixed it on

[patch V3 04/37] sh/highmem: Remove all traces of unused cruft

2020-11-03 Thread Thomas Gleixner
For whatever reasons SH has highmem bits all over the place but does not enable it via Kconfig. Remove the bitrot. Signed-off-by: Thomas Gleixner --- arch/sh/include/asm/fixmap.h |8 arch/sh/include/asm/kmap_types.h | 15 --- arch/sh/mm/init.c

[patch V3 03/37] fs: Remove asm/kmap_types.h includes

2020-11-03 Thread Thomas Gleixner
Historical leftovers from the time where kmap() had fixed slots. Signed-off-by: Thomas Gleixner Cc: Alexander Viro Cc: Benjamin LaHaise Cc: linux-fsde...@vger.kernel.org Cc: linux-...@kvack.org Cc: Chris Mason Cc: Josef Bacik Cc: David Sterba Cc: linux-bt...@vger.kernel.org --- fs/aio.c

[patch V3 35/37] drm/nouveau/device: Replace io_mapping_map_atomic_wc()

2020-11-03 Thread Thomas Gleixner
Neither fbmem_peek() nor fbmem_poke() require to disable pagefaults and preemption as a side effect of io_mapping_map_atomic_wc(). Use io_mapping_map_local_wc() instead. Signed-off-by: Thomas Gleixner Cc: Ben Skeggs Cc: David Airlie Cc: Daniel Vetter Cc: dri-de...@lists.freedesktop.org Cc

[patch V3 00/37] mm/highmem: Preemptible variant of kmap_atomic & friends

2020-11-03 Thread Thomas Gleixner
Following up to the discussion in: https://lore.kernel.org/r/20200914204209.256266...@linutronix.de and the second version of this: https://lore.kernel.org/r/20201029221806.189523...@linutronix.de this series provides a preemptible variant of kmap_atomic & related interfaces. This is achie

[patch V3 08/37] x86/mm/highmem: Use generic kmap atomic implementation

2020-11-03 Thread Thomas Gleixner
Convert X86 to the generic kmap atomic implementation and make the iomap_atomic() naming convention consistent while at it. Signed-off-by: Thomas Gleixner Cc: x...@kernel.org --- V3: Remove the kmap_types cruft --- arch/x86/Kconfig |3 + arch/x86/include/asm/fixmap.h

[patch V3 16/37] sparc/mm/highmem: Switch to generic kmap atomic

2020-11-03 Thread Thomas Gleixner
No reason having the same code in every architecture Signed-off-by: Thomas Gleixner Cc: "David S. Miller" Cc: sparcli...@vger.kernel.org --- V3: Remove the kmap types cruft --- arch/sparc/Kconfig |1 arch/sparc/include/asm/highmem.h|8 +- arch/sparc/i

[patch V3 12/37] microblaze/mm/highmem: Switch to generic kmap atomic

2020-11-03 Thread Thomas Gleixner
No reason having the same code in every architecture. Signed-off-by: Thomas Gleixner Cc: Michal Simek --- V3: Remove the kmap types cruft --- arch/microblaze/Kconfig |1 arch/microblaze/include/asm/fixmap.h |4 - arch/microblaze/include/asm/highmem.h |6 ++ arch

[patch V3 10/37] ARM: highmem: Switch to generic kmap atomic

2020-11-03 Thread Thomas Gleixner
No reason having the same code in every architecture. Signed-off-by: Thomas Gleixner Cc: Russell King Cc: Arnd Bergmann Cc: linux-arm-ker...@lists.infradead.org --- V3: Remove the kmap types cruft --- arch/arm/Kconfig |1 arch/arm/include/asm/fixmap.h |4 - arch

[patch V3 06/37] highmem: Provide generic variant of kmap_atomic*

2020-11-03 Thread Thomas Gleixner
The 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. Signed-off-by: Thomas Gleixner Cc: Andrew Morton Cc: linux...@kvack.org --- V3: Do not reuse the

[patch V3 17/37] xtensa/mm/highmem: Switch to generic kmap atomic

2020-11-03 Thread Thomas Gleixner
No reason having the same code in every architecture Signed-off-by: Thomas Gleixner Cc: Chris Zankel Cc: Max Filippov Cc: linux-xte...@linux-xtensa.org --- V3: Remove the kmap types cruft --- arch/xtensa/Kconfig |1 arch/xtensa/include/asm/fixmap.h |4 +-- arch/xtensa

[patch V3 13/37] mips/mm/highmem: Switch to generic kmap atomic

2020-11-03 Thread Thomas Gleixner
No reason having the same code in every architecture Signed-off-by: Thomas Gleixner Cc: Thomas Bogendoerfer Cc: linux-m...@vger.kernel.org --- V3: Remove the kmap types cruft --- arch/mips/Kconfig |1 arch/mips/include/asm/fixmap.h |4 - arch/mips/include/asm

[patch V3 20/37] io-mapping: Cleanup atomic iomap

2020-11-03 Thread Thomas Gleixner
Switch the atomic iomap implementation over to kmap_local and stick the preempt/pagefault mechanics into the generic code similar to the kmap_atomic variants. Rename the x86 map function in preparation for a non-atomic variant. Signed-off-by: Thomas Gleixner --- V2: New patch to make review

[patch V3 37/37] io-mapping: Remove io_mapping_map_atomic_wc()

2020-11-03 Thread Thomas Gleixner
No more users. Get rid of it and remove the traces in documentation. Signed-off-by: Thomas Gleixner --- V3: New patch --- Documentation/driver-api/io-mapping.rst | 22 +--- include/linux/io-mapping.h | 42 +--- 2 files changed, 9

[patch V3 11/37] csky/mm/highmem: Switch to generic kmap atomic

2020-11-03 Thread Thomas Gleixner
No reason having the same code in every architecture. Signed-off-by: Thomas Gleixner Cc: linux-c...@vger.kernel.org --- V3: Does not compile with gcc 10 --- arch/csky/Kconfig |1 arch/csky/include/asm/fixmap.h |4 +- arch/csky/include/asm/highmem.h |6 ++- arch/csky

[patch V3 21/37] Documentation/io-mapping: Remove outdated blurb

2020-11-03 Thread Thomas Gleixner
The implementation details in the documentation are outdated and not really helpful. Remove them. Signed-off-by: Thomas Gleixner --- V3: New patch --- Documentation/driver-api/io-mapping.rst | 22 -- 1 file changed, 22 deletions(-) --- a/Documentation/driver-api/io

[patch V3 14/37] nds32/mm/highmem: Switch to generic kmap atomic

2020-11-03 Thread Thomas Gleixner
The mapping code is odd and looks broken. See FIXME in the comment. Also fix the harmless off by one in the FIX_KMAP_END define. Signed-off-by: Thomas Gleixner Cc: Nick Hu Cc: Greentime Hu Cc: Vincent Chen --- V3: Remove the kmap types cruft --- arch/nds32/Kconfig.cpu |1

[patch V3 25/37] mm/highmem: Provide kmap_local*

2020-11-03 Thread Thomas Gleixner
ly on the preemption disable for serialization or on the implicit pagefault disable. Needs to be done on a case by case basis. Signed-off-by: Thomas Gleixner --- V3: Move migrate disable into the actual highmem mapping code so it only affects real highmem mappings. V2: Make it more consisten

[patch V3 09/37] arc/mm/highmem: Use generic kmap atomic implementation

2020-11-03 Thread Thomas Gleixner
ot fit. Randomly failing at runtime is not a really good option. Signed-off-by: Thomas Gleixner Cc: Vineet Gupta Cc: linux-snps-arc@lists.infradead.org --- V3: Make it actually more correct. --- arch/arc/Kconfig |1 arch/arc/include/asm/highmem.h| 26 ++

[patch V3 19/37] mm/highmem: Remove the old kmap_atomic cruft

2020-11-03 Thread Thomas Gleixner
All users gone. Signed-off-by: Thomas Gleixner --- include/linux/highmem.h | 63 +++- mm/highmem.c|7 - 2 files changed, 5 insertions(+), 65 deletions(-) --- a/include/linux/highmem.h +++ b/include/linux/highmem.h @@ -86,31

[patch V3 28/37] mips/crashdump: Simplify copy_oldmem_page()

2020-11-03 Thread Thomas Gleixner
Replace kmap_atomic_pfn() with kmap_local_pfn() which is preemptible and can take page faults. Remove the indirection of the dump page and the related cruft which is not longer required. Signed-off-by: Thomas Gleixner Cc: Thomas Bogendoerfer Cc: linux-m...@vger.kernel.org --- V3: New patch

[patch V3 27/37] x86/crashdump/32: Simplify copy_oldmem_page()

2020-11-03 Thread Thomas Gleixner
Replace kmap_atomic_pfn() with kmap_local_pfn() which is preemptible and can take page faults. Remove the indirection of the dump page and the related cruft which is not longer required. Signed-off-by: Thomas Gleixner --- V3: New patch --- arch/x86/kernel/crash_dump_32.c | 48

[patch V3 22/37] highmem: High implementation details and document API

2020-11-03 Thread Thomas Gleixner
Move the gory details of kmap & al into a private header and only document the interfaces which are usable by drivers. Signed-off-by: Thomas Gleixner --- V3: New patch --- include/linux/highmem-internal.h | 174 + include/linux/highmem.h |

[patch V3 32/37] drm/vmgfx: Replace kmap_atomic()

2020-11-03 Thread Thomas Gleixner
pages and the return was bogus anyway as it would have left preemption and pagefaults disabled. Signed-off-by: Thomas Gleixner Cc: VMware Graphics Cc: Roland Scheidegger Cc: David Airlie Cc: Daniel Vetter Cc: dri-de...@lists.freedesktop.org --- V3: New patch --- drivers/gpu/drm/vmwgfx

[patch V3 36/37] drm/i915: Replace io_mapping_map_atomic_wc()

2020-11-03 Thread Thomas Gleixner
None of these mapping requires the side effect of disabling pagefaults and preemption. Use io_mapping_map_local_wc() instead, and clean up gtt_user_read() and gtt_user_write() to use a plain copy_from_user() as the local maps are not disabling pagefaults. Signed-off-by: Thomas Gleixner Cc: Jani

[patch V3 31/37] drm/ttm: Replace kmap_atomic() usage

2020-11-03 Thread Thomas Gleixner
pages and the return was bogus anyway as it would have left preemption and pagefaults disabled. Signed-off-by: Thomas Gleixner Cc: Christian Koenig Cc: Huang Rui Cc: David Airlie Cc: Daniel Vetter Cc: dri-de...@lists.freedesktop.org --- V3: New patch --- drivers/gpu/drm/ttm/ttm_bo_util.c

[patch V3 30/37] highmem: Remove kmap_atomic_pfn()

2020-11-03 Thread Thomas Gleixner
No more users. Signed-off-by: Thomas Gleixner --- V3: New patch --- include/linux/highmem-internal.h | 12 1 file changed, 12 deletions(-) --- a/include/linux/highmem-internal.h +++ b/include/linux/highmem-internal.h @@ -99,13 +99,6 @@ static inline void *kmap_atomic(struct p

[patch V3 34/37] drm/qxl: Replace io_mapping_map_atomic_wc()

2020-11-03 Thread Thomas Gleixner
-off-by: Thomas Gleixner Cc: Dave Airlie Cc: Gerd Hoffmann Cc: David Airlie Cc: Daniel Vetter Cc: virtualizat...@lists.linux-foundation.org Cc: spice-de...@lists.freedesktop.org --- V3: New patch --- drivers/gpu/drm/qxl/qxl_image.c | 18 +- drivers/gpu/drm/qxl/qxl_ioctl.c

[patch V3 18/37] highmem: Get rid of kmap_types.h

2020-11-03 Thread Thomas Gleixner
The header is not longer used and on alpha, ia64, openrisc, parisc and um it was completely unused anyway as these architectures have no highmem support. Signed-off-by: Thomas Gleixner --- V3: New patch --- arch/alpha/include/asm/kmap_types.h | 15 --- arch/ia64/include/asm

[patch V3 33/37] highmem: Remove kmap_atomic_prot()

2020-11-03 Thread Thomas Gleixner
No more users. Signed-off-by: Thomas Gleixner --- V3: New patch --- include/linux/highmem-internal.h | 14 ++ 1 file changed, 2 insertions(+), 12 deletions(-) --- a/include/linux/highmem-internal.h +++ b/include/linux/highmem-internal.h @@ -87,16 +87,11 @@ static inline void

[patch V3 23/37] sched: Make migrate_disable/enable() independent of RT

2020-11-03 Thread Thomas Gleixner
. Making it available independent of RT allows to provide a preemptible variant of kmap_atomic() and makes the code more consistent in general. FIXME: Rework the comment in preempt.h Signed-off-by: Thomas Gleixner Cc: Peter Zijlstra Cc: Ingo Molnar Cc: Juri Lelli Cc: Vincent Guittot Cc: Dietmar

[patch V3 24/37] sched: highmem: Store local kmaps in task struct

2020-11-03 Thread Thomas Gleixner
. Going back to user space with an active kmap local is a nono. Signed-off-by: Thomas Gleixner --- V3: Handle the debug case correctly --- include/linux/highmem-internal.h | 10 +++ include/linux/sched.h|9 +++ kernel/entry/common.c|2 kernel/fork.c

[patch V3 29/37] ARM: mm: Replace kmap_atomic_pfn()

2020-11-03 Thread Thomas Gleixner
There is no requirement to disable pagefaults and preemption for these cache management mappings. Replace kmap_atomic_pfn() with kmap_local_pfn(). This allows to remove kmap_atomic_pfn() in the next step. Signed-off-by: Thomas Gleixner Cc: Russell King Cc: linux-arm-ker...@lists.infradead.org

[patch V3 07/37] highmem: Make DEBUG_HIGHMEM functional

2020-11-03 Thread Thomas Gleixner
ion to the generic kmap_local* implementation. Signed-off-by: Thomas Gleixner --- V3: New patch --- mm/highmem.c | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) --- a/mm/highmem.c +++ b/mm/highmem.c @@ -374,9 +374,19 @@ EXPORT_SYMBOL(kunmap_high); static DEFINE_P

[patch V3 26/37] io-mapping: Provide iomap_local variant

2020-11-03 Thread Thomas Gleixner
Similar to kmap local provide a iomap local variant which only disables migration, but neither disables pagefaults nor preemption. Signed-off-by: Thomas Gleixner --- V3: Restrict migrate disable to the 32bit mapping case and update documentation. V2: Split out from the large combo patch and add

[patch V3 15/37] powerpc/mm/highmem: Switch to generic kmap atomic

2020-11-03 Thread Thomas Gleixner
No reason having the same code in every architecture Signed-off-by: Thomas Gleixner Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: linuxppc-...@lists.ozlabs.org --- V3: Remove the kmap types cruft --- arch/powerpc/Kconfig |1 arch/powerpc/include

[patch V3 01/37] mm/highmem: Un-EXPORT __kmap_atomic_idx()

2020-11-03 Thread Thomas Gleixner
Nothing in modules can use that. Signed-off-by: Thomas Gleixner Reviewed-by: Christoph Hellwig Cc: Andrew Morton Cc: linux...@kvack.org --- mm/highmem.c |2 -- 1 file changed, 2 deletions(-) --- a/mm/highmem.c +++ b/mm/highmem.c @@ -108,8 +108,6 @@ static inline wait_queue_head_t

[patch V3 02/37] highmem: Remove unused functions

2020-11-03 Thread Thomas Gleixner
Nothing uses totalhigh_pages_dec() and totalhigh_pages_set(). Signed-off-by: Thomas Gleixner --- V3: New patch --- include/linux/highmem.h | 10 -- 1 file changed, 10 deletions(-) --- a/include/linux/highmem.h +++ b/include/linux/highmem.h @@ -104,21 +104,11 @@ static inline void

[patch V3 05/37] asm-generic: Provide kmap_size.h

2020-11-03 Thread Thomas Gleixner
nesting for the upcoming reemptible version would be: 2 maps in task context and a fault inside 2 maps in the fault handler 3 maps in softirq 2 maps in interrupt So a total of 16 is sufficient and probably overestimated. Signed-off-by: Thomas Gleixner --- V3: New patch

Re: [patch V2 00/18] mm/highmem: Preemptible variant of kmap_atomic & friends

2020-11-01 Thread Thomas Gleixner
On Thu, Oct 29 2020 at 23:18, Thomas Gleixner wrote: > > There is also a still to be investigated question from Linus on the initial > posting versus the per cpu / per task mapping stack depth which might need > to be made larger due to the ability to take page faults within a mapping

Re: [patch V2 00/18] mm/highmem: Preemptible variant of kmap_atomic & friends

2020-10-30 Thread Thomas Gleixner
On Sat, Oct 31 2020 at 00:26, Thomas Gleixner wrote: > On Fri, Oct 30 2020 at 15:46, Linus Torvalds wrote: >> On Fri, Oct 30, 2020 at 3:26 PM Thomas Gleixner wrote: >> To me, your patch series has two big advantages: >> >> - more common code >> >>

Re: [patch V2 00/18] mm/highmem: Preemptible variant of kmap_atomic & friends

2020-10-30 Thread Thomas Gleixner
On Fri, Oct 30 2020 at 15:46, Linus Torvalds wrote: > On Fri, Oct 30, 2020 at 3:26 PM Thomas Gleixner wrote: > To me, your patch series has two big advantages: > > - more common code > > - kmap_local() becomes more of a no-op > > and the last thing we want is to expa

Re: [patch V2 00/18] mm/highmem: Preemptible variant of kmap_atomic & friends

2020-10-30 Thread Thomas Gleixner
On Fri, Oct 30 2020 at 13:28, Linus Torvalds wrote: > On Fri, Oct 30, 2020 at 2:39 AM Thomas Gleixner wrote: >> >> But then we really should not name it kmap_local. 'local' suggests >> locality, think local_irq*, local_bh* ... kmap_task would be more >> accu

Re: [patch V2 00/18] mm/highmem: Preemptible variant of kmap_atomic & friends

2020-10-30 Thread Thomas Gleixner
On Fri, Oct 30 2020 at 13:06, Matthew Wilcox wrote: > On Thu, Oct 29, 2020 at 11:18:06PM +0100, Thomas Gleixner wrote: >> This series provides kmap_local.* iomap_local variants which only disable >> migration to keep the virtual mapping address stable accross preemption, >> b

Re: [patch V2 00/18] mm/highmem: Preemptible variant of kmap_atomic & friends

2020-10-30 Thread Thomas Gleixner
On Fri, Oct 30 2020 at 00:41, Thomas Gleixner wrote: > On Thu, Oct 29 2020 at 16:11, Linus Torvalds wrote: > No, you're not misreading it, but doing it conditionally would be a > complete semantical disaster. kmap_atomic*() also disables preemption > and pagefaults uncondi

Re: [patch V2 00/18] mm/highmem: Preemptible variant of kmap_atomic & friends

2020-10-30 Thread Thomas Gleixner
On Fri, Oct 30 2020 at 08:25, Christoph Hellwig wrote: > On Thu, Oct 29, 2020 at 11:18:06PM +0100, Thomas Gleixner wrote: >> - Consolidating all kmap atomic implementations in generic code > > I think the consolidation is a winner no matter where we go next. Maybe > split it ou

Re: [patch V2 00/18] mm/highmem: Preemptible variant of kmap_atomic & friends

2020-10-29 Thread Thomas Gleixner
On Thu, Oct 29 2020 at 16:11, Linus Torvalds wrote: > On Thu, Oct 29, 2020 at 3:32 PM Thomas Gleixner wrote: >> >> Though I wanted to share the current state of affairs before investigating >> that further. If there is consensus in going forward with this, I'll have

[patch V2 12/18] sparc/mm/highmem: Switch to generic kmap atomic

2020-10-29 Thread Thomas Gleixner
No reason having the same code in every architecture Signed-off-by: Thomas Gleixner Cc: "David S. Miller" Cc: sparcli...@vger.kernel.org --- arch/sparc/Kconfig |1 arch/sparc/include/asm/highmem.h |7 +- arch/sparc/mm/Makefile |3 - arch/sparc/mm

[patch V2 13/18] xtensa/mm/highmem: Switch to generic kmap atomic

2020-10-29 Thread Thomas Gleixner
No reason having the same code in every architecture Signed-off-by: Thomas Gleixner Cc: Chris Zankel Cc: Max Filippov Cc: linux-xte...@linux-xtensa.org --- arch/xtensa/Kconfig |1 arch/xtensa/include/asm/highmem.h |9 +++ arch/xtensa/mm/highmem.c | 44

[patch V2 15/18] io-mapping: Cleanup atomic iomap

2020-10-29 Thread Thomas Gleixner
Switch the atomic iomap implementation over to kmap_local and stick the preempt/pagefault mechanics into the generic code similar to the kmap_atomic variants. Rename the x86 map function in preparation for a non-atomic variant. Signed-off-by: Thomas Gleixner --- V2: New patch to make review

[patch V2 17/18] mm/highmem: Provide kmap_local*

2020-10-29 Thread Thomas Gleixner
ly on the preemption disable for serialization or on the implicit pagefault disable. Needs to be done on a case by case basis. Signed-off-by: Thomas Gleixner --- V2: Make it more consistent and add commentry --- include/linux/highmem.h | 115 +--- 1

[patch V2 11/18] powerpc/mm/highmem: Switch to generic kmap atomic

2020-10-29 Thread Thomas Gleixner
No reason having the same code in every architecture Signed-off-by: Thomas Gleixner Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: linuxppc-...@lists.ozlabs.org --- arch/powerpc/Kconfig |1 arch/powerpc/include/asm/highmem.h |6 ++- arch/powerpc

[patch V2 18/18] io-mapping: Provide iomap_local variant

2020-10-29 Thread Thomas Gleixner
Similar to kmap local provide a iomap local variant which only disables migration, but neither disables pagefaults nor preemption. Signed-off-by: Thomas Gleixner --- V2: Split out from the large combo patch and add the !IOMAP_ATOMIC variants --- include/linux/io-mapping.h | 34

[patch V2 14/18] mm/highmem: Remove the old kmap_atomic cruft

2020-10-29 Thread Thomas Gleixner
All users gone. Signed-off-by: Thomas Gleixner --- include/linux/highmem.h | 61 ++-- mm/highmem.c| 28 ++ 2 files changed, 27 insertions(+), 62 deletions(-) --- a/include/linux/highmem.h +++ b/include/linux

[patch V2 09/18] mips/mm/highmem: Switch to generic kmap atomic

2020-10-29 Thread Thomas Gleixner
No reason having the same code in every architecture Signed-off-by: Thomas Gleixner Cc: Thomas Bogendoerfer Cc: linux-m...@vger.kernel.org diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index 8f328298f8cc..ed6b3de944a8 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -2654,6

[patch V2 16/18] sched: highmem: Store local kmaps in task struct

2020-10-29 Thread Thomas Gleixner
. Going back to user space with an active kmap local is a nono. Signed-off-by: Thomas Gleixner --- include/linux/highmem.h | 10 + include/linux/sched.h |9 kernel/entry/common.c |2 + kernel/fork.c |1 kernel/sched/core.c | 18 + mm/highmem.c

[patch V2 06/18] ARM: highmem: Switch to generic kmap atomic

2020-10-29 Thread Thomas Gleixner
No reason having the same code in every architecture. Signed-off-by: Thomas Gleixner Cc: Russell King Cc: Arnd Bergmann Cc: linux-arm-ker...@lists.infradead.org diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index e00d94b16658..410235e350cc 100644 --- a/arch/arm/Kconfig +++ b/arch/arm

[patch V2 07/18] csky/mm/highmem: Switch to generic kmap atomic

2020-10-29 Thread Thomas Gleixner
No reason having the same code in every architecture. Signed-off-by: Thomas Gleixner Acked-by: Guo Ren Cc: linux-c...@vger.kernel.org --- arch/csky/Kconfig |1 arch/csky/include/asm/highmem.h |4 +- arch/csky/mm/highmem.c | 75

[patch V2 10/18] nds32/mm/highmem: Switch to generic kmap atomic

2020-10-29 Thread Thomas Gleixner
The mapping code is odd and looks broken. See FIXME in the comment. Signed-off-by: Thomas Gleixner Cc: Nick Hu Cc: Greentime Hu Cc: Vincent Chen diff --git a/arch/nds32/Kconfig.cpu b/arch/nds32/Kconfig.cpu index f88a12fdf0f3..c7add11ea36e 100644 --- a/arch/nds32/Kconfig.cpu +++ b/arch/nds32

[patch V2 08/18] microblaze/mm/highmem: Switch to generic kmap atomic

2020-10-29 Thread Thomas Gleixner
No reason having the same code in every architecture. Signed-off-by: Thomas Gleixner Cc: Michal Simek diff --git a/arch/microblaze/Kconfig b/arch/microblaze/Kconfig index d262ac0c8714..186a0526564c 100644 --- a/arch/microblaze/Kconfig +++ b/arch/microblaze/Kconfig @@ -170,6 +170,7 @@ config

[patch V2 04/18] x86/mm/highmem: Use generic kmap atomic implementation

2020-10-29 Thread Thomas Gleixner
Convert X86 to the generic kmap atomic implementation and make the iomap_atomic() naming convention consistent while at it. Signed-off-by: Thomas Gleixner Cc: x...@kernel.org --- arch/x86/Kconfig |3 +- arch/x86/include/asm/fixmap.h |1 arch/x86/include/asm/highmem.h

[patch V2 05/18] arc/mm/highmem: Use generic kmap atomic implementation

2020-10-29 Thread Thomas Gleixner
Adopt the map ordering to match the other architectures and the generic code. Signed-off-by: Thomas Gleixner Cc: Vineet Gupta Cc: linux-snps-arc@lists.infradead.org --- arch/arc/Kconfig |1 arch/arc/include/asm/highmem.h |8 ++- arch/arc/mm/highmem.c | 44

[patch V2 03/18] highmem: Provide generic variant of kmap_atomic*

2020-10-29 Thread Thomas Gleixner
The 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. Signed-off-by: Thomas Gleixner Cc: Andrew Morton Cc: linux...@kvack.org --- V2: Address review comments from

[patch V2 02/18] mm/highmem: Un-EXPORT __kmap_atomic_idx()

2020-10-29 Thread Thomas Gleixner
Nothing in modules can use that. Signed-off-by: Thomas Gleixner Reviewed-by: Christoph Hellwig Cc: Andrew Morton Cc: linux...@kvack.org --- mm/highmem.c |2 -- 1 file changed, 2 deletions(-) --- a/mm/highmem.c +++ b/mm/highmem.c @@ -108,8 +108,6 @@ static inline wait_queue_head_t

[patch V2 01/18] sched: Make migrate_disable/enable() independent of RT

2020-10-29 Thread Thomas Gleixner
. Making it available independent of RT allows to provide a preemptible variant of kmap_atomic() and makes the code more consistent in general. FIXME: Rework the comment in preempt.h Signed-off-by: Thomas Gleixner Cc: Peter Zijlstra Cc: Ingo Molnar Cc: Juri Lelli Cc: Vincent Guittot Cc: Dietmar

[patch V2 00/18] mm/highmem: Preemptible variant of kmap_atomic & friends

2020-10-29 Thread Thomas Gleixner
Following up to the discussion in: https://lore.kernel.org/r/20200914204209.256266...@linutronix.de and the initial version of this: https://lore.kernel.org/r/20200919091751.06...@linutronix.de this series provides a preemptible variant of kmap_atomic & related interfaces. Now that the

Re: [patch RFC 00/15] mm/highmem: Provide a preemptible variant of kmap_atomic & friends

2020-09-24 Thread Thomas Gleixner
On Thu, Sep 24 2020 at 08:32, Steven Rostedt wrote: > On Thu, 24 Sep 2020 08:57:52 +0200 > Thomas Gleixner wrote: > >> > Now as for migration disabled nesting, at least now we would have >> > groupings of this, and perhaps the theorists can handle that. I mean, >

Re: [patch RFC 00/15] mm/highmem: Provide a preemptible variant of kmap_atomic & friends

2020-09-23 Thread Thomas Gleixner
On Wed, Sep 23 2020 at 17:12, Steven Rostedt wrote: > On Wed, 23 Sep 2020 22:55:54 +0200 > 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. That's still going to end u

Re: [patch RFC 00/15] mm/highmem: Provide a preemptible variant of kmap_atomic & friends

2020-09-23 Thread Thomas Gleixner
On Wed, Sep 23 2020 at 11:52, Steven Rostedt wrote: > On Wed, 23 Sep 2020 10:40:32 +0200 > pet...@infradead.org wrote: > >> 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

Re: [patch RFC 00/15] mm/highmem: Provide a preemptible variant of kmap_atomic & friends

2020-09-23 Thread Thomas Gleixner
On Mon, Sep 21 2020 at 21:27, Thomas Gleixner wrote: > On Mon, Sep 21 2020 at 09:24, Linus Torvalds wrote: >> On Mon, Sep 21, 2020 at 12:39 AM Thomas Gleixner wrote: >> Maybe we really *could* call this new kmap functionality something >> like "kmap_percpu()" (

Re: [patch RFC 00/15] mm/highmem: Provide a preemptible variant of kmap_atomic & friends

2020-09-23 Thread Thomas Gleixner
On Wed, Sep 23 2020 at 10:40, peterz wrote: > 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. It's even more ironic that the approach of PREEMPT_RT has been 'pragmatic ignorance of theory'

Re: [patch RFC 00/15] mm/highmem: Provide a preemptible variant of kmap_atomic & friends

2020-09-23 Thread Thomas Gleixner
On Wed, Sep 23 2020 at 12:19, peterz wrote: > On Mon, Sep 21, 2020 at 09:27:57PM +0200, Thomas Gleixner wrote: >> 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 mak

Re: [patch RFC 00/15] mm/highmem: Provide a preemptible variant of kmap_atomic & friends

2020-09-21 Thread Thomas Gleixner
On Mon, Sep 21 2020 at 09:24, Linus Torvalds wrote: > On Mon, Sep 21, 2020 at 12:39 AM Thomas Gleixner wrote: >> >> If a task is migrated to a different CPU then the mapping address will >> change which will explode in colourful ways. > > Right you are. > > Mayb

Re: [patch RFC 00/15] mm/highmem: Provide a preemptible variant of kmap_atomic & friends

2020-09-21 Thread Thomas Gleixner
On Sun, Sep 20 2020 at 10:42, Linus Torvalds wrote: > On Sun, Sep 20, 2020 at 10:40 AM Thomas Gleixner wrote: >> >> I think the more obvious solution is to split the whole exercise: >> >> schedule() >> prepare_switch() >> unmap() >&g

Re: [patch RFC 00/15] mm/highmem: Provide a preemptible variant of kmap_atomic & friends

2020-09-20 Thread Thomas Gleixner
On Sun, Sep 20 2020 at 09:57, Linus Torvalds wrote: > On Sun, Sep 20, 2020 at 1:49 AM Thomas Gleixner 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) >{ &

Re: [patch RFC 00/15] mm/highmem: Provide a preemptible variant of kmap_atomic & friends

2020-09-20 Thread Thomas Gleixner
On Sun, Sep 20 2020 at 10:23, Daniel Vetter wrote: > On Sun, Sep 20, 2020 at 08:23:26AM +0200, Thomas Gleixner wrote: >> On Sat, Sep 19 2020 at 12:37, Daniel Vetter wrote: >> > On Sat, Sep 19, 2020 at 12:35 PM Daniel Vetter wrote: >> >> I think it should be the ca

Re: [patch RFC 00/15] mm/highmem: Provide a preemptible variant of kmap_atomic & friends

2020-09-20 Thread Thomas Gleixner
On Sun, Sep 20 2020 at 08:41, Thomas Gleixner wrote: > On Sat, Sep 19 2020 at 10:18, Linus Torvalds wrote: >> Maybe I've missed something. Is it because the new interface still >> does "pagefault_disable()" perhaps? >> >> But does it even need the pagef

Re: [patch RFC 00/15] mm/highmem: Provide a preemptible variant of kmap_atomic & friends

2020-09-19 Thread Thomas Gleixner
On Sat, Sep 19 2020 at 10:18, Linus Torvalds wrote: > On Sat, Sep 19, 2020 at 2:50 AM Thomas Gleixner wrote: >> >> this provides a preemptible variant of kmap_atomic & related >> interfaces. This is achieved by: > > Ack. This looks really nice, even apart from t

Re: [patch RFC 00/15] mm/highmem: Provide a preemptible variant of kmap_atomic & friends

2020-09-19 Thread Thomas Gleixner
On Sat, Sep 19 2020 at 12:37, Daniel Vetter wrote: > On Sat, Sep 19, 2020 at 12:35 PM Daniel Vetter wrote: >> 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. >

[patch RFC 13/15] mm/highmem: Remove the old kmap_atomic cruft

2020-09-19 Thread Thomas Gleixner
Signed-off-by: Thomas Gleixner --- include/linux/highmem.h | 65 ++-- mm/highmem.c| 28 +--- 2 files changed, 28 insertions(+), 65 deletions(-) --- a/include/linux/highmem.h +++ b/include/linux/highmem.h @@ -94,27 +94,6

[patch RFC 07/15] microblaze/mm/highmem: Switch to generic kmap atomic

2020-09-19 Thread Thomas Gleixner
Signed-off-by: Thomas Gleixner Cc: Michal Simek --- 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

[patch RFC 08/15] mips/mm/highmem: Switch to generic kmap atomic

2020-09-19 Thread Thomas Gleixner
Signed-off-by: Thomas Gleixner Cc: Thomas Bogendoerfer Cc: linux-m...@vger.kernel.org --- Note: Completely untested --- arch/mips/Kconfig |1 arch/mips/include/asm/highmem.h |4 +- arch/mips/mm/highmem.c | 77 arch/mips

[patch RFC 09/15] nds32/mm/highmem: Switch to generic kmap atomic

2020-09-19 Thread Thomas Gleixner
The mapping code is odd and looks broken. See FIXME in the comment. Signed-off-by: Thomas Gleixner Cc: Nick Hu Cc: Greentime Hu Cc: Vincent Chen --- Note: Completely untested --- arch/nds32/Kconfig.cpu |1 arch/nds32/include/asm/highmem.h | 21 + arch/nds32

[patch RFC 11/15] sparc/mm/highmem: Switch to generic kmap atomic

2020-09-19 Thread Thomas Gleixner
Signed-off-by: Thomas Gleixner Cc: "David S. Miller" Cc: sparcli...@vger.kernel.org --- Note: Completely untested --- arch/sparc/Kconfig |1 arch/sparc/include/asm/highmem.h |7 +- arch/sparc/mm/Makefile |3 - arch/sparc/mm/highmem.c

[patch RFC 15/15] mm/highmem: Provide kmap_temporary*

2020-09-19 Thread Thomas Gleixner
s 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. Signed-off-by: T

[patch RFC 14/15] sched: highmem: Store temporary kmaps in task struct

2020-09-19 Thread Thomas Gleixner
Instead 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. Signed-off-by: Thomas

[patch RFC 12/15] xtensa/mm/highmem: Switch to generic kmap atomic

2020-09-19 Thread Thomas Gleixner
Signed-off-by: Thomas Gleixner Cc: Chris Zankel Cc: Max Filippov Cc: linux-xte...@linux-xtensa.org --- Note: Completely untested --- arch/xtensa/Kconfig |1 arch/xtensa/include/asm/highmem.h |9 +++ arch/xtensa/mm/highmem.c | 44

[patch RFC 10/15] powerpc/mm/highmem: Switch to generic kmap atomic

2020-09-19 Thread Thomas Gleixner
Signed-off-by: Thomas Gleixner Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: linuxppc-...@lists.ozlabs.org --- Note: Completely untested --- arch/powerpc/Kconfig |1 arch/powerpc/include/asm/highmem.h |6 ++- arch/powerpc/mm/Makefile

[patch RFC 05/15] ARM: highmem: Switch to generic kmap atomic

2020-09-19 Thread Thomas Gleixner
Signed-off-by: Thomas Gleixner Cc: Russell King Cc: Arnd Bergmann Cc: linux-arm-ker...@lists.infradead.org --- Note: Completely untested --- arch/arm/Kconfig |1 arch/arm/include/asm/highmem.h | 30 +++--- arch/arm/mm/Makefile |1 arch/arm/mm/highmem.c

[patch RFC 02/15] highmem: Provide generic variant of kmap_atomic*

2020-09-19 Thread Thomas Gleixner
The 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. Signed-off-by: Thomas Gleixner --- include/linux/highmem.h | 87 --- mm

[patch RFC 06/15] csky/mm/highmem: Switch to generic kmap atomic

2020-09-19 Thread Thomas Gleixner
Signed-off-by: Thomas Gleixner Cc: Guo Ren Cc: linux-c...@vger.kernel.org --- Note: Completely untested --- arch/csky/Kconfig |1 arch/csky/include/asm/highmem.h |4 +- arch/csky/mm/highmem.c | 75 3 files changed, 5

[patch RFC 03/15] x86/mm/highmem: Use generic kmap atomic implementation

2020-09-19 Thread Thomas Gleixner
Convert X86 to the generic kmap atomic implementation. Make the iomap_atomic() naming convention consistent while at it. Signed-off-by: Thomas Gleixner --- arch/x86/Kconfig |3 +- arch/x86/include/asm/fixmap.h |1 arch/x86/include/asm/highmem.h | 12 ++-- arch/x86

  1   2   >