Re: [PATCH v2 9/9] drm/i915: Use kmap_local_page() in gem/i915_gem_execbuffer.c

2023-10-18 Thread Zhao Liu
bject: Re: [PATCH v2 9/9] drm/i915: Use kmap_local_page() in > gem/i915_gem_execbuffer.c > > On Mon, Apr 17, 2023 at 12:24:45PM +0100, Tvrtko Ursulin wrote: > > > > On 14/04/2023 11:45, Zhao Liu wrote: > > > Hi Tvrtko, > > > > > > On We

[PATCH 7/9] drm/i915: Use memcpy_from_page() in gt/uc/intel_uc_fw.c

2022-10-18 Thread Zhao Liu
From: Zhao Liu The use of kmap_atomic() is being deprecated in favor of kmap_local_page()[1]. The main difference between atomic and local mappings is that local mappings doesn't disable page faults or preemption. In drm/i915/gt/uc/intel_us_fw.c, the function intel_uc_fw_copy_rsa() just use

[PATCH 8/9] drm/i915: Use kmap_local_page() in i915_cmd_parser.c

2022-10-18 Thread Zhao Liu
From: Zhao Liu The use of kmap_atomic() is being deprecated in favor of kmap_local_page()[1]. The main difference between atomic and local mappings is that local mappings doesn't disable page faults or preemption. There're 2 reasons why function copy_batch() doesn't need to disable pagefaults

[PATCH 9/9] drm/i915: Use kmap_local_page() in gem/i915_gem_execbuffer.c

2022-10-18 Thread Zhao Liu
From: Zhao Liu The use of kmap_atomic() is being deprecated in favor of kmap_local_page()[1]. The main difference between atomic and local mappings is that local mappings doesn't disable page faults or preemption. In i915_gem_execbuffer.c, eb->reloc_cache.vaddr is mapped by kmap_ato

[PATCH 6/9] drm/i915: Use kmap_local_page() in gem/selftests/i915_gem_context.c

2022-10-18 Thread Zhao Liu
From: Zhao Liu The use of kmap_atomic() is being deprecated in favor of kmap_local_page()[1]. The main difference between atomic and local mappings is that local mappings doesn't disable page faults or preemption. In drm/i915/gem/selftests/i915_gem_context.c, functions cpu_fill() and cpu_check

[PATCH 1/9] drm/i915: Use kmap_local_page() in gem/i915_gem_object.c

2022-10-18 Thread Zhao Liu
From: Zhao Liu The use of kmap_atomic() is being deprecated in favor of kmap_local_page()[1]. The main difference between atomic and local mappings is that local mappings doesn't disable page faults or preemption. There're 2 reasons why i915_gem_object_read_from_page_kmap() doesn't need

[PATCH 5/9] drm/i915: Use kmap_local_page() in gem/selftests/i915_gem_coherency.c

2022-10-18 Thread Zhao Liu
From: Zhao Liu The use of kmap_atomic() is being deprecated in favor of kmap_local_page()[1]. The main difference between atomic and local mappings is that local mappings doesn't disable page faults or preemption. In drm/i915/gem/selftests/i915_gem_coherency.c, functions cpu_set() and cpu_get

[PATCH v3] x86/hyperv: Replace kmap() with kmap_local_page()

2022-10-18 Thread Zhao Liu
From: Zhao Liu kmap() is being deprecated in favor of kmap_local_page()[1]. 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 when the kmap's

[PATCH 3/9] drm/i915: Use kmap_local_page() in gem/i915_gem_shmem.c

2022-10-18 Thread Zhao Liu
From: Zhao Liu The use of kmap_atomic() is being deprecated in favor of kmap_local_page()[1]. The main difference between atomic and local mappings is that local mappings doesn't disable page faults or preemption. In drm/i915/gem/i915_gem_shmem.c, the function shmem_pwrite() need to disable

Re: [PATCH v3] x86/hyperv: Replace kmap() with kmap_local_page()

