[PATCH 0/5] Remove duplicated kmap code

2020-04-25 Thread ira . weiny
From: Ira Weiny The kmap infrastructure has been copied almost verbatim to every architecture. This series consolidates obvious duplicated code. (k[un]map_atmoic has some additional duplication between some of the architectures but the differences were such to not warrant further changes

[PATCH 4/5] arch/kmap_atomic: Consolidate duplicate code

2020-04-25 Thread ira . weiny
From: Ira Weiny Every arch has the same check for a not HIGHMEM page. Define kmap_atomic_fast() to quickly return already mapped pages and reduce the code duplication by lifting this check to the core. Reviewed-by: Dan Williams Signed-off-by: Ira Weiny --- arch/arc/mm/highmem.c| 7

[PATCH 3/5] arch/kunmap: Remove duplicate kunmap implementations

2020-04-25 Thread ira . weiny
From: Ira Weiny All architectures do exactly the same thing for kunmap(); remove all the duplicate definitions and lift the call to the core. Reviewed-by: Dan Williams Signed-off-by: Ira Weiny --- arch/arc/include/asm/highmem.h| 9 - arch/arm/include/asm/highmem.h

[PATCH 1/5] arch/kmap: Remove BUG_ON()

2020-04-25 Thread ira . weiny
From: Ira Weiny Replace the use of BUG_ON(in_interrupt()) in the kmap() and kunmap() in favor of might_sleep(). Besides the benefits of might_sleep(), this normalizes the implementations such that they can be made generic in subsequent patches. Reviewed-by: Dan Williams Signed-off-by: Ira

[PATCH 2/5] arch/kmap: Remove redundant arch specific kmaps

2020-04-25 Thread ira . weiny
From: Ira Weiny The kmap code for all the architectures is almost 100% identical. Lift the common code to the core. Use ARCH_HAS_KMAP to indicate if an arch needs a special kmap. This also has the benefit of changing kmap() on a number of architectures to be an inline call rather than

[PATCH 5/5] arch/kunmap_atomic: Consolidate duplicate code

2020-04-25 Thread ira . weiny
From: Ira Weiny Every single architecture (including !CONFIG_HIGHMEM) calls... pagefault_enable(); preempt_enable(); ... before returning from __kunmap_atomic(). Lift this code into the kunmap_atomic() macro. Reviewed-by: Dan Williams Signed-off-by: Ira Weiny --- arch/arc

[PATCH V1 04/10] arch/kunmap: Remove duplicate kunmap implementations

2020-04-30 Thread ira . weiny
From: Ira Weiny All architectures do exactly the same thing for kunmap(); remove all the duplicate definitions and lift the call to the core. This also has the benefit of changing kmap_unmap() on a number of architectures to be an inline call rather than an actual function. Signed-off-by: Ira

[PATCH V1 10/10] drm: Remove drm specific kmap_atomic code

2020-04-30 Thread ira . weiny
From: Ira Weiny kmap_atomic_prot() is now exported by all architectures. Use this function rather than open coding a driver specific kmap_atomic. Signed-off-by: Ira Weiny --- drivers/gpu/drm/ttm/ttm_bo_util.c| 56 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_blit.c | 16

[PATCH V1 03/10] arch/kmap: Remove redundant arch specific kmaps

2020-04-30 Thread ira . weiny
From: Ira Weiny The kmap code for all the architectures is almost 100% identical. Lift the common code to the core. Use ARCH_HAS_KMAP_FLUSH_TLB to indicate if an arch defines kmap_flush_tlb() and call if if needed. This also has the benefit of changing kmap() on a number of architectures

[PATCH V1 01/10] arch/kmap: Remove BUG_ON()

2020-04-30 Thread ira . weiny
From: Ira Weiny Replace the use of BUG_ON(in_interrupt()) in the kmap() and kunmap() in favor of might_sleep(). Besides the benefits of might_sleep(), this normalizes the implementations such that they can be made generic in subsequent patches. Reviewed-by: Dan Williams Signed-off-by: Ira

[PATCH V1 00/10] Remove duplicated kmap code

2020-04-30 Thread ira . weiny
From: Ira Weiny The kmap infrastructure has been copied almost verbatim to every architecture. This series consolidates obvious duplicated code by defining core functions which call into the architectures only when needed. Some of the k[un]map_atomic() implementations have some similarities

[PATCH V1 02/10] arch/xtensa: Move kmap build bug out of the way

2020-04-30 Thread ira . weiny
From: Ira Weiny Move the kmap() build bug to kmap_init() to facilitate patches to lift kmap() to the core. Signed-off-by: Ira Weiny --- arch/xtensa/include/asm/highmem.h | 5 - arch/xtensa/mm/highmem.c | 5 + 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arch

[PATCH V1 09/10] arch/kmap: Define kmap_atomic_prot() for all arch's

2020-04-30 Thread ira . weiny
From: Ira Weiny To support kmap_atomic_prot(), all architectures need to support protections passed to their kmap_atomic_high() function. Pass protections into kmap_atomic_high() and change the name to kmap_atomic_high_prot() to match. Then define kmap_atomic_prot() as a core function which

[PATCH V1 06/10] arch/kunmap_atomic: Consolidate duplicate code

2020-04-30 Thread ira . weiny
From: Ira Weiny Every single architecture (including !CONFIG_HIGHMEM) calls... pagefault_enable(); preempt_enable(); ... before returning from __kunmap_atomic(). Lift this code into the kunmap_atomic() macro. While we are at it rename __kunmap_atomic() to kunmap_atomic_high

[PATCH V1 05/10] arch/kmap_atomic: Consolidate duplicate code

2020-04-30 Thread ira . weiny
From: Ira Weiny Every arch has the same code to ensure atomic operations and a check for !HIGHMEM page. Remove the duplicate code by defining a core kmap_atomic() which only calls the arch specific kmap_atomic_high() when the page is high memory. Signed-off-by: Ira Weiny --- Changes from V0

[PATCH V1 08/10] arch/kmap: Don't hard code kmap_prot values

2020-04-30 Thread ira . weiny
From: Ira Weiny To support kmap_atomic_prot() on all architectures each arch must support protections passed in to them. Change csky, mips, nds32 and xtensa to use their global kmap_prot value rather than a hard coded value which was equal. Signed-off-by: Ira Weiny --- arch/csky/mm/highmem.c

[PATCH V1 07/10] arch/kmap: Ensure kmap_prot visibility

2020-04-30 Thread ira . weiny
From: Ira Weiny We want to support kmap_atomic_prot() on all architectures and it makes sense to define kmap_atomic() to use the default kmap_prot. So we ensure all arch's have a globally available kmap_prot either as a define or exported symbol. Signed-off-by: Ira Weiny --- arch/microblaze

Re: sparc-related comment, to Re: [PATCH V1 07/10] arch/kmap: Ensure kmap_prot visibility

2020-05-01 Thread Ira Weiny
On Fri, May 01, 2020 at 01:44:46AM -0700, Christoph Hellwig wrote: > > --- a/arch/sparc/mm/highmem.c > > +++ b/arch/sparc/mm/highmem.c > > @@ -33,6 +33,7 @@ > > #include > > > > pgprot_t kmap_prot; > > +EXPORT_SYMBOL(kmap_prot); > > Btw, I don't see why sparc needs this as a variable, as

Re: [PATCH V1 09/10] arch/kmap: Define kmap_atomic_prot() for all arch's

2020-05-02 Thread Ira Weiny
On Fri, May 01, 2020 at 04:20:20AM +0100, Al Viro wrote: > On Fri, May 01, 2020 at 03:37:34AM +0100, Al Viro wrote: > > On Thu, Apr 30, 2020 at 01:38:44PM -0700, ira.we...@intel.com wrote: > > > > > -static inline void *kmap_atomic(struct page *page) > > > +static inline void

[PATCH V2 06/11] arch/kmap_atomic: Consolidate duplicate code

2020-05-03 Thread ira . weiny
From: Ira Weiny Every arch has the same code to ensure atomic operations and a check for !HIGHMEM page. Remove the duplicate code by defining a core kmap_atomic() which only calls the arch specific kmap_atomic_high() when the page is high memory. Signed-off-by: Ira Weiny --- Changes from V1

[PATCH V2 03/11] arch/kmap: Remove redundant arch specific kmaps

2020-05-03 Thread ira . weiny
From: Ira Weiny The kmap code for all the architectures is almost 100% identical. Lift the common code to the core. Use ARCH_HAS_KMAP_FLUSH_TLB to indicate if an arch defines kmap_flush_tlb() and call if if needed. This also has the benefit of changing kmap() on a number of architectures

[PATCH V2 00/11] Subject: Remove duplicated kmap code

2020-05-03 Thread ira . weiny
From: Ira Weiny The kmap infrastructure has been copied almost verbatim to every architecture. This series consolidates obvious duplicated code by defining core functions which call into the architectures only when needed. Some of the k[un]map_atomic() implementations have some similarities

[PATCH V2 02/11] arch/xtensa: Move kmap build bug out of the way

2020-05-03 Thread ira . weiny
From: Ira Weiny Move the kmap() build bug to kmap_init() to facilitate patches to lift kmap() to the core. Reviewed-by: Christoph Hellwig Signed-off-by: Ira Weiny --- Changes from V1: combine code onto 1 line. --- arch/xtensa/include/asm/highmem.h | 5 - arch/xtensa/mm/highmem.c

[PATCH V2 01/11] arch/kmap: Remove BUG_ON()

2020-05-03 Thread ira . weiny
From: Ira Weiny Replace the use of BUG_ON(in_interrupt()) in the kmap() and kunmap() in favor of might_sleep(). Besides the benefits of might_sleep(), this normalizes the implementations such that they can be made generic in subsequent patches. Reviewed-by: Dan Williams Reviewed-by: Christoph

[PATCH V2 04/11] arch/kunmap: Remove duplicate kunmap implementations

2020-05-03 Thread ira . weiny
From: Ira Weiny All architectures do exactly the same thing for kunmap(); remove all the duplicate definitions and lift the call to the core. This also has the benefit of changing kmap_unmap() on a number of architectures to be an inline call rather than an actual function. Reviewed

[PATCH V2 09/11] arch/kmap: Don't hard code kmap_prot values

2020-05-03 Thread ira . weiny
From: Ira Weiny To support kmap_atomic_prot() on all architectures each arch must support protections passed in to them. Change csky, mips, nds32 and xtensa to use their global constant kmap_prot rather than a hard coded value which was equal. Reviewed-by: Christoph Hellwig Signed-off-by: Ira

[PATCH V2 11/11] drm: Remove drm specific kmap_atomic code

2020-05-03 Thread ira . weiny
From: Ira Weiny kmap_atomic_prot() is now exported by all architectures. Use this function rather than open coding a driver specific kmap_atomic. Reviewed-by: Christian König Reviewed-by: Christoph Hellwig Signed-off-by: Ira Weiny --- drivers/gpu/drm/ttm/ttm_bo_util.c| 56

[PATCH V2 07/11] arch/kunmap_atomic: Consolidate duplicate code

2020-05-03 Thread ira . weiny
From: Ira Weiny Every single architecture (including !CONFIG_HIGHMEM) calls... pagefault_enable(); preempt_enable(); ... before returning from __kunmap_atomic(). Lift this code into the kunmap_atomic() macro. While we are at it rename __kunmap_atomic() to kunmap_atomic_high

[PATCH V2 10/11] arch/kmap: Define kmap_atomic_prot() for all arch's

2020-05-03 Thread ira . weiny
From: Ira Weiny To support kmap_atomic_prot(), all architectures need to support protections passed to their kmap_atomic_high() function. Pass protections into kmap_atomic_high() and change the name to kmap_atomic_high_prot() to match. Then define kmap_atomic_prot() as a core function which

[PATCH V2 05/11] {x86,powerpc,microblaze}/kmap: Move preempt disable

2020-05-03 Thread ira . weiny
From: Ira Weiny During this kmap() conversion series we must maintain bisect-ability. To do this, kmap_atomic_prot() in x86, powerpc, and microblaze need to remain functional. Create a temporary inline version of kmap_atomic_prot within these architectures so we can rework their kmap_atomic

[PATCH V2 08/11] arch/kmap: Ensure kmap_prot visibility

2020-05-03 Thread ira . weiny
From: Ira Weiny We want to support kmap_atomic_prot() on all architectures and it makes sense to define kmap_atomic() to use the default kmap_prot. So we ensure all arch's have a globally available kmap_prot either as a define or exported symbol. Signed-off-by: Ira Weiny --- arch/microblaze

Re: [PATCH V2 00/11] Subject: Remove duplicated kmap code

2020-05-03 Thread Ira Weiny
On Mon, May 04, 2020 at 02:35:09AM +0100, Al Viro wrote: > On Sun, May 03, 2020 at 06:09:01PM -0700, ira.we...@intel.com wrote: > > From: Ira Weiny > > > > The kmap infrastructure has been copied almost verbatim to every > > architecture. > > This series con

Re: [PATCH V2 11/11] drm: Remove drm specific kmap_atomic code

2020-05-04 Thread Ira Weiny
On Mon, May 04, 2020 at 01:18:51PM +0200, Daniel Vetter wrote: > On Mon, May 4, 2020 at 3:09 AM wrote: > > > > From: Ira Weiny > > > > kmap_atomic_prot() is now exported by all architectures. Use this > > function rather than open coding a driver speci

Re: [PATCH V2 00/11] Subject: Remove duplicated kmap code

2020-05-04 Thread Ira Weiny
On Mon, May 04, 2020 at 06:33:57AM +0100, Al Viro wrote: > On Sun, May 03, 2020 at 10:04:47PM -0700, Ira Weiny wrote: > > > Grepping for 'asm/highmem.h' and investigations don't reveal any issues... > > But > > you do have me worried. That said 0-day has been crunching

Re: [PATCH V2 00/11] Subject: Remove duplicated kmap code

2020-05-04 Thread Ira Weiny
On Mon, May 04, 2020 at 10:02:25PM +0100, Al Viro wrote: > On Mon, May 04, 2020 at 01:17:41PM -0700, Ira Weiny wrote: > > > > || * arm: much, much worse. We have several files that pull > > > linux/highmem.h: > > > || arch/arm/mm/cache-feroceon-l2.c, arch/arm

Re: [PATCH 2/5] arch/kmap: Remove redundant arch specific kmaps

2020-04-26 Thread Ira Weiny
On Sun, Apr 26, 2020 at 12:17:15AM -0700, Christoph Hellwig wrote: > On Sat, Apr 25, 2020 at 10:54:03PM -0700, ira.we...@intel.com wrote: > > From: Ira Weiny > > > > The kmap code for all the architectures is almost 100% identical. > > > > Lift the common cod

Re: [PATCH 4/5] arch/kmap_atomic: Consolidate duplicate code

2020-04-26 Thread Ira Weiny
On Sun, Apr 26, 2020 at 12:26:42AM -0700, Christoph Hellwig wrote: > > diff --git a/arch/arc/mm/highmem.c b/arch/arc/mm/highmem.c > > index 4db13a6b9f3b..1cae4b911a33 100644 > > --- a/arch/arc/mm/highmem.c > > +++ b/arch/arc/mm/highmem.c > > @@ -53,11 +53,10 @@ void *kmap_atomic(struct page *page)

Re: [PATCH V3 07/15] arch/kunmap_atomic: Consolidate duplicate code

2020-05-17 Thread Ira Weiny
On Sat, May 16, 2020 at 03:33:06PM -0700, Guenter Roeck wrote: > On Thu, May 07, 2020 at 07:59:55AM -0700, ira.we...@intel.com wrote: > > From: Ira Weiny > > > > Every single architecture (including !CONFIG_HIGHMEM) calls... > > > > pagefault

Re: [PATCH V2 08/11] arch/kmap: Ensure kmap_prot visibility

2020-05-06 Thread Ira Weiny
On Tue, May 05, 2020 at 11:13:26PM -0700, Christoph Hellwig wrote: > On Sun, May 03, 2020 at 06:09:09PM -0700, ira.we...@intel.com wrote: > > From: Ira Weiny > > > > We want to support kmap_atomic_prot() on all architectures and it makes > > sense to define kmap_

Re: [PATCH V2 05/11] {x86,powerpc,microblaze}/kmap: Move preempt disable

2020-05-06 Thread Ira Weiny
On Tue, May 05, 2020 at 11:11:13PM -0700, Christoph Hellwig wrote: > On Sun, May 03, 2020 at 06:09:06PM -0700, ira.we...@intel.com wrote: > > From: Ira Weiny > > > > During this kmap() conversion series we must maintain bisect-ability. > > To do this, kmap_at

Re: [PATCH V3 10/15] arch/kmap: Define kmap_atomic_prot() for all arch's

2020-05-18 Thread Ira Weiny
On Sun, May 17, 2020 at 10:37:22AM -0700, Guenter Roeck wrote: > Hi, > > On Thu, May 07, 2020 at 07:59:58AM -0700, ira.we...@intel.com wrote: > > From: Ira Weiny > > > > To support kmap_atomic_prot(), all architectures need to support > > protections passed to

Re: [PATCH V3 07/15] arch/kunmap_atomic: Consolidate duplicate code

2020-05-18 Thread Ira Weiny
On Sun, May 17, 2020 at 09:29:32PM -0700, Guenter Roeck wrote: > On Sun, May 17, 2020 at 08:49:39PM -0700, Ira Weiny wrote: > > On Sat, May 16, 2020 at 03:33:06PM -0700, Guenter Roeck wrote: > > > On Thu, May 07, 2020 at 07:59:55AM -0700, ira.we...@intel.com wrote: >

[PATCH] arch/{mips, sparc, microblaze, powerpc}: Don't enable pagefault/preempt twice

2020-05-18 Thread ira . weiny
From: Ira Weiny The kunmap_atomic clean up failed to remove one set of pagefault/preempt enables when vaddr is not in the fixmap. Fixes: bee2128a09e6 ("arch/kunmap_atomic: consolidate duplicate code") Signed-off-by: Ira Weiny --- arch/microblaze/mm/highmem.c | 5 + arch/mips/mm

Re: [PATCH V3 07/15] arch/kunmap_atomic: Consolidate duplicate code

2020-05-18 Thread Ira Weiny
On Sun, May 17, 2020 at 09:29:32PM -0700, Guenter Roeck wrote: > On Sun, May 17, 2020 at 08:49:39PM -0700, Ira Weiny wrote: > > On Sat, May 16, 2020 at 03:33:06PM -0700, Guenter Roeck wrote: > > > On Thu, May 07, 2020 at 07:59:55AM -0700, ira.we...@intel.com wrote: >

[PATCH V3 01/15] arch/kmap: Remove BUG_ON()

2020-05-07 Thread ira . weiny
From: Ira Weiny Replace the use of BUG_ON(in_interrupt()) in the kmap() and kunmap() in favor of might_sleep(). Besides the benefits of might_sleep(), this normalizes the implementations such that they can be made generic in subsequent patches. Reviewed-by: Dan Williams Reviewed-by: Christoph

[PATCH V3 03/15] arch/kmap: Remove redundant arch specific kmaps

2020-05-07 Thread ira . weiny
From: Ira Weiny The kmap code for all the architectures is almost 100% identical. Lift the common code to the core. Use ARCH_HAS_KMAP_FLUSH_TLB to indicate if an arch defines kmap_flush_tlb() and call if if needed. This also has the benefit of changing kmap() on a number of architectures

[PATCH V3 06/15] arch/kmap_atomic: Consolidate duplicate code

2020-05-07 Thread ira . weiny
From: Ira Weiny Every arch has the same code to ensure atomic operations and a check for !HIGHMEM page. Remove the duplicate code by defining a core kmap_atomic() which only calls the arch specific kmap_atomic_high() when the page is high memory. Reviewed-by: Christoph Hellwig Signed-off

[PATCH V3 02/15] arch/xtensa: Move kmap build bug out of the way

2020-05-07 Thread ira . weiny
From: Ira Weiny Move the kmap() build bug to kmap_init() to facilitate patches to lift kmap() to the core. Reviewed-by: Christoph Hellwig Signed-off-by: Ira Weiny --- Changes from V1: combine code onto 1 line. --- arch/xtensa/include/asm/highmem.h | 5 - arch/xtensa/mm/highmem.c

[PATCH V3 00/15] Remove duplicated kmap code

2020-05-07 Thread ira . weiny
From: Ira Weiny The kmap infrastructure has been copied almost verbatim to every architecture. This series consolidates obvious duplicated code by defining core functions which call into the architectures only when needed. Some of the k[un]map_atomic() implementations have some similarities

[PATCH V3 08/15] arch/kmap: Ensure kmap_prot visibility

2020-05-07 Thread ira . weiny
From: Ira Weiny We want to support kmap_atomic_prot() on all architectures and it makes sense to define kmap_atomic() to use the default kmap_prot. So we ensure all arch's have a globally available kmap_prot either as a define or exported symbol. Reviewed-by: Christoph Hellwig Signed-off

[PATCH V3 07/15] arch/kunmap_atomic: Consolidate duplicate code

2020-05-07 Thread ira . weiny
From: Ira Weiny Every single architecture (including !CONFIG_HIGHMEM) calls... pagefault_enable(); preempt_enable(); ... before returning from __kunmap_atomic(). Lift this code into the kunmap_atomic() macro. While we are at it rename __kunmap_atomic() to kunmap_atomic_high

[PATCH V3 13/15] parisc/kmap: Remove duplicate kmap code

2020-05-07 Thread ira . weiny
From: Ira Weiny parisc reimplements the kmap calls except to flush it's dcache. This is arguably an abuse of kmap but regardless it is messy and confusing. Remove the duplicate code and have parisc define ARCH_HAS_FLUSH_ON_KUNMAP for a kunmap_flush_on_unmap() architecture specific call

[PATCH V3 14/15] sparc: Remove unnecessary includes

2020-05-07 Thread ira . weiny
From: Ira Weiny linux/highmem.h has not been needed for the pte_offset_map => kmap_atomic use in sparc for some time (~2002) Remove this include. Suggested-by: Al Viro Signed-off-by: Ira Weiny --- Changes from V2: New Patch for this series --- arch/sparc/mm/io-unit.c | 1 - a

[PATCH V3 09/15] arch/kmap: Don't hard code kmap_prot values

2020-05-07 Thread ira . weiny
From: Ira Weiny To support kmap_atomic_prot() on all architectures each arch must support protections passed in to them. Change csky, mips, nds32 and xtensa to use their global constant kmap_prot rather than a hard coded value which was equal. Reviewed-by: Christoph Hellwig Signed-off-by: Ira

[PATCH V3 12/15] kmap: Remove kmap_atomic_to_page()

2020-05-07 Thread ira . weiny
From: Ira Weiny kmap_atomic_to_page() has no callers and is only defined on 1 arch and declared on another. Remove it. Suggested-by: Al Viro Signed-off-by: Ira Weiny --- Changes from V2: New Patch for this series --- arch/csky/include/asm/highmem.h | 1 - arch/csky/mm/highmem.c

[PATCH V3 15/15] kmap: Consolidate kmap_prot definitions

2020-05-07 Thread ira . weiny
From: Ira Weiny Most architectures define kmap_prot to be PAGE_KERNEL. Let sparc and xtensa define there own and define PAGE_KERNEL as the default if not overridden. Suggested-by: Christoph Hellwig Signed-off-by: Ira Weiny --- Changes from V2: New Patch for this series --- arch/arc

[PATCH V3 05/15] {x86,powerpc,microblaze}/kmap: Move preempt disable

2020-05-07 Thread ira . weiny
From: Ira Weiny During this kmap() conversion series we must maintain bisect-ability. To do this, kmap_atomic_prot() in x86, powerpc, and microblaze need to remain functional. Create a temporary inline version of kmap_atomic_prot within these architectures so we can rework their kmap_atomic

[PATCH V3 04/15] arch/kunmap: Remove duplicate kunmap implementations

2020-05-07 Thread ira . weiny
From: Ira Weiny All architectures do exactly the same thing for kunmap(); remove all the duplicate definitions and lift the call to the core. This also has the benefit of changing kmap_unmap() on a number of architectures to be an inline call rather than an actual function. Reviewed

[PATCH V3 10/15] arch/kmap: Define kmap_atomic_prot() for all arch's

2020-05-07 Thread ira . weiny
From: Ira Weiny To support kmap_atomic_prot(), all architectures need to support protections passed to their kmap_atomic_high() function. Pass protections into kmap_atomic_high() and change the name to kmap_atomic_high_prot() to match. Then define kmap_atomic_prot() as a core function which

[PATCH V3 11/15] drm: Remove drm specific kmap_atomic code

2020-05-07 Thread ira . weiny
From: Ira Weiny kmap_atomic_prot() is now exported by all architectures. Use this function rather than open coding a driver specific kmap_atomic. Acked-by: Daniel Vetter Reviewed-by: Christian König Reviewed-by: Christoph Hellwig Signed-off-by: Ira Weiny --- drivers/gpu/drm/ttm

Re: [PATCH V3 13/15] parisc/kmap: Remove duplicate kmap code

2020-05-07 Thread Ira Weiny
On Thu, May 07, 2020 at 01:52:58PM -0700, Andrew Morton wrote: > On Thu, 7 May 2020 08:00:01 -0700 ira.we...@intel.com wrote: > > > parisc reimplements the kmap calls except to flush it's dcache. This is > > arguably an abuse of kmap but regardless it is messy and confusing. > > > > Remove the

Re: [PATCH V3 15/15] kmap: Consolidate kmap_prot definitions

2020-05-07 Thread Ira Weiny
On Thu, May 07, 2020 at 01:53:07PM -0700, Andrew Morton wrote: > On Thu, 7 May 2020 08:00:03 -0700 ira.we...@intel.com wrote: > > > From: Ira Weiny > > > > Most architectures define kmap_prot to be PAGE_KERNEL. > > > > Let sparc and xtensa def

[PATCH V3.1] kmap: Consolidate kmap_prot definitions

2020-05-07 Thread ira . weiny
From: Ira Weiny Most architectures define kmap_prot to be PAGE_KERNEL. Let sparc and xtensa define there own and define PAGE_KERNEL as the default if not overridden. Suggested-by: Christoph Hellwig Signed-off-by: Ira Weiny --- Changes from V3: Fix semicolon in macro Changes from V2

Re: [PATCH V3 07/15] arch/kunmap_atomic: Consolidate duplicate code

2020-05-19 Thread Ira Weiny
On Mon, May 18, 2020 at 07:50:36PM -0700, Guenter Roeck wrote: > Hi Ira, > > On 5/18/20 5:03 PM, Ira Weiny wrote: > > On Sun, May 17, 2020 at 09:29:32PM -0700, Guenter Roeck wrote: > >> On Sun, May 17, 2020 at 08:49:39PM -0700, Ira Weiny wrote: > >>> On S

Re: [PATCH] arch/{mips,sparc,microblaze,powerpc}: Don't enable pagefault/preempt twice

2020-05-19 Thread Ira Weiny
On Tue, May 19, 2020 at 09:54:22AM -0700, Guenter Roeck wrote: > On Mon, May 18, 2020 at 11:48:43AM -0700, ira.we...@intel.com wrote: > > From: Ira Weiny > > > > The kunmap_atomic clean up failed to remove one set of pagefault/preempt > > enables when vaddr is not in

Re: [PATCH V1 00/10] Remove duplicated kmap code

2020-05-01 Thread Ira Weiny
On Fri, May 01, 2020 at 01:54:56AM -0700, Christoph Hellwig wrote: > In addition to the work already it the series, it seems like > LAST_PKMAP_MASK, PKMAP_ADDR and PKMAP_NR can also be consolidated > to common code. Agreed, I mentioned in the cover letter there are similarities... > > Also

Re: [PATCH] arch/{mips,sparc,microblaze,powerpc}: Don't enable pagefault/preempt twice

2020-05-21 Thread Ira Weiny
On Thu, May 21, 2020 at 09:05:41AM -0700, Guenter Roeck wrote: > On 5/19/20 10:13 PM, Ira Weiny wrote: > > On Tue, May 19, 2020 at 12:42:15PM -0700, Guenter Roeck wrote: > >> On Tue, May 19, 2020 at 11:40:32AM -0700, Ira Weiny wrote: > >>> On Tue, May 19, 2020 at 0

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

2020-09-21 Thread Ira Weiny
On Sat, Sep 19, 2020 at 06:39:06PM +0100, Matthew Wilcox wrote: > On Sat, Sep 19, 2020 at 10:18:54AM -0700, 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

Re: [PATCH] arch/{mips,sparc,microblaze,powerpc}: Don't enable pagefault/preempt twice

2020-05-19 Thread Ira Weiny
On Tue, May 19, 2020 at 12:42:15PM -0700, Guenter Roeck wrote: > On Tue, May 19, 2020 at 11:40:32AM -0700, Ira Weiny wrote: > > On Tue, May 19, 2020 at 09:54:22AM -0700, Guenter Roeck wrote: > > > On Mon, May 18, 2020 at 11:48:43AM -0700, ira.we...@intel.com wrote: >

Re: [PATCH] arch/{mips,sparc,microblaze,powerpc}: Don't enable pagefault/preempt twice

2020-05-19 Thread Ira Weiny
On Tue, May 19, 2020 at 12:42:15PM -0700, Guenter Roeck wrote: > On Tue, May 19, 2020 at 11:40:32AM -0700, Ira Weiny wrote: > > On Tue, May 19, 2020 at 09:54:22AM -0700, Guenter Roeck wrote: > > > On Mon, May 18, 2020 at 11:48:43AM -0700, ira.we...@intel.com wrote: >

Re: [PATCH] arch/{mips,sparc,microblaze,powerpc}: Don't enable pagefault/preempt twice

2020-05-21 Thread Ira Weiny
On Tue, May 19, 2020 at 12:42:15PM -0700, Guenter Roeck wrote: > > On Tue, May 19, 2020 at 09:54:22AM -0700, Guenter Roeck wrote: > > > as do the nosmp sparc32 boot tests, > > > but sparc32 boot tests with SMP enabled still fail with lots of messages > > > such as: > > > > > > BUG: Bad page state

Re: [PATCH] arch/{mips,sparc,microblaze,powerpc}: Don't enable pagefault/preempt twice

2020-06-04 Thread Ira Weiny
On Thu, Jun 04, 2020 at 12:41:33PM +0300, Mike Rapoport wrote: > On Wed, Jun 03, 2020 at 04:44:17PM -0700, Guenter Roeck wrote: > > > > sparc32 smp images in next-20200603 still crash for me with a spinlock > > recursion. s390 images hang early in boot. Several others (alpha, arm64, > > various

Re: [PATCH] arch/{mips,sparc,microblaze,powerpc}: Don't enable pagefault/preempt twice

2020-06-03 Thread Ira Weiny
On Wed, Jun 03, 2020 at 01:57:36PM -0700, Andrew Morton wrote: > On Thu, 21 May 2020 10:42:50 -0700 Ira Weiny wrote: > > > > > > > > > Actually it occurs to me that the patch consolidating kmap_prot is odd > > > > for > > > > sparc 32 bit

Re: [PATCH] arch/{mips,sparc,microblaze,powerpc}: Don't enable pagefault/preempt twice

2020-06-04 Thread Ira Weiny
On Wed, Jun 03, 2020 at 04:44:17PM -0700, Guenter Roeck wrote: > On 6/3/20 2:14 PM, Ira Weiny wrote: > > On Wed, Jun 03, 2020 at 01:57:36PM -0700, Andrew Morton wrote: > >> On Thu, 21 May 2020 10:42:50 -0700 Ira Weiny wrote: > >> ... > >> > >&

Re: [PATCH] arch/{mips,sparc,microblaze,powerpc}: Don't enable pagefault/preempt twice

2020-06-04 Thread Ira Weiny
On Thu, Jun 04, 2020 at 09:18:05AM +0300, Mike Rapoport wrote: > On Wed, Jun 03, 2020 at 04:44:17PM -0700, Guenter Roeck wrote: > > On 6/3/20 2:14 PM, Ira Weiny wrote: > > > On Wed, Jun 03, 2020 at 01:57:36PM -0700, Andrew Morton wrote: > > >> On Thu, 21 May 2020 1

Re: [PATCH] arch/{mips,sparc,microblaze,powerpc}: Don't enable pagefault/preempt twice

2020-06-04 Thread Ira Weiny
On Thu, Jun 04, 2020 at 09:37:45AM +0300, Mike Rapoport wrote: > On Wed, Jun 03, 2020 at 11:22:26PM -0700, Ira Weiny wrote: > > On Wed, Jun 03, 2020 at 04:44:17PM -0700, Guenter Roeck wrote: > > > > With linux-next on sparc I too see the spinlock issue; something like: >

Re: [PATCH v2] fs/dax: include to fix build error on ARC

2021-01-04 Thread Ira Weiny
; Reported-by: kernel test robot > Signed-off-by: Randy Dunlap Looks reasonable Reviewed-by: Ira Weiny > Cc: Vineet Gupta > Cc: linux-snps-arc@lists.infradead.org > Cc: Dan Williams > Acked-by: Vineet Gupta > Cc: Andrew Morton > Cc: Matthew Wilcox > Cc: Jan Kar

[PATCH] checkpatch: Add kmap and kmap_atomic to the deprecated list

2022-08-13 Thread ira . weiny
From: Ira Weiny kmap() and kmap_atomic() are being deprecated in favor of kmap_local_page(). There are two main problems with kmap(): (1) It comes with an overhead as mapping space is restricted and protected by a global lock for synchronization and (2) it also requires global TLB invalidation