2022-10-18 Thread Zhao Liu
Sorry, please ignore the last hyperv patch, I made a mistake. Zhao On Mon, Oct 17, 2022 at 05:37:26PM +0800, Zhao Liu wrote: > Date: Mon, 17 Oct 2022 17:37:26 +0800 > From: Zhao Liu > Subject: [PATCH v3] x86/hyperv: Replace kmap() with kmap_local_page() > X-Mailer: git-send-

[PATCH 0/9] drm/i915: Replace kmap_atomic() with kmap_local_page()

2022-10-18 Thread Zhao Liu
From: Zhao Liu The use of kmap_atomic() is being deprecated in favor of kmap_local_page()[1]. In the following patches, we can convert the calls of kmap_atomic() / kunmap_atomic() to kmap_local_page() / kunmap_local(), which can instead do the mapping / unmapping regardless of the context

[PATCH 2/9] drm/i915: Use kmap_local_page() in gem/i915_gem_pyhs.c

2022-10-18 Thread Zhao Liu
From: Zhao Liu The use of kmap_atomic() is being deprecated in favor of kmap_local_page()[1]. The main difference between atomic and local mappings is that local mappings doesn't disable page faults or preemption. In drm/i915/gem/i915_gem_phys.c, the functions i915_gem_object_get_pages_phys

[PATCH 4/9] drm/i915: Use kmap_local_page() in gem/selftests/huge_pages.c

2022-10-18 Thread Zhao Liu
From: Zhao Liu The use of kmap_atomic() is being deprecated in favor of kmap_local_page()[1]. The main difference between atomic and local mappings is that local mappings doesn't disable page faults or preemption. In drm/i915/gem/selftests/huge_pages.c, function __cpu_check_shmem() mainly uses

Re: [PATCH 0/9] drm/i915: Replace kmap_atomic() with kmap_local_page()

2022-11-05 Thread Zhao Liu
I missed the previous mails). > > On luned? 17 ottobre 2022 11:37:16 CEST Zhao Liu wrote: > > From: Zhao Liu > > > > The use of kmap_atomic() is being deprecated in favor of > > kmap_local_page()[1]. > > Some words to explain why kmap_atomic was deprecat

Re: [PATCH 1/9] drm/i915: Use kmap_local_page() in gem/i915_gem_object.c

2022-11-05 Thread Zhao Liu
17:51:23 CET Ira Weiny wrote: > > On Sat, Oct 29, 2022 at 01:17:03PM +0200, Fabio M. De Francesco wrote: > > > On luned? 17 ottobre 2022 11:37:17 CEST Zhao Liu wrote: > > > > From: Zhao Liu > > > > > > > > The use of kmap_atomic() is being deprecated

Re: [PATCH 2/9] drm/i915: Use kmap_local_page() in gem/i915_gem_pyhs.c

2022-11-05 Thread Zhao Liu
On Sat, Oct 29, 2022 at 03:32:08PM +0200, Fabio M. De Francesco wrote: > Date: Sat, 29 Oct 2022 15:32:08 +0200 > From: "Fabio M. De Francesco" > Subject: Re: [PATCH 2/9] drm/i915: Use kmap_local_page() in > gem/i915_gem_pyhs.c > > On luned? 17 ottobre 2022 11:37:18 C

Re: [PATCH 1/9] drm/i915: Use kmap_local_page() in gem/i915_gem_object.c

2022-11-05 Thread Zhao Liu
On Sat, Oct 29, 2022 at 01:17:03PM +0200, Fabio M. De Francesco wrote: > Date: Sat, 29 Oct 2022 13:17:03 +0200 > From: "Fabio M. De Francesco" > Subject: Re: [PATCH 1/9] drm/i915: Use kmap_local_page() in > gem/i915_gem_object.c > > On luned? 17 ottobre 2022

Re: [PATCH 1/9] drm/i915: Use kmap_local_page() in gem/i915_gem_object.c

2022-11-05 Thread Zhao Liu
: > > On luned? 17 ottobre 2022 11:37:17 CEST Zhao Liu wrote: > > > From: Zhao Liu > > > > > > The use of kmap_atomic() is being deprecated in favor of > > > kmap_local_page()[1]. > > > > > > The main difference between atomic and local m

Re: [PATCH v2 9/9] drm/i915: Use kmap_local_page() in gem/i915_gem_execbuffer.c

2023-04-14 Thread Zhao Liu
Hi Tvrtko, On Wed, Apr 12, 2023 at 04:45:13PM +0100, Tvrtko Ursulin wrote: [snip] > > > > [snip] > > > However I am unsure if disabling pagefaulting is needed or not. Thomas, > > > Matt, being the last to touch this area, perhaps you could have a look? > > > Because I notice we have a fallback

Re: [PATCH v2 0/9] drm/i915: Replace kmap_atomic() with kmap_local_page()

2023-03-30 Thread Zhao Liu
Hi Fabio, On Wed, Mar 29, 2023 at 06:03:38PM +0200, Fabio M. De Francesco wrote: > Date: Wed, 29 Mar 2023 18:03:38 +0200 > From: "Fabio M. De Francesco" > Subject: Re: [PATCH v2 0/9] drm/i915: Replace kmap_atomic() with > kmap_local_page() > > On mercoledì 29 marzo

Re: [PATCH v2 9/9] drm/i915: Use kmap_local_page() in gem/i915_gem_execbuffer.c

2023-04-10 Thread Zhao Liu
Thanks all for your review! On Fri, Mar 31, 2023 at 05:32:17PM +0200, Fabio M. De Francesco wrote: > Date: Fri, 31 Mar 2023 17:32:17 +0200 > From: "Fabio M. De Francesco" > Subject: Re: [PATCH v2 9/9] drm/i915: Use kmap_local_page() in > gem/i915_gem_execbuffer.c > > On venerd? 31 marzo 2023

[PATCH v2 1/9] drm/i915: Use kmap_local_page() in gem/i915_gem_object.c

2023-03-29 Thread Zhao Liu
From: Zhao Liu The use of kmap_atomic() is being deprecated in favor of kmap_local_page()[1], and this patch converts the call from kmap_atomic() to kmap_local_page(). The main difference between atomic and local mappings is that local mappings doesn't disable page faults or preemption

[PATCH v2 2/9] drm/i915: Use memcpy_[from/to]_page() in gem/i915_gem_pyhs.c

2023-03-29 Thread Zhao Liu
From: Zhao Liu The use of kmap_atomic() is being deprecated in favor of kmap_local_page()[1], and this patch converts the call from kmap_atomic() + memcpy() to memcpy_[from/to]_page(), which use kmap_local_page() to build local mapping and then do memcpy(). The main difference between atomic

[PATCH v2 0/9] drm/i915: Replace kmap_atomic() with kmap_local_page()

2023-03-29 Thread Zhao Liu
From: Zhao Liu Hi list, Sorry for a long delay since v1 [1]. This patchset is based on 197b6b6 (Linux 6.3-rc4). Welcome and thanks for your review and comments! # Purpose of this patchset The purpose of this pacthset is to replace all uses of kmap_atomic() in i915 with kmap_local_page

[PATCH v2 5/9] drm/i915: Use kmap_local_page() in gem/selftests/i915_gem_coherency.c

2023-03-29 Thread Zhao Liu
From: Zhao Liu The use of kmap_atomic() is being deprecated in favor of kmap_local_page()[1], and this patch converts the call from kmap_atomic() to kmap_local_page(). The main difference between atomic and local mappings is that local mappings doesn't disable page faults or preemption

[PATCH v2 7/9] drm/i915: Use memcpy_from_page() in gt/uc/intel_uc_fw.c

2023-03-29 Thread Zhao Liu
From: Zhao Liu The use of kmap_atomic() is being deprecated in favor of kmap_local_page()[1], and this patch converts the call from kmap_atomic() to kmap_local_page(). The main difference between atomic and local mappings is that local mappings doesn't disable page faults or preemption

[PATCH v2 9/9] drm/i915: Use kmap_local_page() in gem/i915_gem_execbuffer.c

2023-03-29 Thread Zhao Liu
From: Zhao Liu The use of kmap_atomic() is being deprecated in favor of kmap_local_page()[1], and this patch converts the calls from kmap_atomic() to kmap_local_page(). The main difference between atomic and local mappings is that local mappings doesn't disable page faults or preemption

[PATCH v2 8/9] drm/i915: Use kmap_local_page() in i915_cmd_parser.c

2023-03-29 Thread Zhao Liu
From: Zhao Liu The use of kmap_atomic() is being deprecated in favor of kmap_local_page()[1], and this patch converts the call from kmap_atomic() to kmap_local_page(). The main difference between atomic and local mappings is that local mappings doesn't disable page faults or preemption

[PATCH v2 6/9] drm/i915: Use kmap_local_page() in gem/selftests/i915_gem_context.c

2023-03-29 Thread Zhao Liu
From: Zhao Liu The use of kmap_atomic() is being deprecated in favor of kmap_local_page()[1], and this patch converts the call from kmap_atomic() to kmap_local_page(). The main difference between atomic and local mappings is that local mappings doesn't disable page faults or preemption

[PATCH v2 3/9] drm/i915: Use kmap_local_page() in gem/i915_gem_shmem.c

2023-03-29 Thread Zhao Liu
From: Zhao Liu The use of kmap_atomic() is being deprecated in favor of kmap_local_page()[1]. The main difference between atomic and local mappings is that local mappings doesn't disable page faults or preemption (the preemption is disabled for !PREEMPT_RT case, otherwise it only disables

[PATCH v2 4/9] drm/i915: Use kmap_local_page() in gem/selftests/huge_pages.c

2023-03-29 Thread Zhao Liu
From: Zhao Liu The use of kmap_atomic() is being deprecated in favor of kmap_local_page()[1], and this patch converts the call from kmap_atomic() to kmap_local_page(). The main difference between atomic and local mappings is that local mappings doesn't disable page faults or preemption

Re: [PATCH 0/9] drm/i915: Replace kmap_atomic() with kmap_local_page()

2023-02-14 Thread Zhao Liu
On Tue, Feb 14, 2023 at 08:25:08PM -0800, Ira Weiny wrote: > Date: Tue, 14 Feb 2023 20:25:08 -0800 > From: Ira Weiny > Subject: Re: [PATCH 0/9] drm/i915: Replace kmap_atomic() with > kmap_local_page() > > Zhao Liu wrote: > > From: Zhao Liu > > > > The use

Re: [PATCH v3 0/9] drm/i915: Replace kmap_atomic() with kmap_local_page()

2023-12-14 Thread Zhao Liu
ote: > > > > Hi Zhao, > > > > On 14/12/2023 13:19, Zhao Liu wrote: > > > Hi maintainers, > > > > > > Just kindly ping. > > > May I ask if this refresh version could be merged into the next tree of > > > the i915? > > > > I

Re: [PATCH v3 0/9] drm/i915: Replace kmap_atomic() with kmap_local_page()

2023-12-14 Thread Zhao Liu
Hi maintainers, Just kindly ping. May I ask if this refresh version could be merged into the next tree of the i915? Thanks, Zhao On Sun, Dec 03, 2023 at 09:29:38PM +0800, Zhao Liu wrote: > Date: Sun, 3 Dec 2023 21:29:38 +0800 > From: Zhao Liu > Subject: [PATCH v3 0/9] drm/i915

[PATCH v3 5/9] drm/i915: Use kmap_local_page() in gem/selftests/i915_gem_coherency.c

2023-12-03 Thread Zhao Liu
From: Zhao Liu The use of kmap_atomic() is being deprecated in favor of kmap_local_page()[1], and this patch converts the call from kmap_atomic() to kmap_local_page(). The main difference between atomic and local mappings is that local mappings doesn't disable page faults or preemption

[PATCH v3 8/9] drm/i915: Use kmap_local_page() in i915_cmd_parser.c

2023-12-03 Thread Zhao Liu
From: Zhao Liu The use of kmap_atomic() is being deprecated in favor of kmap_local_page()[1], and this patch converts the call from kmap_atomic() to kmap_local_page(). The main difference between atomic and local mappings is that local mappings doesn't disable page faults or preemption

[PATCH v3 1/9] drm/i915: Use kmap_local_page() in gem/i915_gem_object.c

2023-12-03 Thread Zhao Liu
From: Zhao Liu The use of kmap_atomic() is being deprecated in favor of kmap_local_page()[1], and this patch converts the call from kmap_atomic() to kmap_local_page(). The main difference between atomic and local mappings is that local mappings doesn't disable page faults or preemption

[PATCH v3 4/9] drm/i915: Use kmap_local_page() in gem/selftests/huge_pages.c

2023-12-03 Thread Zhao Liu
From: Zhao Liu The use of kmap_atomic() is being deprecated in favor of kmap_local_page()[1], and this patch converts the call from kmap_atomic() to kmap_local_page(). The main difference between atomic and local mappings is that local mappings doesn't disable page faults or preemption

[PATCH v3 6/9] drm/i915: Use kmap_local_page() in gem/selftests/i915_gem_context.c

2023-12-03 Thread Zhao Liu
From: Zhao Liu The use of kmap_atomic() is being deprecated in favor of kmap_local_page()[1], and this patch converts the call from kmap_atomic() to kmap_local_page(). The main difference between atomic and local mappings is that local mappings doesn't disable page faults or preemption

[PATCH v3 0/9] drm/i915: Replace kmap_atomic() with kmap_local_page()

2023-12-03 Thread Zhao Liu
From: Zhao Liu Hi all, I refreshed this v3 by rebasing v2 [1] on the commit 968f35f4ab1c ("Merge tag 'v6.7-rc3-smb3-client-fixes' of git://git.samba.org/sfrench/ cifs-2.6"). Based on the current code, I rechecked the substitutions in v2 and they still stand and are valid, so no c

[PATCH v3 3/9] drm/i915: Use kmap_local_page() in gem/i915_gem_shmem.c

2023-12-03 Thread Zhao Liu
From: Zhao Liu The use of kmap_atomic() is being deprecated in favor of kmap_local_page()[1]. The main difference between atomic and local mappings is that local mappings doesn't disable page faults or preemption (the preemption is disabled for !PREEMPT_RT case, otherwise it only disables

[PATCH v3 2/9] drm/i915: Use memcpy_[from/to]_page() in gem/i915_gem_pyhs.c

2023-12-03 Thread Zhao Liu
From: Zhao Liu The use of kmap_atomic() is being deprecated in favor of kmap_local_page()[1], and this patch converts the call from kmap_atomic() + memcpy() to memcpy_[from/to]_page(), which use kmap_local_page() to build local mapping and then do memcpy(). The main difference between atomic

[PATCH v3 9/9] drm/i915: Use kmap_local_page() in gem/i915_gem_execbuffer.c

2023-12-03 Thread Zhao Liu
From: Zhao Liu The use of kmap_atomic() is being deprecated in favor of kmap_local_page()[1], and this patch converts the calls from kmap_atomic() to kmap_local_page(). The main difference between atomic and local mappings is that local mappings doesn't disable page faults or preemption

[PATCH v3 7/9] drm/i915: Use memcpy_from_page() in gt/uc/intel_uc_fw.c

2023-12-03 Thread Zhao Liu
From: Zhao Liu The use of kmap_atomic() is being deprecated in favor of kmap_local_page()[1], and this patch converts the call from kmap_atomic() to kmap_local_page(). The main difference between atomic and local mappings is that local mappings doesn't disable page faults or preemption