All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/9] drm/i915: Replace kmap_atomic() with kmap_local_page()
@ 2023-12-03 13:29 ` Zhao Liu
  0 siblings, 0 replies; 49+ messages in thread
From: Zhao Liu @ 2023-12-03 13:29 UTC (permalink / raw)
  To: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin,
	David Airlie, Daniel Vetter, Ira Weiny, Fabio M . De Francesco,
	intel-gfx, dri-devel, linux-kernel
  Cc: Dave Hansen, Zhenyu Wang, Zhao Liu

From: Zhao Liu <zhao1.liu@intel.com>

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 code change in v3.

Thanks for all the review! And sorry v2 was missed, I'll pay more
attention to this v3.


Purpose of This Patchset
========================

The purpose of this pacthset is to replace all uses of kmap_atomic() in
i915 with kmap_local_page() because the use of kmap_atomic() is being
deprecated in favor of kmap_local_page()[2]. And 92b64bd (mm/highmem:
add notes about conversions from kmap{,_atomic}()) has declared the
deprecation of kmap_atomic().


Motivation for Deprecating kmap_atomic() and Using kmap_local_page()
====================================================================

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 migration).

With kmap_local_page(), we can avoid the often unwanted side effect of
unnecessary page faults and preemption disables.


Patch summary
=============

Patch 1, 4-6 and 8-9 replace kmap_atomic()/kunmap_atomic() with
        kmap_local_page()/kunmap_local() directly. With these local
        mappings, the page faults and preemption are allowed.

Patch 2 and 7 use memcpy_from_page() and memcpy_to_page() to replace
        kmap_atomic()/kunmap_atomic(). These two variants of memcpy()
        are based on the local mapping, so page faults and preemption
        are also allowed in these two interfaces.

Patch 3 replaces kmap_atomic()/kunmap_atomic() with kmap_local_page()/
        kunmap_local() and also disable page fault since the for special
        handling (pls see the commit message).


Reference
=========

[1]: https://lore.kernel.org/all/20230329073220.3982460-1-zhao1.liu@linux.intel.com/
[2]: https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com


Thanks and Best Regards,
Zhao

---
Changlog:

Changes since v2:
* Rebased on 968f35f4ab1c ("Merge tag 'v6.7-rc3-smb3-client-fixes' of
  git://git.samba.org/sfrench/cifs-2.6").
* Removed changelog (of v2) in commit message.
* Fixed typo in cover letter (Fabio).
* Added Reviewed-by tags from Ira and Fabio.

Changes since v1:
* Dropped hot plug related description in commit message since it has
  nothing to do with kmap_local_page().
* Emphasized the motivation for using kmap_local_page() in commit
  message.
* Rebased patch 1 on f47e630 (drm/i915/gem: Typecheck page lookups) to
  keep the "idx" variable of type pgoff_t here.
* Used memcpy_from_page() and memcpy_to_page() to replace
  kmap_local_page() + memcpy() in patch 2.

---
Zhao Liu (9):
  drm/i915: Use kmap_local_page() in gem/i915_gem_object.c
  drm/i915: Use memcpy_[from/to]_page() in gem/i915_gem_pyhs.c
  drm/i915: Use kmap_local_page() in gem/i915_gem_shmem.c
  drm/i915: Use kmap_local_page() in gem/selftests/huge_pages.c
  drm/i915: Use kmap_local_page() in gem/selftests/i915_gem_coherency.c
  drm/i915: Use kmap_local_page() in gem/selftests/i915_gem_context.c
  drm/i915: Use memcpy_from_page() in gt/uc/intel_uc_fw.c
  drm/i915: Use kmap_local_page() in i915_cmd_parser.c
  drm/i915: Use kmap_local_page() in gem/i915_gem_execbuffer.c

 drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c       | 10 +++++-----
 drivers/gpu/drm/i915/gem/i915_gem_object.c           |  8 +++-----
 drivers/gpu/drm/i915/gem/i915_gem_phys.c             | 10 ++--------
 drivers/gpu/drm/i915/gem/i915_gem_shmem.c            |  6 ++++--
 drivers/gpu/drm/i915/gem/selftests/huge_pages.c      |  6 +++---
 .../gpu/drm/i915/gem/selftests/i915_gem_coherency.c  | 12 ++++--------
 .../gpu/drm/i915/gem/selftests/i915_gem_context.c    |  8 ++++----
 drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c             |  5 +----
 drivers/gpu/drm/i915/i915_cmd_parser.c               |  4 ++--
 9 files changed, 28 insertions(+), 41 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 49+ messages in thread

* [PATCH v3 0/9] drm/i915: Replace kmap_atomic() with kmap_local_page()
@ 2023-12-03 13:29 ` Zhao Liu
  0 siblings, 0 replies; 49+ messages in thread
From: Zhao Liu @ 2023-12-03 13:29 UTC (permalink / raw)
  To: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin,
	David Airlie, Daniel Vetter, Ira Weiny, Fabio M . De Francesco,
	intel-gfx, dri-devel, linux-kernel
  Cc: Dave Hansen, Zhao Liu, Zhenyu Wang

From: Zhao Liu <zhao1.liu@intel.com>

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 code change in v3.

Thanks for all the review! And sorry v2 was missed, I'll pay more
attention to this v3.


Purpose of This Patchset
========================

The purpose of this pacthset is to replace all uses of kmap_atomic() in
i915 with kmap_local_page() because the use of kmap_atomic() is being
deprecated in favor of kmap_local_page()[2]. And 92b64bd (mm/highmem:
add notes about conversions from kmap{,_atomic}()) has declared the
deprecation of kmap_atomic().


Motivation for Deprecating kmap_atomic() and Using kmap_local_page()
====================================================================

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 migration).

With kmap_local_page(), we can avoid the often unwanted side effect of
unnecessary page faults and preemption disables.


Patch summary
=============

Patch 1, 4-6 and 8-9 replace kmap_atomic()/kunmap_atomic() with
        kmap_local_page()/kunmap_local() directly. With these local
        mappings, the page faults and preemption are allowed.

Patch 2 and 7 use memcpy_from_page() and memcpy_to_page() to replace
        kmap_atomic()/kunmap_atomic(). These two variants of memcpy()
        are based on the local mapping, so page faults and preemption
        are also allowed in these two interfaces.

Patch 3 replaces kmap_atomic()/kunmap_atomic() with kmap_local_page()/
        kunmap_local() and also disable page fault since the for special
        handling (pls see the commit message).


Reference
=========

[1]: https://lore.kernel.org/all/20230329073220.3982460-1-zhao1.liu@linux.intel.com/
[2]: https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com


Thanks and Best Regards,
Zhao

---
Changlog:

Changes since v2:
* Rebased on 968f35f4ab1c ("Merge tag 'v6.7-rc3-smb3-client-fixes' of
  git://git.samba.org/sfrench/cifs-2.6").
* Removed changelog (of v2) in commit message.
* Fixed typo in cover letter (Fabio).
* Added Reviewed-by tags from Ira and Fabio.

Changes since v1:
* Dropped hot plug related description in commit message since it has
  nothing to do with kmap_local_page().
* Emphasized the motivation for using kmap_local_page() in commit
  message.
* Rebased patch 1 on f47e630 (drm/i915/gem: Typecheck page lookups) to
  keep the "idx" variable of type pgoff_t here.
* Used memcpy_from_page() and memcpy_to_page() to replace
  kmap_local_page() + memcpy() in patch 2.

---
Zhao Liu (9):
  drm/i915: Use kmap_local_page() in gem/i915_gem_object.c
  drm/i915: Use memcpy_[from/to]_page() in gem/i915_gem_pyhs.c
  drm/i915: Use kmap_local_page() in gem/i915_gem_shmem.c
  drm/i915: Use kmap_local_page() in gem/selftests/huge_pages.c
  drm/i915: Use kmap_local_page() in gem/selftests/i915_gem_coherency.c
  drm/i915: Use kmap_local_page() in gem/selftests/i915_gem_context.c
  drm/i915: Use memcpy_from_page() in gt/uc/intel_uc_fw.c
  drm/i915: Use kmap_local_page() in i915_cmd_parser.c
  drm/i915: Use kmap_local_page() in gem/i915_gem_execbuffer.c

 drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c       | 10 +++++-----
 drivers/gpu/drm/i915/gem/i915_gem_object.c           |  8 +++-----
 drivers/gpu/drm/i915/gem/i915_gem_phys.c             | 10 ++--------
 drivers/gpu/drm/i915/gem/i915_gem_shmem.c            |  6 ++++--
 drivers/gpu/drm/i915/gem/selftests/huge_pages.c      |  6 +++---
 .../gpu/drm/i915/gem/selftests/i915_gem_coherency.c  | 12 ++++--------
 .../gpu/drm/i915/gem/selftests/i915_gem_context.c    |  8 ++++----
 drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c             |  5 +----
 drivers/gpu/drm/i915/i915_cmd_parser.c               |  4 ++--
 9 files changed, 28 insertions(+), 41 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 49+ messages in thread

* [Intel-gfx] [PATCH v3 0/9] drm/i915: Replace kmap_atomic() with kmap_local_page()
@ 2023-12-03 13:29 ` Zhao Liu
  0 siblings, 0 replies; 49+ messages in thread
From: Zhao Liu @ 2023-12-03 13:29 UTC (permalink / raw)
  To: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin,
	David Airlie, Daniel Vetter, Ira Weiny, Fabio M . De Francesco,
	intel-gfx, dri-devel, linux-kernel
  Cc: Dave Hansen, Zhao Liu, Zhenyu Wang

From: Zhao Liu <zhao1.liu@intel.com>

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 code change in v3.

Thanks for all the review! And sorry v2 was missed, I'll pay more
attention to this v3.


Purpose of This Patchset
========================

The purpose of this pacthset is to replace all uses of kmap_atomic() in
i915 with kmap_local_page() because the use of kmap_atomic() is being
deprecated in favor of kmap_local_page()[2]. And 92b64bd (mm/highmem:
add notes about conversions from kmap{,_atomic}()) has declared the
deprecation of kmap_atomic().


Motivation for Deprecating kmap_atomic() and Using kmap_local_page()
====================================================================

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 migration).

With kmap_local_page(), we can avoid the often unwanted side effect of
unnecessary page faults and preemption disables.


Patch summary
=============

Patch 1, 4-6 and 8-9 replace kmap_atomic()/kunmap_atomic() with
        kmap_local_page()/kunmap_local() directly. With these local
        mappings, the page faults and preemption are allowed.

Patch 2 and 7 use memcpy_from_page() and memcpy_to_page() to replace
        kmap_atomic()/kunmap_atomic(). These two variants of memcpy()
        are based on the local mapping, so page faults and preemption
        are also allowed in these two interfaces.

Patch 3 replaces kmap_atomic()/kunmap_atomic() with kmap_local_page()/
        kunmap_local() and also disable page fault since the for special
        handling (pls see the commit message).


Reference
=========

[1]: https://lore.kernel.org/all/20230329073220.3982460-1-zhao1.liu@linux.intel.com/
[2]: https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com


Thanks and Best Regards,
Zhao

---
Changlog:

Changes since v2:
* Rebased on 968f35f4ab1c ("Merge tag 'v6.7-rc3-smb3-client-fixes' of
  git://git.samba.org/sfrench/cifs-2.6").
* Removed changelog (of v2) in commit message.
* Fixed typo in cover letter (Fabio).
* Added Reviewed-by tags from Ira and Fabio.

Changes since v1:
* Dropped hot plug related description in commit message since it has
  nothing to do with kmap_local_page().
* Emphasized the motivation for using kmap_local_page() in commit
  message.
* Rebased patch 1 on f47e630 (drm/i915/gem: Typecheck page lookups) to
  keep the "idx" variable of type pgoff_t here.
* Used memcpy_from_page() and memcpy_to_page() to replace
  kmap_local_page() + memcpy() in patch 2.

---
Zhao Liu (9):
  drm/i915: Use kmap_local_page() in gem/i915_gem_object.c
  drm/i915: Use memcpy_[from/to]_page() in gem/i915_gem_pyhs.c
  drm/i915: Use kmap_local_page() in gem/i915_gem_shmem.c
  drm/i915: Use kmap_local_page() in gem/selftests/huge_pages.c
  drm/i915: Use kmap_local_page() in gem/selftests/i915_gem_coherency.c
  drm/i915: Use kmap_local_page() in gem/selftests/i915_gem_context.c
  drm/i915: Use memcpy_from_page() in gt/uc/intel_uc_fw.c
  drm/i915: Use kmap_local_page() in i915_cmd_parser.c
  drm/i915: Use kmap_local_page() in gem/i915_gem_execbuffer.c

 drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c       | 10 +++++-----
 drivers/gpu/drm/i915/gem/i915_gem_object.c           |  8 +++-----
 drivers/gpu/drm/i915/gem/i915_gem_phys.c             | 10 ++--------
 drivers/gpu/drm/i915/gem/i915_gem_shmem.c            |  6 ++++--
 drivers/gpu/drm/i915/gem/selftests/huge_pages.c      |  6 +++---
 .../gpu/drm/i915/gem/selftests/i915_gem_coherency.c  | 12 ++++--------
 .../gpu/drm/i915/gem/selftests/i915_gem_context.c    |  8 ++++----
 drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c             |  5 +----
 drivers/gpu/drm/i915/i915_cmd_parser.c               |  4 ++--
 9 files changed, 28 insertions(+), 41 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 49+ messages in thread

* [PATCH v3 1/9] drm/i915: Use kmap_local_page() in gem/i915_gem_object.c
  2023-12-03 13:29 ` Zhao Liu
  (?)
@ 2023-12-03 13:29   ` Zhao Liu
  -1 siblings, 0 replies; 49+ messages in thread
From: Zhao Liu @ 2023-12-03 13:29 UTC (permalink / raw)
  To: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin,
	David Airlie, Daniel Vetter, Ira Weiny, Fabio M . De Francesco,
	intel-gfx, dri-devel, linux-kernel
  Cc: Dave Hansen, Zhenyu Wang, Zhao Liu

From: Zhao Liu <zhao1.liu@intel.com>

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 (the preemption is
disabled for !PREEMPT_RT case, otherwise it only disables migration).

With kmap_local_page(), we can avoid the often unwanted side effect of
unnecessary page faults and preemption disables.

There're 2 reasons why i915_gem_object_read_from_page_kmap() doesn't
need to disable pagefaults and preemption for mapping:

1. The flush operation is safe. In drm/i915/gem/i915_gem_object.c,
i915_gem_object_read_from_page_kmap() calls drm_clflush_virt_range() to
use CLFLUSHOPT or WBINVD to flush. Since CLFLUSHOPT is global on x86
and WBINVD is called on each cpu in drm_clflush_virt_range(), the flush
operation is global.

2. Any context switch caused by preemption or page faults (page fault
may cause sleep) doesn't affect the validity of local mapping.

Therefore, i915_gem_object_read_from_page_kmap() is a function where
the use of kmap_local_page() in place of kmap_atomic() is correctly
suited.

Convert the calls of kmap_atomic() / kunmap_atomic() to
kmap_local_page() / kunmap_local().

And remove the redundant variable that stores the address of the mapped
page since kunmap_local() can accept any pointer within the page.

[1]: https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com

Suggested-by: Dave Hansen <dave.hansen@intel.com>
Suggested-by: Ira Weiny <ira.weiny@intel.com>
Suggested-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
---
Suggested by credits:
  Dave: Referred to his explanation about cache flush.
  Ira: Referred to his task document, review comments and explanation
       about cache flush.
  Fabio: Referred to his boiler plate commit message and his description
         about why kmap_local_page() should be preferred.
---
 drivers/gpu/drm/i915/gem/i915_gem_object.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_object.c b/drivers/gpu/drm/i915/gem/i915_gem_object.c
index c26d87555825..a2a7e5005415 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_object.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_object.c
@@ -493,17 +493,15 @@ static void
 i915_gem_object_read_from_page_kmap(struct drm_i915_gem_object *obj, u64 offset, void *dst, int size)
 {
 	pgoff_t idx = offset >> PAGE_SHIFT;
-	void *src_map;
 	void *src_ptr;
 
-	src_map = kmap_atomic(i915_gem_object_get_page(obj, idx));
-
-	src_ptr = src_map + offset_in_page(offset);
+	src_ptr = kmap_local_page(i915_gem_object_get_page(obj, idx))
+	          + offset_in_page(offset);
 	if (!(obj->cache_coherent & I915_BO_CACHE_COHERENT_FOR_READ))
 		drm_clflush_virt_range(src_ptr, size);
 	memcpy(dst, src_ptr, size);
 
-	kunmap_atomic(src_map);
+	kunmap_local(src_ptr);
 }
 
 static void
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [PATCH v3 1/9] drm/i915: Use kmap_local_page() in gem/i915_gem_object.c
@ 2023-12-03 13:29   ` Zhao Liu
  0 siblings, 0 replies; 49+ messages in thread
From: Zhao Liu @ 2023-12-03 13:29 UTC (permalink / raw)
  To: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin,
	David Airlie, Daniel Vetter, Ira Weiny, Fabio M . De Francesco,
	intel-gfx, dri-devel, linux-kernel
  Cc: Dave Hansen, Zhao Liu, Zhenyu Wang

From: Zhao Liu <zhao1.liu@intel.com>

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 (the preemption is
disabled for !PREEMPT_RT case, otherwise it only disables migration).

With kmap_local_page(), we can avoid the often unwanted side effect of
unnecessary page faults and preemption disables.

There're 2 reasons why i915_gem_object_read_from_page_kmap() doesn't
need to disable pagefaults and preemption for mapping:

1. The flush operation is safe. In drm/i915/gem/i915_gem_object.c,
i915_gem_object_read_from_page_kmap() calls drm_clflush_virt_range() to
use CLFLUSHOPT or WBINVD to flush. Since CLFLUSHOPT is global on x86
and WBINVD is called on each cpu in drm_clflush_virt_range(), the flush
operation is global.

2. Any context switch caused by preemption or page faults (page fault
may cause sleep) doesn't affect the validity of local mapping.

Therefore, i915_gem_object_read_from_page_kmap() is a function where
the use of kmap_local_page() in place of kmap_atomic() is correctly
suited.

Convert the calls of kmap_atomic() / kunmap_atomic() to
kmap_local_page() / kunmap_local().

And remove the redundant variable that stores the address of the mapped
page since kunmap_local() can accept any pointer within the page.

[1]: https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com

Suggested-by: Dave Hansen <dave.hansen@intel.com>
Suggested-by: Ira Weiny <ira.weiny@intel.com>
Suggested-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
---
Suggested by credits:
  Dave: Referred to his explanation about cache flush.
  Ira: Referred to his task document, review comments and explanation
       about cache flush.
  Fabio: Referred to his boiler plate commit message and his description
         about why kmap_local_page() should be preferred.
---
 drivers/gpu/drm/i915/gem/i915_gem_object.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_object.c b/drivers/gpu/drm/i915/gem/i915_gem_object.c
index c26d87555825..a2a7e5005415 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_object.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_object.c
@@ -493,17 +493,15 @@ static void
 i915_gem_object_read_from_page_kmap(struct drm_i915_gem_object *obj, u64 offset, void *dst, int size)
 {
 	pgoff_t idx = offset >> PAGE_SHIFT;
-	void *src_map;
 	void *src_ptr;
 
-	src_map = kmap_atomic(i915_gem_object_get_page(obj, idx));
-
-	src_ptr = src_map + offset_in_page(offset);
+	src_ptr = kmap_local_page(i915_gem_object_get_page(obj, idx))
+	          + offset_in_page(offset);
 	if (!(obj->cache_coherent & I915_BO_CACHE_COHERENT_FOR_READ))
 		drm_clflush_virt_range(src_ptr, size);
 	memcpy(dst, src_ptr, size);
 
-	kunmap_atomic(src_map);
+	kunmap_local(src_ptr);
 }
 
 static void
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [Intel-gfx] [PATCH v3 1/9] drm/i915: Use kmap_local_page() in gem/i915_gem_object.c
@ 2023-12-03 13:29   ` Zhao Liu
  0 siblings, 0 replies; 49+ messages in thread
From: Zhao Liu @ 2023-12-03 13:29 UTC (permalink / raw)
  To: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin,
	David Airlie, Daniel Vetter, Ira Weiny, Fabio M . De Francesco,
	intel-gfx, dri-devel, linux-kernel
  Cc: Dave Hansen, Zhao Liu, Zhenyu Wang

From: Zhao Liu <zhao1.liu@intel.com>

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 (the preemption is
disabled for !PREEMPT_RT case, otherwise it only disables migration).

With kmap_local_page(), we can avoid the often unwanted side effect of
unnecessary page faults and preemption disables.

There're 2 reasons why i915_gem_object_read_from_page_kmap() doesn't
need to disable pagefaults and preemption for mapping:

1. The flush operation is safe. In drm/i915/gem/i915_gem_object.c,
i915_gem_object_read_from_page_kmap() calls drm_clflush_virt_range() to
use CLFLUSHOPT or WBINVD to flush. Since CLFLUSHOPT is global on x86
and WBINVD is called on each cpu in drm_clflush_virt_range(), the flush
operation is global.

2. Any context switch caused by preemption or page faults (page fault
may cause sleep) doesn't affect the validity of local mapping.

Therefore, i915_gem_object_read_from_page_kmap() is a function where
the use of kmap_local_page() in place of kmap_atomic() is correctly
suited.

Convert the calls of kmap_atomic() / kunmap_atomic() to
kmap_local_page() / kunmap_local().

And remove the redundant variable that stores the address of the mapped
page since kunmap_local() can accept any pointer within the page.

[1]: https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com

Suggested-by: Dave Hansen <dave.hansen@intel.com>
Suggested-by: Ira Weiny <ira.weiny@intel.com>
Suggested-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
---
Suggested by credits:
  Dave: Referred to his explanation about cache flush.
  Ira: Referred to his task document, review comments and explanation
       about cache flush.
  Fabio: Referred to his boiler plate commit message and his description
         about why kmap_local_page() should be preferred.
---
 drivers/gpu/drm/i915/gem/i915_gem_object.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_object.c b/drivers/gpu/drm/i915/gem/i915_gem_object.c
index c26d87555825..a2a7e5005415 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_object.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_object.c
@@ -493,17 +493,15 @@ static void
 i915_gem_object_read_from_page_kmap(struct drm_i915_gem_object *obj, u64 offset, void *dst, int size)
 {
 	pgoff_t idx = offset >> PAGE_SHIFT;
-	void *src_map;
 	void *src_ptr;
 
-	src_map = kmap_atomic(i915_gem_object_get_page(obj, idx));
-
-	src_ptr = src_map + offset_in_page(offset);
+	src_ptr = kmap_local_page(i915_gem_object_get_page(obj, idx))
+	          + offset_in_page(offset);
 	if (!(obj->cache_coherent & I915_BO_CACHE_COHERENT_FOR_READ))
 		drm_clflush_virt_range(src_ptr, size);
 	memcpy(dst, src_ptr, size);
 
-	kunmap_atomic(src_map);
+	kunmap_local(src_ptr);
 }
 
 static void
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [PATCH v3 2/9] drm/i915: Use memcpy_[from/to]_page() in gem/i915_gem_pyhs.c
  2023-12-03 13:29 ` Zhao Liu
  (?)
@ 2023-12-03 13:29   ` Zhao Liu
  -1 siblings, 0 replies; 49+ messages in thread
From: Zhao Liu @ 2023-12-03 13:29 UTC (permalink / raw)
  To: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin,
	David Airlie, Daniel Vetter, Ira Weiny, Fabio M . De Francesco,
	intel-gfx, dri-devel, linux-kernel
  Cc: Dave Hansen, Zhenyu Wang, Zhao Liu

From: Zhao Liu <zhao1.liu@intel.com>

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 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 migration).

With kmap_local_page(), we can avoid the often unwanted side effect of
unnecessary page faults and preemption disables.

In drm/i915/gem/i915_gem_phys.c, the functions
i915_gem_object_get_pages_phys() and i915_gem_object_put_pages_phys()
don't need to disable pagefaults and preemption for mapping because of
2 reasons:

1. The flush operation is safe. In drm/i915/gem/i915_gem_object.c,
i915_gem_object_get_pages_phys() and i915_gem_object_put_pages_phys()
calls drm_clflush_virt_range() to use CLFLUSHOPT or WBINVD to flush.
Since CLFLUSHOPT is global on x86 and WBINVD is called on each cpu in
drm_clflush_virt_range(), the flush operation is global.

2. Any context switch caused by preemption or page faults (page fault
may cause sleep) doesn't affect the validity of local mapping.

Therefore, i915_gem_object_get_pages_phys() and
i915_gem_object_put_pages_phys() are two functions where the uses of
local mappings in place of atomic mappings are correctly suited.

Convert the calls of kmap_atomic() / kunmap_atomic() + memcpy() to
memcpy_from_page() and memcpy_to_page().

[1]: https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com

Suggested-by: Dave Hansen <dave.hansen@intel.com>
Suggested-by: Ira Weiny <ira.weiny@intel.com>
Suggested-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
---
Suggested by credits:
  Dave: Referred to his explanation about cache flush.
  Ira: Referred to his task document, review comments and explanation
       about cache flush.
  Fabio: Referred to his boiler plate commit message and his description
         about why kmap_local_page() should be preferred.
---
 drivers/gpu/drm/i915/gem/i915_gem_phys.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_phys.c b/drivers/gpu/drm/i915/gem/i915_gem_phys.c
index 5df128e2f4dc..ef85c6dc9fd5 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_phys.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_phys.c
@@ -65,16 +65,13 @@ static int i915_gem_object_get_pages_phys(struct drm_i915_gem_object *obj)
 	dst = vaddr;
 	for (i = 0; i < obj->base.size / PAGE_SIZE; i++) {
 		struct page *page;
-		void *src;
 
 		page = shmem_read_mapping_page(mapping, i);
 		if (IS_ERR(page))
 			goto err_st;
 
-		src = kmap_atomic(page);
-		memcpy(dst, src, PAGE_SIZE);
+		memcpy_from_page(dst, page, 0, PAGE_SIZE);
 		drm_clflush_virt_range(dst, PAGE_SIZE);
-		kunmap_atomic(src);
 
 		put_page(page);
 		dst += PAGE_SIZE;
@@ -113,16 +110,13 @@ i915_gem_object_put_pages_phys(struct drm_i915_gem_object *obj,
 
 		for (i = 0; i < obj->base.size / PAGE_SIZE; i++) {
 			struct page *page;
-			char *dst;
 
 			page = shmem_read_mapping_page(mapping, i);
 			if (IS_ERR(page))
 				continue;
 
-			dst = kmap_atomic(page);
 			drm_clflush_virt_range(src, PAGE_SIZE);
-			memcpy(dst, src, PAGE_SIZE);
-			kunmap_atomic(dst);
+			memcpy_to_page(page, 0, src, PAGE_SIZE);
 
 			set_page_dirty(page);
 			if (obj->mm.madv == I915_MADV_WILLNEED)
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [PATCH v3 2/9] drm/i915: Use memcpy_[from/to]_page() in gem/i915_gem_pyhs.c
@ 2023-12-03 13:29   ` Zhao Liu
  0 siblings, 0 replies; 49+ messages in thread
From: Zhao Liu @ 2023-12-03 13:29 UTC (permalink / raw)
  To: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin,
	David Airlie, Daniel Vetter, Ira Weiny, Fabio M . De Francesco,
	intel-gfx, dri-devel, linux-kernel
  Cc: Dave Hansen, Zhao Liu, Zhenyu Wang

From: Zhao Liu <zhao1.liu@intel.com>

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 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 migration).

With kmap_local_page(), we can avoid the often unwanted side effect of
unnecessary page faults and preemption disables.

In drm/i915/gem/i915_gem_phys.c, the functions
i915_gem_object_get_pages_phys() and i915_gem_object_put_pages_phys()
don't need to disable pagefaults and preemption for mapping because of
2 reasons:

1. The flush operation is safe. In drm/i915/gem/i915_gem_object.c,
i915_gem_object_get_pages_phys() and i915_gem_object_put_pages_phys()
calls drm_clflush_virt_range() to use CLFLUSHOPT or WBINVD to flush.
Since CLFLUSHOPT is global on x86 and WBINVD is called on each cpu in
drm_clflush_virt_range(), the flush operation is global.

2. Any context switch caused by preemption or page faults (page fault
may cause sleep) doesn't affect the validity of local mapping.

Therefore, i915_gem_object_get_pages_phys() and
i915_gem_object_put_pages_phys() are two functions where the uses of
local mappings in place of atomic mappings are correctly suited.

Convert the calls of kmap_atomic() / kunmap_atomic() + memcpy() to
memcpy_from_page() and memcpy_to_page().

[1]: https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com

Suggested-by: Dave Hansen <dave.hansen@intel.com>
Suggested-by: Ira Weiny <ira.weiny@intel.com>
Suggested-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
---
Suggested by credits:
  Dave: Referred to his explanation about cache flush.
  Ira: Referred to his task document, review comments and explanation
       about cache flush.
  Fabio: Referred to his boiler plate commit message and his description
         about why kmap_local_page() should be preferred.
---
 drivers/gpu/drm/i915/gem/i915_gem_phys.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_phys.c b/drivers/gpu/drm/i915/gem/i915_gem_phys.c
index 5df128e2f4dc..ef85c6dc9fd5 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_phys.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_phys.c
@@ -65,16 +65,13 @@ static int i915_gem_object_get_pages_phys(struct drm_i915_gem_object *obj)
 	dst = vaddr;
 	for (i = 0; i < obj->base.size / PAGE_SIZE; i++) {
 		struct page *page;
-		void *src;
 
 		page = shmem_read_mapping_page(mapping, i);
 		if (IS_ERR(page))
 			goto err_st;
 
-		src = kmap_atomic(page);
-		memcpy(dst, src, PAGE_SIZE);
+		memcpy_from_page(dst, page, 0, PAGE_SIZE);
 		drm_clflush_virt_range(dst, PAGE_SIZE);
-		kunmap_atomic(src);
 
 		put_page(page);
 		dst += PAGE_SIZE;
@@ -113,16 +110,13 @@ i915_gem_object_put_pages_phys(struct drm_i915_gem_object *obj,
 
 		for (i = 0; i < obj->base.size / PAGE_SIZE; i++) {
 			struct page *page;
-			char *dst;
 
 			page = shmem_read_mapping_page(mapping, i);
 			if (IS_ERR(page))
 				continue;
 
-			dst = kmap_atomic(page);
 			drm_clflush_virt_range(src, PAGE_SIZE);
-			memcpy(dst, src, PAGE_SIZE);
-			kunmap_atomic(dst);
+			memcpy_to_page(page, 0, src, PAGE_SIZE);
 
 			set_page_dirty(page);
 			if (obj->mm.madv == I915_MADV_WILLNEED)
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [Intel-gfx] [PATCH v3 2/9] drm/i915: Use memcpy_[from/to]_page() in gem/i915_gem_pyhs.c
@ 2023-12-03 13:29   ` Zhao Liu
  0 siblings, 0 replies; 49+ messages in thread
From: Zhao Liu @ 2023-12-03 13:29 UTC (permalink / raw)
  To: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin,
	David Airlie, Daniel Vetter, Ira Weiny, Fabio M . De Francesco,
	intel-gfx, dri-devel, linux-kernel
  Cc: Dave Hansen, Zhao Liu, Zhenyu Wang

From: Zhao Liu <zhao1.liu@intel.com>

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 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 migration).

With kmap_local_page(), we can avoid the often unwanted side effect of
unnecessary page faults and preemption disables.

In drm/i915/gem/i915_gem_phys.c, the functions
i915_gem_object_get_pages_phys() and i915_gem_object_put_pages_phys()
don't need to disable pagefaults and preemption for mapping because of
2 reasons:

1. The flush operation is safe. In drm/i915/gem/i915_gem_object.c,
i915_gem_object_get_pages_phys() and i915_gem_object_put_pages_phys()
calls drm_clflush_virt_range() to use CLFLUSHOPT or WBINVD to flush.
Since CLFLUSHOPT is global on x86 and WBINVD is called on each cpu in
drm_clflush_virt_range(), the flush operation is global.

2. Any context switch caused by preemption or page faults (page fault
may cause sleep) doesn't affect the validity of local mapping.

Therefore, i915_gem_object_get_pages_phys() and
i915_gem_object_put_pages_phys() are two functions where the uses of
local mappings in place of atomic mappings are correctly suited.

Convert the calls of kmap_atomic() / kunmap_atomic() + memcpy() to
memcpy_from_page() and memcpy_to_page().

[1]: https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com

Suggested-by: Dave Hansen <dave.hansen@intel.com>
Suggested-by: Ira Weiny <ira.weiny@intel.com>
Suggested-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
---
Suggested by credits:
  Dave: Referred to his explanation about cache flush.
  Ira: Referred to his task document, review comments and explanation
       about cache flush.
  Fabio: Referred to his boiler plate commit message and his description
         about why kmap_local_page() should be preferred.
---
 drivers/gpu/drm/i915/gem/i915_gem_phys.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_phys.c b/drivers/gpu/drm/i915/gem/i915_gem_phys.c
index 5df128e2f4dc..ef85c6dc9fd5 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_phys.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_phys.c
@@ -65,16 +65,13 @@ static int i915_gem_object_get_pages_phys(struct drm_i915_gem_object *obj)
 	dst = vaddr;
 	for (i = 0; i < obj->base.size / PAGE_SIZE; i++) {
 		struct page *page;
-		void *src;
 
 		page = shmem_read_mapping_page(mapping, i);
 		if (IS_ERR(page))
 			goto err_st;
 
-		src = kmap_atomic(page);
-		memcpy(dst, src, PAGE_SIZE);
+		memcpy_from_page(dst, page, 0, PAGE_SIZE);
 		drm_clflush_virt_range(dst, PAGE_SIZE);
-		kunmap_atomic(src);
 
 		put_page(page);
 		dst += PAGE_SIZE;
@@ -113,16 +110,13 @@ i915_gem_object_put_pages_phys(struct drm_i915_gem_object *obj,
 
 		for (i = 0; i < obj->base.size / PAGE_SIZE; i++) {
 			struct page *page;
-			char *dst;
 
 			page = shmem_read_mapping_page(mapping, i);
 			if (IS_ERR(page))
 				continue;
 
-			dst = kmap_atomic(page);
 			drm_clflush_virt_range(src, PAGE_SIZE);
-			memcpy(dst, src, PAGE_SIZE);
-			kunmap_atomic(dst);
+			memcpy_to_page(page, 0, src, PAGE_SIZE);
 
 			set_page_dirty(page);
 			if (obj->mm.madv == I915_MADV_WILLNEED)
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [PATCH v3 3/9] drm/i915: Use kmap_local_page() in gem/i915_gem_shmem.c
  2023-12-03 13:29 ` Zhao Liu
  (?)
@ 2023-12-03 13:29   ` Zhao Liu
  -1 siblings, 0 replies; 49+ messages in thread
From: Zhao Liu @ 2023-12-03 13:29 UTC (permalink / raw)
  To: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin,
	David Airlie, Daniel Vetter, Ira Weiny, Fabio M . De Francesco,
	intel-gfx, dri-devel, linux-kernel
  Cc: Dave Hansen, Zhenyu Wang, Zhao Liu

From: Zhao Liu <zhao1.liu@intel.com>

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 migration).

With kmap_local_page(), we can avoid the often unwanted side effect of
unnecessary page faults or preemption disables.

In drm/i915/gem/i915_gem_shmem.c, the function shmem_pwrite() need to
disable pagefault to eliminate the potential recursion fault[2]. But
here __copy_from_user_inatomic() doesn't need to disable preemption and
local mapping is valid for sched in/out.

So it can use kmap_local_page() / kunmap_local() with
pagefault_disable() / pagefault_enable() to replace atomic mapping.

[1]: https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com
[2]: https://patchwork.freedesktop.org/patch/295840/

Suggested-by: Ira Weiny <ira.weiny@intel.com>
Suggested-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
---
Suggested by credits:
  Ira: Referred to his suggestions about keeping pagefault_disable().
  Fabio: Referred to his description about why kmap_local_page() should
         be preferred.
---
 drivers/gpu/drm/i915/gem/i915_gem_shmem.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_shmem.c b/drivers/gpu/drm/i915/gem/i915_gem_shmem.c
index 73a4a4eb29e0..38b72d86560f 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_shmem.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_shmem.c
@@ -485,11 +485,13 @@ shmem_pwrite(struct drm_i915_gem_object *obj,
 		if (err < 0)
 			return err;
 
-		vaddr = kmap_atomic(page);
+		vaddr = kmap_local_page(page);
+		pagefault_disable();
 		unwritten = __copy_from_user_inatomic(vaddr + pg,
 						      user_data,
 						      len);
-		kunmap_atomic(vaddr);
+		pagefault_enable();
+		kunmap_local(vaddr);
 
 		err = aops->write_end(obj->base.filp, mapping, offset, len,
 				      len - unwritten, page, data);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [PATCH v3 3/9] drm/i915: Use kmap_local_page() in gem/i915_gem_shmem.c
@ 2023-12-03 13:29   ` Zhao Liu
  0 siblings, 0 replies; 49+ messages in thread
From: Zhao Liu @ 2023-12-03 13:29 UTC (permalink / raw)
  To: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin,
	David Airlie, Daniel Vetter, Ira Weiny, Fabio M . De Francesco,
	intel-gfx, dri-devel, linux-kernel
  Cc: Dave Hansen, Zhao Liu, Zhenyu Wang

From: Zhao Liu <zhao1.liu@intel.com>

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 migration).

With kmap_local_page(), we can avoid the often unwanted side effect of
unnecessary page faults or preemption disables.

In drm/i915/gem/i915_gem_shmem.c, the function shmem_pwrite() need to
disable pagefault to eliminate the potential recursion fault[2]. But
here __copy_from_user_inatomic() doesn't need to disable preemption and
local mapping is valid for sched in/out.

So it can use kmap_local_page() / kunmap_local() with
pagefault_disable() / pagefault_enable() to replace atomic mapping.

[1]: https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com
[2]: https://patchwork.freedesktop.org/patch/295840/

Suggested-by: Ira Weiny <ira.weiny@intel.com>
Suggested-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
---
Suggested by credits:
  Ira: Referred to his suggestions about keeping pagefault_disable().
  Fabio: Referred to his description about why kmap_local_page() should
         be preferred.
---
 drivers/gpu/drm/i915/gem/i915_gem_shmem.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_shmem.c b/drivers/gpu/drm/i915/gem/i915_gem_shmem.c
index 73a4a4eb29e0..38b72d86560f 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_shmem.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_shmem.c
@@ -485,11 +485,13 @@ shmem_pwrite(struct drm_i915_gem_object *obj,
 		if (err < 0)
 			return err;
 
-		vaddr = kmap_atomic(page);
+		vaddr = kmap_local_page(page);
+		pagefault_disable();
 		unwritten = __copy_from_user_inatomic(vaddr + pg,
 						      user_data,
 						      len);
-		kunmap_atomic(vaddr);
+		pagefault_enable();
+		kunmap_local(vaddr);
 
 		err = aops->write_end(obj->base.filp, mapping, offset, len,
 				      len - unwritten, page, data);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [Intel-gfx] [PATCH v3 3/9] drm/i915: Use kmap_local_page() in gem/i915_gem_shmem.c
@ 2023-12-03 13:29   ` Zhao Liu
  0 siblings, 0 replies; 49+ messages in thread
From: Zhao Liu @ 2023-12-03 13:29 UTC (permalink / raw)
  To: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin,
	David Airlie, Daniel Vetter, Ira Weiny, Fabio M . De Francesco,
	intel-gfx, dri-devel, linux-kernel
  Cc: Dave Hansen, Zhao Liu, Zhenyu Wang

From: Zhao Liu <zhao1.liu@intel.com>

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 migration).

With kmap_local_page(), we can avoid the often unwanted side effect of
unnecessary page faults or preemption disables.

In drm/i915/gem/i915_gem_shmem.c, the function shmem_pwrite() need to
disable pagefault to eliminate the potential recursion fault[2]. But
here __copy_from_user_inatomic() doesn't need to disable preemption and
local mapping is valid for sched in/out.

So it can use kmap_local_page() / kunmap_local() with
pagefault_disable() / pagefault_enable() to replace atomic mapping.

[1]: https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com
[2]: https://patchwork.freedesktop.org/patch/295840/

Suggested-by: Ira Weiny <ira.weiny@intel.com>
Suggested-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
---
Suggested by credits:
  Ira: Referred to his suggestions about keeping pagefault_disable().
  Fabio: Referred to his description about why kmap_local_page() should
         be preferred.
---
 drivers/gpu/drm/i915/gem/i915_gem_shmem.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_shmem.c b/drivers/gpu/drm/i915/gem/i915_gem_shmem.c
index 73a4a4eb29e0..38b72d86560f 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_shmem.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_shmem.c
@@ -485,11 +485,13 @@ shmem_pwrite(struct drm_i915_gem_object *obj,
 		if (err < 0)
 			return err;
 
-		vaddr = kmap_atomic(page);
+		vaddr = kmap_local_page(page);
+		pagefault_disable();
 		unwritten = __copy_from_user_inatomic(vaddr + pg,
 						      user_data,
 						      len);
-		kunmap_atomic(vaddr);
+		pagefault_enable();
+		kunmap_local(vaddr);
 
 		err = aops->write_end(obj->base.filp, mapping, offset, len,
 				      len - unwritten, page, data);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [PATCH v3 4/9] drm/i915: Use kmap_local_page() in gem/selftests/huge_pages.c
  2023-12-03 13:29 ` Zhao Liu
  (?)
@ 2023-12-03 13:29   ` Zhao Liu
  -1 siblings, 0 replies; 49+ messages in thread
From: Zhao Liu @ 2023-12-03 13:29 UTC (permalink / raw)
  To: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin,
	David Airlie, Daniel Vetter, Ira Weiny, Fabio M . De Francesco,
	intel-gfx, dri-devel, linux-kernel
  Cc: Dave Hansen, Zhenyu Wang, Zhao Liu

From: Zhao Liu <zhao1.liu@intel.com>

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 (the preemption is
disabled for !PREEMPT_RT case, otherwise it only disables migration).

With kmap_local_page(), we can avoid the often unwanted side effect of
unnecessary page faults or preemption disables.

In drm/i915/gem/selftests/huge_pages.c, function __cpu_check_shmem()
mainly uses mapping to flush cache and check the value. There're
2 reasons why __cpu_check_shmem() doesn't need to disable pagefaults
and preemption for mapping:

1. The flush operation is safe. Function __cpu_check_shmem() calls
drm_clflush_virt_range() to use CLFLUSHOPT or WBINVD to flush. Since
CLFLUSHOPT is global on x86 and WBINVD is called on each cpu in
drm_clflush_virt_range(), the flush operation is global.

2. Any context switch caused by preemption or page faults (page fault
may cause sleep) doesn't affect the validity of local mapping.

Therefore, __cpu_check_shmem() is a function where the use of
kmap_local_page() in place of kmap_atomic() is correctly suited.

Convert the calls of kmap_atomic() / kunmap_atomic() to
kmap_local_page() / kunmap_local().

[1]: https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com

Suggested-by: Dave Hansen <dave.hansen@intel.com>
Suggested-by: Ira Weiny <ira.weiny@intel.com>
Suggested-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
---
Suggested by credits:
  Dave: Referred to his explanation about cache flush.
  Ira: Referred to his task document, review comments and explanation
       about cache flush.
  Fabio: Referred to his boiler plate commit message and his description
         about why kmap_local_page() should be preferred.
---
 drivers/gpu/drm/i915/gem/selftests/huge_pages.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/gem/selftests/huge_pages.c b/drivers/gpu/drm/i915/gem/selftests/huge_pages.c
index 6b9f6cf50bf6..c9e6d77abab0 100644
--- a/drivers/gpu/drm/i915/gem/selftests/huge_pages.c
+++ b/drivers/gpu/drm/i915/gem/selftests/huge_pages.c
@@ -1082,7 +1082,7 @@ __cpu_check_shmem(struct drm_i915_gem_object *obj, u32 dword, u32 val)
 		goto err_unlock;
 
 	for (n = 0; n < obj->base.size >> PAGE_SHIFT; ++n) {
-		u32 *ptr = kmap_atomic(i915_gem_object_get_page(obj, n));
+		u32 *ptr = kmap_local_page(i915_gem_object_get_page(obj, n));
 
 		if (needs_flush & CLFLUSH_BEFORE)
 			drm_clflush_virt_range(ptr, PAGE_SIZE);
@@ -1090,12 +1090,12 @@ __cpu_check_shmem(struct drm_i915_gem_object *obj, u32 dword, u32 val)
 		if (ptr[dword] != val) {
 			pr_err("n=%lu ptr[%u]=%u, val=%u\n",
 			       n, dword, ptr[dword], val);
-			kunmap_atomic(ptr);
+			kunmap_local(ptr);
 			err = -EINVAL;
 			break;
 		}
 
-		kunmap_atomic(ptr);
+		kunmap_local(ptr);
 	}
 
 	i915_gem_object_finish_access(obj);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [PATCH v3 4/9] drm/i915: Use kmap_local_page() in gem/selftests/huge_pages.c
@ 2023-12-03 13:29   ` Zhao Liu
  0 siblings, 0 replies; 49+ messages in thread
From: Zhao Liu @ 2023-12-03 13:29 UTC (permalink / raw)
  To: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin,
	David Airlie, Daniel Vetter, Ira Weiny, Fabio M . De Francesco,
	intel-gfx, dri-devel, linux-kernel
  Cc: Dave Hansen, Zhao Liu, Zhenyu Wang

From: Zhao Liu <zhao1.liu@intel.com>

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 (the preemption is
disabled for !PREEMPT_RT case, otherwise it only disables migration).

With kmap_local_page(), we can avoid the often unwanted side effect of
unnecessary page faults or preemption disables.

In drm/i915/gem/selftests/huge_pages.c, function __cpu_check_shmem()
mainly uses mapping to flush cache and check the value. There're
2 reasons why __cpu_check_shmem() doesn't need to disable pagefaults
and preemption for mapping:

1. The flush operation is safe. Function __cpu_check_shmem() calls
drm_clflush_virt_range() to use CLFLUSHOPT or WBINVD to flush. Since
CLFLUSHOPT is global on x86 and WBINVD is called on each cpu in
drm_clflush_virt_range(), the flush operation is global.

2. Any context switch caused by preemption or page faults (page fault
may cause sleep) doesn't affect the validity of local mapping.

Therefore, __cpu_check_shmem() is a function where the use of
kmap_local_page() in place of kmap_atomic() is correctly suited.

Convert the calls of kmap_atomic() / kunmap_atomic() to
kmap_local_page() / kunmap_local().

[1]: https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com

Suggested-by: Dave Hansen <dave.hansen@intel.com>
Suggested-by: Ira Weiny <ira.weiny@intel.com>
Suggested-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
---
Suggested by credits:
  Dave: Referred to his explanation about cache flush.
  Ira: Referred to his task document, review comments and explanation
       about cache flush.
  Fabio: Referred to his boiler plate commit message and his description
         about why kmap_local_page() should be preferred.
---
 drivers/gpu/drm/i915/gem/selftests/huge_pages.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/gem/selftests/huge_pages.c b/drivers/gpu/drm/i915/gem/selftests/huge_pages.c
index 6b9f6cf50bf6..c9e6d77abab0 100644
--- a/drivers/gpu/drm/i915/gem/selftests/huge_pages.c
+++ b/drivers/gpu/drm/i915/gem/selftests/huge_pages.c
@@ -1082,7 +1082,7 @@ __cpu_check_shmem(struct drm_i915_gem_object *obj, u32 dword, u32 val)
 		goto err_unlock;
 
 	for (n = 0; n < obj->base.size >> PAGE_SHIFT; ++n) {
-		u32 *ptr = kmap_atomic(i915_gem_object_get_page(obj, n));
+		u32 *ptr = kmap_local_page(i915_gem_object_get_page(obj, n));
 
 		if (needs_flush & CLFLUSH_BEFORE)
 			drm_clflush_virt_range(ptr, PAGE_SIZE);
@@ -1090,12 +1090,12 @@ __cpu_check_shmem(struct drm_i915_gem_object *obj, u32 dword, u32 val)
 		if (ptr[dword] != val) {
 			pr_err("n=%lu ptr[%u]=%u, val=%u\n",
 			       n, dword, ptr[dword], val);
-			kunmap_atomic(ptr);
+			kunmap_local(ptr);
 			err = -EINVAL;
 			break;
 		}
 
-		kunmap_atomic(ptr);
+		kunmap_local(ptr);
 	}
 
 	i915_gem_object_finish_access(obj);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [Intel-gfx] [PATCH v3 4/9] drm/i915: Use kmap_local_page() in gem/selftests/huge_pages.c
@ 2023-12-03 13:29   ` Zhao Liu
  0 siblings, 0 replies; 49+ messages in thread
From: Zhao Liu @ 2023-12-03 13:29 UTC (permalink / raw)
  To: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin,
	David Airlie, Daniel Vetter, Ira Weiny, Fabio M . De Francesco,
	intel-gfx, dri-devel, linux-kernel
  Cc: Dave Hansen, Zhao Liu, Zhenyu Wang

From: Zhao Liu <zhao1.liu@intel.com>

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 (the preemption is
disabled for !PREEMPT_RT case, otherwise it only disables migration).

With kmap_local_page(), we can avoid the often unwanted side effect of
unnecessary page faults or preemption disables.

In drm/i915/gem/selftests/huge_pages.c, function __cpu_check_shmem()
mainly uses mapping to flush cache and check the value. There're
2 reasons why __cpu_check_shmem() doesn't need to disable pagefaults
and preemption for mapping:

1. The flush operation is safe. Function __cpu_check_shmem() calls
drm_clflush_virt_range() to use CLFLUSHOPT or WBINVD to flush. Since
CLFLUSHOPT is global on x86 and WBINVD is called on each cpu in
drm_clflush_virt_range(), the flush operation is global.

2. Any context switch caused by preemption or page faults (page fault
may cause sleep) doesn't affect the validity of local mapping.

Therefore, __cpu_check_shmem() is a function where the use of
kmap_local_page() in place of kmap_atomic() is correctly suited.

Convert the calls of kmap_atomic() / kunmap_atomic() to
kmap_local_page() / kunmap_local().

[1]: https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com

Suggested-by: Dave Hansen <dave.hansen@intel.com>
Suggested-by: Ira Weiny <ira.weiny@intel.com>
Suggested-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
---
Suggested by credits:
  Dave: Referred to his explanation about cache flush.
  Ira: Referred to his task document, review comments and explanation
       about cache flush.
  Fabio: Referred to his boiler plate commit message and his description
         about why kmap_local_page() should be preferred.
---
 drivers/gpu/drm/i915/gem/selftests/huge_pages.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/gem/selftests/huge_pages.c b/drivers/gpu/drm/i915/gem/selftests/huge_pages.c
index 6b9f6cf50bf6..c9e6d77abab0 100644
--- a/drivers/gpu/drm/i915/gem/selftests/huge_pages.c
+++ b/drivers/gpu/drm/i915/gem/selftests/huge_pages.c
@@ -1082,7 +1082,7 @@ __cpu_check_shmem(struct drm_i915_gem_object *obj, u32 dword, u32 val)
 		goto err_unlock;
 
 	for (n = 0; n < obj->base.size >> PAGE_SHIFT; ++n) {
-		u32 *ptr = kmap_atomic(i915_gem_object_get_page(obj, n));
+		u32 *ptr = kmap_local_page(i915_gem_object_get_page(obj, n));
 
 		if (needs_flush & CLFLUSH_BEFORE)
 			drm_clflush_virt_range(ptr, PAGE_SIZE);
@@ -1090,12 +1090,12 @@ __cpu_check_shmem(struct drm_i915_gem_object *obj, u32 dword, u32 val)
 		if (ptr[dword] != val) {
 			pr_err("n=%lu ptr[%u]=%u, val=%u\n",
 			       n, dword, ptr[dword], val);
-			kunmap_atomic(ptr);
+			kunmap_local(ptr);
 			err = -EINVAL;
 			break;
 		}
 
-		kunmap_atomic(ptr);
+		kunmap_local(ptr);
 	}
 
 	i915_gem_object_finish_access(obj);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [PATCH v3 5/9] drm/i915: Use kmap_local_page() in gem/selftests/i915_gem_coherency.c
  2023-12-03 13:29 ` Zhao Liu
  (?)
@ 2023-12-03 13:29   ` Zhao Liu
  -1 siblings, 0 replies; 49+ messages in thread
From: Zhao Liu @ 2023-12-03 13:29 UTC (permalink / raw)
  To: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin,
	David Airlie, Daniel Vetter, Ira Weiny, Fabio M . De Francesco,
	intel-gfx, dri-devel, linux-kernel
  Cc: Dave Hansen, Zhenyu Wang, Zhao Liu

From: Zhao Liu <zhao1.liu@intel.com>

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 (the preemption is
disabled for !PREEMPT_RT case, otherwise it only disables migration)..

With kmap_local_page(), we can avoid the often unwanted side effect of
unnecessary page faults or preemption disables.

In drm/i915/gem/selftests/i915_gem_coherency.c, functions cpu_set()
and cpu_get() mainly uses mapping to flush cache and assign the value.
There're 2 reasons why cpu_set() and cpu_get() don't need to disable
pagefaults and preemption for mapping:

1. The flush operation is safe. cpu_set() and cpu_get() call
drm_clflush_virt_range() to use CLFLUSHOPT or WBINVD to flush. Since
CLFLUSHOPT is global on x86 and WBINVD is called on each cpu in
drm_clflush_virt_range(), the flush operation is global.

2. Any context switch caused by preemption or page faults (page fault
may cause sleep) doesn't affect the validity of local mapping.

Therefore, cpu_set() and cpu_get() are functions where the use of
kmap_local_page() in place of kmap_atomic() is correctly suited.

Convert the calls of kmap_atomic() / kunmap_atomic() to
kmap_local_page() / kunmap_local().

[1]: https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com

Suggested-by: Dave Hansen <dave.hansen@intel.com>
Suggested-by: Ira Weiny <ira.weiny@intel.com>
Suggested-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
---
Suggested by credits:
  Dave: Referred to his explanation about cache flush.
  Ira: Referred to his task document, review comments and explanation
       about cache flush.
  Fabio: Referred to his boiler plate commit message and his description
         about why kmap_local_page() should be preferred.
---
 .../gpu/drm/i915/gem/selftests/i915_gem_coherency.c  | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/i915/gem/selftests/i915_gem_coherency.c b/drivers/gpu/drm/i915/gem/selftests/i915_gem_coherency.c
index 3bef1beec7cb..beeb3e12eccc 100644
--- a/drivers/gpu/drm/i915/gem/selftests/i915_gem_coherency.c
+++ b/drivers/gpu/drm/i915/gem/selftests/i915_gem_coherency.c
@@ -24,7 +24,6 @@ static int cpu_set(struct context *ctx, unsigned long offset, u32 v)
 {
 	unsigned int needs_clflush;
 	struct page *page;
-	void *map;
 	u32 *cpu;
 	int err;
 
@@ -34,8 +33,7 @@ static int cpu_set(struct context *ctx, unsigned long offset, u32 v)
 		goto out;
 
 	page = i915_gem_object_get_page(ctx->obj, offset >> PAGE_SHIFT);
-	map = kmap_atomic(page);
-	cpu = map + offset_in_page(offset);
+	cpu = kmap_local_page(page) + offset_in_page(offset);
 
 	if (needs_clflush & CLFLUSH_BEFORE)
 		drm_clflush_virt_range(cpu, sizeof(*cpu));
@@ -45,7 +43,7 @@ static int cpu_set(struct context *ctx, unsigned long offset, u32 v)
 	if (needs_clflush & CLFLUSH_AFTER)
 		drm_clflush_virt_range(cpu, sizeof(*cpu));
 
-	kunmap_atomic(map);
+	kunmap_local(cpu);
 	i915_gem_object_finish_access(ctx->obj);
 
 out:
@@ -57,7 +55,6 @@ static int cpu_get(struct context *ctx, unsigned long offset, u32 *v)
 {
 	unsigned int needs_clflush;
 	struct page *page;
-	void *map;
 	u32 *cpu;
 	int err;
 
@@ -67,15 +64,14 @@ static int cpu_get(struct context *ctx, unsigned long offset, u32 *v)
 		goto out;
 
 	page = i915_gem_object_get_page(ctx->obj, offset >> PAGE_SHIFT);
-	map = kmap_atomic(page);
-	cpu = map + offset_in_page(offset);
+	cpu = kmap_local_page(page) + offset_in_page(offset);
 
 	if (needs_clflush & CLFLUSH_BEFORE)
 		drm_clflush_virt_range(cpu, sizeof(*cpu));
 
 	*v = *cpu;
 
-	kunmap_atomic(map);
+	kunmap_local(cpu);
 	i915_gem_object_finish_access(ctx->obj);
 
 out:
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [PATCH v3 5/9] drm/i915: Use kmap_local_page() in gem/selftests/i915_gem_coherency.c
@ 2023-12-03 13:29   ` Zhao Liu
  0 siblings, 0 replies; 49+ messages in thread
From: Zhao Liu @ 2023-12-03 13:29 UTC (permalink / raw)
  To: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin,
	David Airlie, Daniel Vetter, Ira Weiny, Fabio M . De Francesco,
	intel-gfx, dri-devel, linux-kernel
  Cc: Dave Hansen, Zhao Liu, Zhenyu Wang

From: Zhao Liu <zhao1.liu@intel.com>

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 (the preemption is
disabled for !PREEMPT_RT case, otherwise it only disables migration)..

With kmap_local_page(), we can avoid the often unwanted side effect of
unnecessary page faults or preemption disables.

In drm/i915/gem/selftests/i915_gem_coherency.c, functions cpu_set()
and cpu_get() mainly uses mapping to flush cache and assign the value.
There're 2 reasons why cpu_set() and cpu_get() don't need to disable
pagefaults and preemption for mapping:

1. The flush operation is safe. cpu_set() and cpu_get() call
drm_clflush_virt_range() to use CLFLUSHOPT or WBINVD to flush. Since
CLFLUSHOPT is global on x86 and WBINVD is called on each cpu in
drm_clflush_virt_range(), the flush operation is global.

2. Any context switch caused by preemption or page faults (page fault
may cause sleep) doesn't affect the validity of local mapping.

Therefore, cpu_set() and cpu_get() are functions where the use of
kmap_local_page() in place of kmap_atomic() is correctly suited.

Convert the calls of kmap_atomic() / kunmap_atomic() to
kmap_local_page() / kunmap_local().

[1]: https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com

Suggested-by: Dave Hansen <dave.hansen@intel.com>
Suggested-by: Ira Weiny <ira.weiny@intel.com>
Suggested-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
---
Suggested by credits:
  Dave: Referred to his explanation about cache flush.
  Ira: Referred to his task document, review comments and explanation
       about cache flush.
  Fabio: Referred to his boiler plate commit message and his description
         about why kmap_local_page() should be preferred.
---
 .../gpu/drm/i915/gem/selftests/i915_gem_coherency.c  | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/i915/gem/selftests/i915_gem_coherency.c b/drivers/gpu/drm/i915/gem/selftests/i915_gem_coherency.c
index 3bef1beec7cb..beeb3e12eccc 100644
--- a/drivers/gpu/drm/i915/gem/selftests/i915_gem_coherency.c
+++ b/drivers/gpu/drm/i915/gem/selftests/i915_gem_coherency.c
@@ -24,7 +24,6 @@ static int cpu_set(struct context *ctx, unsigned long offset, u32 v)
 {
 	unsigned int needs_clflush;
 	struct page *page;
-	void *map;
 	u32 *cpu;
 	int err;
 
@@ -34,8 +33,7 @@ static int cpu_set(struct context *ctx, unsigned long offset, u32 v)
 		goto out;
 
 	page = i915_gem_object_get_page(ctx->obj, offset >> PAGE_SHIFT);
-	map = kmap_atomic(page);
-	cpu = map + offset_in_page(offset);
+	cpu = kmap_local_page(page) + offset_in_page(offset);
 
 	if (needs_clflush & CLFLUSH_BEFORE)
 		drm_clflush_virt_range(cpu, sizeof(*cpu));
@@ -45,7 +43,7 @@ static int cpu_set(struct context *ctx, unsigned long offset, u32 v)
 	if (needs_clflush & CLFLUSH_AFTER)
 		drm_clflush_virt_range(cpu, sizeof(*cpu));
 
-	kunmap_atomic(map);
+	kunmap_local(cpu);
 	i915_gem_object_finish_access(ctx->obj);
 
 out:
@@ -57,7 +55,6 @@ static int cpu_get(struct context *ctx, unsigned long offset, u32 *v)
 {
 	unsigned int needs_clflush;
 	struct page *page;
-	void *map;
 	u32 *cpu;
 	int err;
 
@@ -67,15 +64,14 @@ static int cpu_get(struct context *ctx, unsigned long offset, u32 *v)
 		goto out;
 
 	page = i915_gem_object_get_page(ctx->obj, offset >> PAGE_SHIFT);
-	map = kmap_atomic(page);
-	cpu = map + offset_in_page(offset);
+	cpu = kmap_local_page(page) + offset_in_page(offset);
 
 	if (needs_clflush & CLFLUSH_BEFORE)
 		drm_clflush_virt_range(cpu, sizeof(*cpu));
 
 	*v = *cpu;
 
-	kunmap_atomic(map);
+	kunmap_local(cpu);
 	i915_gem_object_finish_access(ctx->obj);
 
 out:
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [Intel-gfx] [PATCH v3 5/9] drm/i915: Use kmap_local_page() in gem/selftests/i915_gem_coherency.c
@ 2023-12-03 13:29   ` Zhao Liu
  0 siblings, 0 replies; 49+ messages in thread
From: Zhao Liu @ 2023-12-03 13:29 UTC (permalink / raw)
  To: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin,
	David Airlie, Daniel Vetter, Ira Weiny, Fabio M . De Francesco,
	intel-gfx, dri-devel, linux-kernel
  Cc: Dave Hansen, Zhao Liu, Zhenyu Wang

From: Zhao Liu <zhao1.liu@intel.com>

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 (the preemption is
disabled for !PREEMPT_RT case, otherwise it only disables migration)..

With kmap_local_page(), we can avoid the often unwanted side effect of
unnecessary page faults or preemption disables.

In drm/i915/gem/selftests/i915_gem_coherency.c, functions cpu_set()
and cpu_get() mainly uses mapping to flush cache and assign the value.
There're 2 reasons why cpu_set() and cpu_get() don't need to disable
pagefaults and preemption for mapping:

1. The flush operation is safe. cpu_set() and cpu_get() call
drm_clflush_virt_range() to use CLFLUSHOPT or WBINVD to flush. Since
CLFLUSHOPT is global on x86 and WBINVD is called on each cpu in
drm_clflush_virt_range(), the flush operation is global.

2. Any context switch caused by preemption or page faults (page fault
may cause sleep) doesn't affect the validity of local mapping.

Therefore, cpu_set() and cpu_get() are functions where the use of
kmap_local_page() in place of kmap_atomic() is correctly suited.

Convert the calls of kmap_atomic() / kunmap_atomic() to
kmap_local_page() / kunmap_local().

[1]: https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com

Suggested-by: Dave Hansen <dave.hansen@intel.com>
Suggested-by: Ira Weiny <ira.weiny@intel.com>
Suggested-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
---
Suggested by credits:
  Dave: Referred to his explanation about cache flush.
  Ira: Referred to his task document, review comments and explanation
       about cache flush.
  Fabio: Referred to his boiler plate commit message and his description
         about why kmap_local_page() should be preferred.
---
 .../gpu/drm/i915/gem/selftests/i915_gem_coherency.c  | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/i915/gem/selftests/i915_gem_coherency.c b/drivers/gpu/drm/i915/gem/selftests/i915_gem_coherency.c
index 3bef1beec7cb..beeb3e12eccc 100644
--- a/drivers/gpu/drm/i915/gem/selftests/i915_gem_coherency.c
+++ b/drivers/gpu/drm/i915/gem/selftests/i915_gem_coherency.c
@@ -24,7 +24,6 @@ static int cpu_set(struct context *ctx, unsigned long offset, u32 v)
 {
 	unsigned int needs_clflush;
 	struct page *page;
-	void *map;
 	u32 *cpu;
 	int err;
 
@@ -34,8 +33,7 @@ static int cpu_set(struct context *ctx, unsigned long offset, u32 v)
 		goto out;
 
 	page = i915_gem_object_get_page(ctx->obj, offset >> PAGE_SHIFT);
-	map = kmap_atomic(page);
-	cpu = map + offset_in_page(offset);
+	cpu = kmap_local_page(page) + offset_in_page(offset);
 
 	if (needs_clflush & CLFLUSH_BEFORE)
 		drm_clflush_virt_range(cpu, sizeof(*cpu));
@@ -45,7 +43,7 @@ static int cpu_set(struct context *ctx, unsigned long offset, u32 v)
 	if (needs_clflush & CLFLUSH_AFTER)
 		drm_clflush_virt_range(cpu, sizeof(*cpu));
 
-	kunmap_atomic(map);
+	kunmap_local(cpu);
 	i915_gem_object_finish_access(ctx->obj);
 
 out:
@@ -57,7 +55,6 @@ static int cpu_get(struct context *ctx, unsigned long offset, u32 *v)
 {
 	unsigned int needs_clflush;
 	struct page *page;
-	void *map;
 	u32 *cpu;
 	int err;
 
@@ -67,15 +64,14 @@ static int cpu_get(struct context *ctx, unsigned long offset, u32 *v)
 		goto out;
 
 	page = i915_gem_object_get_page(ctx->obj, offset >> PAGE_SHIFT);
-	map = kmap_atomic(page);
-	cpu = map + offset_in_page(offset);
+	cpu = kmap_local_page(page) + offset_in_page(offset);
 
 	if (needs_clflush & CLFLUSH_BEFORE)
 		drm_clflush_virt_range(cpu, sizeof(*cpu));
 
 	*v = *cpu;
 
-	kunmap_atomic(map);
+	kunmap_local(cpu);
 	i915_gem_object_finish_access(ctx->obj);
 
 out:
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [PATCH v3 6/9] drm/i915: Use kmap_local_page() in gem/selftests/i915_gem_context.c
  2023-12-03 13:29 ` Zhao Liu
  (?)
@ 2023-12-03 13:29   ` Zhao Liu
  -1 siblings, 0 replies; 49+ messages in thread
From: Zhao Liu @ 2023-12-03 13:29 UTC (permalink / raw)
  To: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin,
	David Airlie, Daniel Vetter, Ira Weiny, Fabio M . De Francesco,
	intel-gfx, dri-devel, linux-kernel
  Cc: Dave Hansen, Zhenyu Wang, Zhao Liu

From: Zhao Liu <zhao1.liu@intel.com>

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.

With kmap_local_page(), we can avoid the often unwanted side effect of
unnecessary page faults or preemption disables.

In drm/i915/gem/selftests/i915_gem_context.c, functions cpu_fill() and
cpu_check() mainly uses mapping to flush cache and check/assign the
value.

There're 2 reasons why cpu_fill() and cpu_check() don't need to disable
pagefaults and preemption for mapping:

1. The flush operation is safe. cpu_fill() and cpu_check() call
drm_clflush_virt_range() to use CLFLUSHOPT or WBINVD to flush. Since
CLFLUSHOPT is global on x86 and WBINVD is called on each cpu in
drm_clflush_virt_range(), the flush operation is global.

2. Any context switch caused by preemption or page faults (page fault
may cause sleep) doesn't affect the validity of local mapping.

Therefore, cpu_fill() and cpu_check() are functions where the use of
kmap_local_page() in place of kmap_atomic() is correctly suited.

Convert the calls of kmap_atomic() / kunmap_atomic() to
kmap_local_page() / kunmap_local().

[1]: https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com

Suggested-by: Dave Hansen <dave.hansen@intel.com>
Suggested-by: Ira Weiny <ira.weiny@intel.com>
Suggested-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
---
Suggested by credits:
  Dave: Referred to his explanation about cache flush.
  Ira: Referred to his task document, review comments and explanation
       about cache flush.
  Fabio: Referred to his boiler plate commit message and his description
         about why kmap_local_page() should be preferred.
---
 drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c b/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c
index 7021b6e9b219..89d4dc8b60c6 100644
--- a/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c
@@ -489,12 +489,12 @@ static int cpu_fill(struct drm_i915_gem_object *obj, u32 value)
 	for (n = 0; n < real_page_count(obj); n++) {
 		u32 *map;
 
-		map = kmap_atomic(i915_gem_object_get_page(obj, n));
+		map = kmap_local_page(i915_gem_object_get_page(obj, n));
 		for (m = 0; m < DW_PER_PAGE; m++)
 			map[m] = value;
 		if (!has_llc)
 			drm_clflush_virt_range(map, PAGE_SIZE);
-		kunmap_atomic(map);
+		kunmap_local(map);
 	}
 
 	i915_gem_object_finish_access(obj);
@@ -520,7 +520,7 @@ static noinline int cpu_check(struct drm_i915_gem_object *obj,
 	for (n = 0; n < real_page_count(obj); n++) {
 		u32 *map, m;
 
-		map = kmap_atomic(i915_gem_object_get_page(obj, n));
+		map = kmap_local_page(i915_gem_object_get_page(obj, n));
 		if (needs_flush & CLFLUSH_BEFORE)
 			drm_clflush_virt_range(map, PAGE_SIZE);
 
@@ -546,7 +546,7 @@ static noinline int cpu_check(struct drm_i915_gem_object *obj,
 		}
 
 out_unmap:
-		kunmap_atomic(map);
+		kunmap_local(map);
 		if (err)
 			break;
 	}
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [PATCH v3 6/9] drm/i915: Use kmap_local_page() in gem/selftests/i915_gem_context.c
@ 2023-12-03 13:29   ` Zhao Liu
  0 siblings, 0 replies; 49+ messages in thread
From: Zhao Liu @ 2023-12-03 13:29 UTC (permalink / raw)
  To: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin,
	David Airlie, Daniel Vetter, Ira Weiny, Fabio M . De Francesco,
	intel-gfx, dri-devel, linux-kernel
  Cc: Dave Hansen, Zhao Liu, Zhenyu Wang

From: Zhao Liu <zhao1.liu@intel.com>

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.

With kmap_local_page(), we can avoid the often unwanted side effect of
unnecessary page faults or preemption disables.

In drm/i915/gem/selftests/i915_gem_context.c, functions cpu_fill() and
cpu_check() mainly uses mapping to flush cache and check/assign the
value.

There're 2 reasons why cpu_fill() and cpu_check() don't need to disable
pagefaults and preemption for mapping:

1. The flush operation is safe. cpu_fill() and cpu_check() call
drm_clflush_virt_range() to use CLFLUSHOPT or WBINVD to flush. Since
CLFLUSHOPT is global on x86 and WBINVD is called on each cpu in
drm_clflush_virt_range(), the flush operation is global.

2. Any context switch caused by preemption or page faults (page fault
may cause sleep) doesn't affect the validity of local mapping.

Therefore, cpu_fill() and cpu_check() are functions where the use of
kmap_local_page() in place of kmap_atomic() is correctly suited.

Convert the calls of kmap_atomic() / kunmap_atomic() to
kmap_local_page() / kunmap_local().

[1]: https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com

Suggested-by: Dave Hansen <dave.hansen@intel.com>
Suggested-by: Ira Weiny <ira.weiny@intel.com>
Suggested-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
---
Suggested by credits:
  Dave: Referred to his explanation about cache flush.
  Ira: Referred to his task document, review comments and explanation
       about cache flush.
  Fabio: Referred to his boiler plate commit message and his description
         about why kmap_local_page() should be preferred.
---
 drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c b/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c
index 7021b6e9b219..89d4dc8b60c6 100644
--- a/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c
@@ -489,12 +489,12 @@ static int cpu_fill(struct drm_i915_gem_object *obj, u32 value)
 	for (n = 0; n < real_page_count(obj); n++) {
 		u32 *map;
 
-		map = kmap_atomic(i915_gem_object_get_page(obj, n));
+		map = kmap_local_page(i915_gem_object_get_page(obj, n));
 		for (m = 0; m < DW_PER_PAGE; m++)
 			map[m] = value;
 		if (!has_llc)
 			drm_clflush_virt_range(map, PAGE_SIZE);
-		kunmap_atomic(map);
+		kunmap_local(map);
 	}
 
 	i915_gem_object_finish_access(obj);
@@ -520,7 +520,7 @@ static noinline int cpu_check(struct drm_i915_gem_object *obj,
 	for (n = 0; n < real_page_count(obj); n++) {
 		u32 *map, m;
 
-		map = kmap_atomic(i915_gem_object_get_page(obj, n));
+		map = kmap_local_page(i915_gem_object_get_page(obj, n));
 		if (needs_flush & CLFLUSH_BEFORE)
 			drm_clflush_virt_range(map, PAGE_SIZE);
 
@@ -546,7 +546,7 @@ static noinline int cpu_check(struct drm_i915_gem_object *obj,
 		}
 
 out_unmap:
-		kunmap_atomic(map);
+		kunmap_local(map);
 		if (err)
 			break;
 	}
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [Intel-gfx] [PATCH v3 6/9] drm/i915: Use kmap_local_page() in gem/selftests/i915_gem_context.c
@ 2023-12-03 13:29   ` Zhao Liu
  0 siblings, 0 replies; 49+ messages in thread
From: Zhao Liu @ 2023-12-03 13:29 UTC (permalink / raw)
  To: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin,
	David Airlie, Daniel Vetter, Ira Weiny, Fabio M . De Francesco,
	intel-gfx, dri-devel, linux-kernel
  Cc: Dave Hansen, Zhao Liu, Zhenyu Wang

From: Zhao Liu <zhao1.liu@intel.com>

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.

With kmap_local_page(), we can avoid the often unwanted side effect of
unnecessary page faults or preemption disables.

In drm/i915/gem/selftests/i915_gem_context.c, functions cpu_fill() and
cpu_check() mainly uses mapping to flush cache and check/assign the
value.

There're 2 reasons why cpu_fill() and cpu_check() don't need to disable
pagefaults and preemption for mapping:

1. The flush operation is safe. cpu_fill() and cpu_check() call
drm_clflush_virt_range() to use CLFLUSHOPT or WBINVD to flush. Since
CLFLUSHOPT is global on x86 and WBINVD is called on each cpu in
drm_clflush_virt_range(), the flush operation is global.

2. Any context switch caused by preemption or page faults (page fault
may cause sleep) doesn't affect the validity of local mapping.

Therefore, cpu_fill() and cpu_check() are functions where the use of
kmap_local_page() in place of kmap_atomic() is correctly suited.

Convert the calls of kmap_atomic() / kunmap_atomic() to
kmap_local_page() / kunmap_local().

[1]: https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com

Suggested-by: Dave Hansen <dave.hansen@intel.com>
Suggested-by: Ira Weiny <ira.weiny@intel.com>
Suggested-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
---
Suggested by credits:
  Dave: Referred to his explanation about cache flush.
  Ira: Referred to his task document, review comments and explanation
       about cache flush.
  Fabio: Referred to his boiler plate commit message and his description
         about why kmap_local_page() should be preferred.
---
 drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c b/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c
index 7021b6e9b219..89d4dc8b60c6 100644
--- a/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c
@@ -489,12 +489,12 @@ static int cpu_fill(struct drm_i915_gem_object *obj, u32 value)
 	for (n = 0; n < real_page_count(obj); n++) {
 		u32 *map;
 
-		map = kmap_atomic(i915_gem_object_get_page(obj, n));
+		map = kmap_local_page(i915_gem_object_get_page(obj, n));
 		for (m = 0; m < DW_PER_PAGE; m++)
 			map[m] = value;
 		if (!has_llc)
 			drm_clflush_virt_range(map, PAGE_SIZE);
-		kunmap_atomic(map);
+		kunmap_local(map);
 	}
 
 	i915_gem_object_finish_access(obj);
@@ -520,7 +520,7 @@ static noinline int cpu_check(struct drm_i915_gem_object *obj,
 	for (n = 0; n < real_page_count(obj); n++) {
 		u32 *map, m;
 
-		map = kmap_atomic(i915_gem_object_get_page(obj, n));
+		map = kmap_local_page(i915_gem_object_get_page(obj, n));
 		if (needs_flush & CLFLUSH_BEFORE)
 			drm_clflush_virt_range(map, PAGE_SIZE);
 
@@ -546,7 +546,7 @@ static noinline int cpu_check(struct drm_i915_gem_object *obj,
 		}
 
 out_unmap:
-		kunmap_atomic(map);
+		kunmap_local(map);
 		if (err)
 			break;
 	}
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [PATCH v3 7/9] drm/i915: Use memcpy_from_page() in gt/uc/intel_uc_fw.c
  2023-12-03 13:29 ` Zhao Liu
  (?)
@ 2023-12-03 13:29   ` Zhao Liu
  -1 siblings, 0 replies; 49+ messages in thread
From: Zhao Liu @ 2023-12-03 13:29 UTC (permalink / raw)
  To: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin,
	David Airlie, Daniel Vetter, Ira Weiny, Fabio M . De Francesco,
	intel-gfx, dri-devel, linux-kernel
  Cc: Dave Hansen, Zhenyu Wang, Zhao Liu

From: Zhao Liu <zhao1.liu@intel.com>

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  (the preemption is
disabled for !PREEMPT_RT case, otherwise it only disables migration).

With kmap_local_page(), we can avoid the often unwanted side effect of
unnecessary page faults or preemption disables.

In drm/i915/gt/uc/intel_us_fw.c, the function intel_uc_fw_copy_rsa()
just use the mapping to do memory copy so it doesn't need to disable
pagefaults and preemption for mapping. Thus the local mapping without
atomic context (not disable pagefaults / preemption) is enough.

Therefore, intel_uc_fw_copy_rsa() is a function where the use of
memcpy_from_page() with kmap_local_page() in place of memcpy() with
kmap_atomic() is correctly suited.

Convert the calls of memcpy() with kmap_atomic() / kunmap_atomic() to
memcpy_from_page() which uses local mapping to copy.

[1]: https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com/T/#u

Suggested-by: Ira Weiny <ira.weiny@intel.com>
Suggested-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
---
Suggested by credits:
  Ira: Referred to his task document and suggestions about using
       memcpy_from_page() directly.
  Fabio: Referred to his boiler plate commit message and his description
         about why kmap_local_page() should be preferred.
---
 drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c b/drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c
index 362639162ed6..756093eaf2ad 100644
--- a/drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c
+++ b/drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c
@@ -1343,16 +1343,13 @@ size_t intel_uc_fw_copy_rsa(struct intel_uc_fw *uc_fw, void *dst, u32 max_len)
 
 		for_each_sgt_page(page, iter, uc_fw->obj->mm.pages) {
 			u32 len = min_t(u32, size, PAGE_SIZE - offset);
-			void *vaddr;
 
 			if (idx > 0) {
 				idx--;
 				continue;
 			}
 
-			vaddr = kmap_atomic(page);
-			memcpy(dst, vaddr + offset, len);
-			kunmap_atomic(vaddr);
+			memcpy_from_page(dst, page, offset, len);
 
 			offset = 0;
 			dst += len;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [PATCH v3 7/9] drm/i915: Use memcpy_from_page() in gt/uc/intel_uc_fw.c
@ 2023-12-03 13:29   ` Zhao Liu
  0 siblings, 0 replies; 49+ messages in thread
From: Zhao Liu @ 2023-12-03 13:29 UTC (permalink / raw)
  To: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin,
	David Airlie, Daniel Vetter, Ira Weiny, Fabio M . De Francesco,
	intel-gfx, dri-devel, linux-kernel
  Cc: Dave Hansen, Zhao Liu, Zhenyu Wang

From: Zhao Liu <zhao1.liu@intel.com>

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  (the preemption is
disabled for !PREEMPT_RT case, otherwise it only disables migration).

With kmap_local_page(), we can avoid the often unwanted side effect of
unnecessary page faults or preemption disables.

In drm/i915/gt/uc/intel_us_fw.c, the function intel_uc_fw_copy_rsa()
just use the mapping to do memory copy so it doesn't need to disable
pagefaults and preemption for mapping. Thus the local mapping without
atomic context (not disable pagefaults / preemption) is enough.

Therefore, intel_uc_fw_copy_rsa() is a function where the use of
memcpy_from_page() with kmap_local_page() in place of memcpy() with
kmap_atomic() is correctly suited.

Convert the calls of memcpy() with kmap_atomic() / kunmap_atomic() to
memcpy_from_page() which uses local mapping to copy.

[1]: https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com/T/#u

Suggested-by: Ira Weiny <ira.weiny@intel.com>
Suggested-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
---
Suggested by credits:
  Ira: Referred to his task document and suggestions about using
       memcpy_from_page() directly.
  Fabio: Referred to his boiler plate commit message and his description
         about why kmap_local_page() should be preferred.
---
 drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c b/drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c
index 362639162ed6..756093eaf2ad 100644
--- a/drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c
+++ b/drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c
@@ -1343,16 +1343,13 @@ size_t intel_uc_fw_copy_rsa(struct intel_uc_fw *uc_fw, void *dst, u32 max_len)
 
 		for_each_sgt_page(page, iter, uc_fw->obj->mm.pages) {
 			u32 len = min_t(u32, size, PAGE_SIZE - offset);
-			void *vaddr;
 
 			if (idx > 0) {
 				idx--;
 				continue;
 			}
 
-			vaddr = kmap_atomic(page);
-			memcpy(dst, vaddr + offset, len);
-			kunmap_atomic(vaddr);
+			memcpy_from_page(dst, page, offset, len);
 
 			offset = 0;
 			dst += len;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [Intel-gfx] [PATCH v3 7/9] drm/i915: Use memcpy_from_page() in gt/uc/intel_uc_fw.c
@ 2023-12-03 13:29   ` Zhao Liu
  0 siblings, 0 replies; 49+ messages in thread
From: Zhao Liu @ 2023-12-03 13:29 UTC (permalink / raw)
  To: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin,
	David Airlie, Daniel Vetter, Ira Weiny, Fabio M . De Francesco,
	intel-gfx, dri-devel, linux-kernel
  Cc: Dave Hansen, Zhao Liu, Zhenyu Wang

From: Zhao Liu <zhao1.liu@intel.com>

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  (the preemption is
disabled for !PREEMPT_RT case, otherwise it only disables migration).

With kmap_local_page(), we can avoid the often unwanted side effect of
unnecessary page faults or preemption disables.

In drm/i915/gt/uc/intel_us_fw.c, the function intel_uc_fw_copy_rsa()
just use the mapping to do memory copy so it doesn't need to disable
pagefaults and preemption for mapping. Thus the local mapping without
atomic context (not disable pagefaults / preemption) is enough.

Therefore, intel_uc_fw_copy_rsa() is a function where the use of
memcpy_from_page() with kmap_local_page() in place of memcpy() with
kmap_atomic() is correctly suited.

Convert the calls of memcpy() with kmap_atomic() / kunmap_atomic() to
memcpy_from_page() which uses local mapping to copy.

[1]: https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com/T/#u

Suggested-by: Ira Weiny <ira.weiny@intel.com>
Suggested-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
---
Suggested by credits:
  Ira: Referred to his task document and suggestions about using
       memcpy_from_page() directly.
  Fabio: Referred to his boiler plate commit message and his description
         about why kmap_local_page() should be preferred.
---
 drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c b/drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c
index 362639162ed6..756093eaf2ad 100644
--- a/drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c
+++ b/drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c
@@ -1343,16 +1343,13 @@ size_t intel_uc_fw_copy_rsa(struct intel_uc_fw *uc_fw, void *dst, u32 max_len)
 
 		for_each_sgt_page(page, iter, uc_fw->obj->mm.pages) {
 			u32 len = min_t(u32, size, PAGE_SIZE - offset);
-			void *vaddr;
 
 			if (idx > 0) {
 				idx--;
 				continue;
 			}
 
-			vaddr = kmap_atomic(page);
-			memcpy(dst, vaddr + offset, len);
-			kunmap_atomic(vaddr);
+			memcpy_from_page(dst, page, offset, len);
 
 			offset = 0;
 			dst += len;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [PATCH v3 8/9] drm/i915: Use kmap_local_page() in i915_cmd_parser.c
  2023-12-03 13:29 ` Zhao Liu
  (?)
@ 2023-12-03 13:29   ` Zhao Liu
  -1 siblings, 0 replies; 49+ messages in thread
From: Zhao Liu @ 2023-12-03 13:29 UTC (permalink / raw)
  To: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin,
	David Airlie, Daniel Vetter, Ira Weiny, Fabio M . De Francesco,
	intel-gfx, dri-devel, linux-kernel
  Cc: Dave Hansen, Zhenyu Wang, Zhao Liu

From: Zhao Liu <zhao1.liu@intel.com>

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 (the preemption is
disabled for !PREEMPT_RT case, otherwise it only disables migration).

With kmap_local_page(), we can avoid the often unwanted side effect of
unnecessary page faults and preemption disables.

There're 2 reasons why function copy_batch() doesn't need to disable
pagefaults and preemption for mapping:

1. The flush operation is safe. In i915_cmd_parser.c, copy_batch() calls
drm_clflush_virt_range() to use CLFLUSHOPT or WBINVD to flush.
Since CLFLUSHOPT is global on x86 and WBINVD is called on each cpu
in drm_clflush_virt_range(), the flush operation is global.

2. Any context switch caused by preemption or page faults (page fault
may cause sleep) doesn't affect the validity of local mapping.

Therefore, copy_batch() is a function where the use of
kmap_local_page() in place of kmap_atomic() is correctly suited.

Convert the calls of kmap_atomic() / kunmap_atomic() to
kmap_local_page() / kunmap_local().

[1]: https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com

Suggested-by: Dave Hansen <dave.hansen@intel.com>
Suggested-by: Ira Weiny <ira.weiny@intel.com>
Suggested-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
---
Suggested by credits:
  Dave: Referred to his explanation about cache flush.
  Ira: Referred to his task document, review comments and explanation
       about cache flush.
  Fabio: Referred to his boiler plate commit message and his description
         about why kmap_local_page() should be preferred.
---
 drivers/gpu/drm/i915/i915_cmd_parser.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_cmd_parser.c b/drivers/gpu/drm/i915/i915_cmd_parser.c
index ddf49c2dbb91..2905df83e180 100644
--- a/drivers/gpu/drm/i915/i915_cmd_parser.c
+++ b/drivers/gpu/drm/i915/i915_cmd_parser.c
@@ -1211,11 +1211,11 @@ static u32 *copy_batch(struct drm_i915_gem_object *dst_obj,
 		for (n = offset >> PAGE_SHIFT; remain; n++) {
 			int len = min(remain, PAGE_SIZE - x);
 
-			src = kmap_atomic(i915_gem_object_get_page(src_obj, n));
+			src = kmap_local_page(i915_gem_object_get_page(src_obj, n));
 			if (src_needs_clflush)
 				drm_clflush_virt_range(src + x, len);
 			memcpy(ptr, src + x, len);
-			kunmap_atomic(src);
+			kunmap_local(src);
 
 			ptr += len;
 			remain -= len;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [PATCH v3 8/9] drm/i915: Use kmap_local_page() in i915_cmd_parser.c
@ 2023-12-03 13:29   ` Zhao Liu
  0 siblings, 0 replies; 49+ messages in thread
From: Zhao Liu @ 2023-12-03 13:29 UTC (permalink / raw)
  To: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin,
	David Airlie, Daniel Vetter, Ira Weiny, Fabio M . De Francesco,
	intel-gfx, dri-devel, linux-kernel
  Cc: Dave Hansen, Zhao Liu, Zhenyu Wang

From: Zhao Liu <zhao1.liu@intel.com>

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 (the preemption is
disabled for !PREEMPT_RT case, otherwise it only disables migration).

With kmap_local_page(), we can avoid the often unwanted side effect of
unnecessary page faults and preemption disables.

There're 2 reasons why function copy_batch() doesn't need to disable
pagefaults and preemption for mapping:

1. The flush operation is safe. In i915_cmd_parser.c, copy_batch() calls
drm_clflush_virt_range() to use CLFLUSHOPT or WBINVD to flush.
Since CLFLUSHOPT is global on x86 and WBINVD is called on each cpu
in drm_clflush_virt_range(), the flush operation is global.

2. Any context switch caused by preemption or page faults (page fault
may cause sleep) doesn't affect the validity of local mapping.

Therefore, copy_batch() is a function where the use of
kmap_local_page() in place of kmap_atomic() is correctly suited.

Convert the calls of kmap_atomic() / kunmap_atomic() to
kmap_local_page() / kunmap_local().

[1]: https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com

Suggested-by: Dave Hansen <dave.hansen@intel.com>
Suggested-by: Ira Weiny <ira.weiny@intel.com>
Suggested-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
---
Suggested by credits:
  Dave: Referred to his explanation about cache flush.
  Ira: Referred to his task document, review comments and explanation
       about cache flush.
  Fabio: Referred to his boiler plate commit message and his description
         about why kmap_local_page() should be preferred.
---
 drivers/gpu/drm/i915/i915_cmd_parser.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_cmd_parser.c b/drivers/gpu/drm/i915/i915_cmd_parser.c
index ddf49c2dbb91..2905df83e180 100644
--- a/drivers/gpu/drm/i915/i915_cmd_parser.c
+++ b/drivers/gpu/drm/i915/i915_cmd_parser.c
@@ -1211,11 +1211,11 @@ static u32 *copy_batch(struct drm_i915_gem_object *dst_obj,
 		for (n = offset >> PAGE_SHIFT; remain; n++) {
 			int len = min(remain, PAGE_SIZE - x);
 
-			src = kmap_atomic(i915_gem_object_get_page(src_obj, n));
+			src = kmap_local_page(i915_gem_object_get_page(src_obj, n));
 			if (src_needs_clflush)
 				drm_clflush_virt_range(src + x, len);
 			memcpy(ptr, src + x, len);
-			kunmap_atomic(src);
+			kunmap_local(src);
 
 			ptr += len;
 			remain -= len;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [Intel-gfx] [PATCH v3 8/9] drm/i915: Use kmap_local_page() in i915_cmd_parser.c
@ 2023-12-03 13:29   ` Zhao Liu
  0 siblings, 0 replies; 49+ messages in thread
From: Zhao Liu @ 2023-12-03 13:29 UTC (permalink / raw)
  To: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin,
	David Airlie, Daniel Vetter, Ira Weiny, Fabio M . De Francesco,
	intel-gfx, dri-devel, linux-kernel
  Cc: Dave Hansen, Zhao Liu, Zhenyu Wang

From: Zhao Liu <zhao1.liu@intel.com>

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 (the preemption is
disabled for !PREEMPT_RT case, otherwise it only disables migration).

With kmap_local_page(), we can avoid the often unwanted side effect of
unnecessary page faults and preemption disables.

There're 2 reasons why function copy_batch() doesn't need to disable
pagefaults and preemption for mapping:

1. The flush operation is safe. In i915_cmd_parser.c, copy_batch() calls
drm_clflush_virt_range() to use CLFLUSHOPT or WBINVD to flush.
Since CLFLUSHOPT is global on x86 and WBINVD is called on each cpu
in drm_clflush_virt_range(), the flush operation is global.

2. Any context switch caused by preemption or page faults (page fault
may cause sleep) doesn't affect the validity of local mapping.

Therefore, copy_batch() is a function where the use of
kmap_local_page() in place of kmap_atomic() is correctly suited.

Convert the calls of kmap_atomic() / kunmap_atomic() to
kmap_local_page() / kunmap_local().

[1]: https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com

Suggested-by: Dave Hansen <dave.hansen@intel.com>
Suggested-by: Ira Weiny <ira.weiny@intel.com>
Suggested-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
---
Suggested by credits:
  Dave: Referred to his explanation about cache flush.
  Ira: Referred to his task document, review comments and explanation
       about cache flush.
  Fabio: Referred to his boiler plate commit message and his description
         about why kmap_local_page() should be preferred.
---
 drivers/gpu/drm/i915/i915_cmd_parser.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_cmd_parser.c b/drivers/gpu/drm/i915/i915_cmd_parser.c
index ddf49c2dbb91..2905df83e180 100644
--- a/drivers/gpu/drm/i915/i915_cmd_parser.c
+++ b/drivers/gpu/drm/i915/i915_cmd_parser.c
@@ -1211,11 +1211,11 @@ static u32 *copy_batch(struct drm_i915_gem_object *dst_obj,
 		for (n = offset >> PAGE_SHIFT; remain; n++) {
 			int len = min(remain, PAGE_SIZE - x);
 
-			src = kmap_atomic(i915_gem_object_get_page(src_obj, n));
+			src = kmap_local_page(i915_gem_object_get_page(src_obj, n));
 			if (src_needs_clflush)
 				drm_clflush_virt_range(src + x, len);
 			memcpy(ptr, src + x, len);
-			kunmap_atomic(src);
+			kunmap_local(src);
 
 			ptr += len;
 			remain -= len;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [PATCH v3 9/9] drm/i915: Use kmap_local_page() in gem/i915_gem_execbuffer.c
  2023-12-03 13:29 ` Zhao Liu
  (?)
@ 2023-12-03 13:29   ` Zhao Liu
  -1 siblings, 0 replies; 49+ messages in thread
From: Zhao Liu @ 2023-12-03 13:29 UTC (permalink / raw)
  To: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin,
	David Airlie, Daniel Vetter, Ira Weiny, Fabio M . De Francesco,
	intel-gfx, dri-devel, linux-kernel
  Cc: Dave Hansen, Zhenyu Wang, Zhao Liu

From: Zhao Liu <zhao1.liu@intel.com>

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 (the preemption is
disabled for !PREEMPT_RT case, otherwise it only disables migration).

With kmap_local_page(), we can avoid the often unwanted side effect of
unnecessary page faults and preemption disables.

In i915_gem_execbuffer.c, eb->reloc_cache.vaddr is mapped by
kmap_atomic() in eb_relocate_entry(), and is unmapped by
kunmap_atomic() in reloc_cache_reset().

And this mapping/unmapping occurs in two places: one is in
eb_relocate_vma(), and another is in eb_relocate_vma_slow().

The function eb_relocate_vma() or eb_relocate_vma_slow() doesn't
need to disable pagefaults and preemption during the above mapping/
unmapping.

So it can simply use kmap_local_page() / kunmap_local() that can
instead do the mapping / unmapping regardless of the context.

Convert the calls of kmap_atomic() / kunmap_atomic() to
kmap_local_page() / kunmap_local().

[1]: https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com

Suggested-by: Ira Weiny <ira.weiny@intel.com>
Suggested-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
---
Suggested by credits:
  Ira: Referred to his task document, review comments.
  Fabio: Referred to his boiler plate commit message and his description
         about why kmap_local_page() should be preferred.
---
 drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
index 683fd8d3151c..18b0f3117074 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
@@ -1156,7 +1156,7 @@ static void reloc_cache_unmap(struct reloc_cache *cache)
 
 	vaddr = unmask_page(cache->vaddr);
 	if (cache->vaddr & KMAP)
-		kunmap_atomic(vaddr);
+		kunmap_local(vaddr);
 	else
 		io_mapping_unmap_atomic((void __iomem *)vaddr);
 }
@@ -1172,7 +1172,7 @@ static void reloc_cache_remap(struct reloc_cache *cache,
 	if (cache->vaddr & KMAP) {
 		struct page *page = i915_gem_object_get_page(obj, cache->page);
 
-		vaddr = kmap_atomic(page);
+		vaddr = kmap_local_page(page);
 		cache->vaddr = unmask_flags(cache->vaddr) |
 			(unsigned long)vaddr;
 	} else {
@@ -1202,7 +1202,7 @@ static void reloc_cache_reset(struct reloc_cache *cache, struct i915_execbuffer
 		if (cache->vaddr & CLFLUSH_AFTER)
 			mb();
 
-		kunmap_atomic(vaddr);
+		kunmap_local(vaddr);
 		i915_gem_object_finish_access(obj);
 	} else {
 		struct i915_ggtt *ggtt = cache_to_ggtt(cache);
@@ -1234,7 +1234,7 @@ static void *reloc_kmap(struct drm_i915_gem_object *obj,
 	struct page *page;
 
 	if (cache->vaddr) {
-		kunmap_atomic(unmask_page(cache->vaddr));
+		kunmap_local(unmask_page(cache->vaddr));
 	} else {
 		unsigned int flushes;
 		int err;
@@ -1256,7 +1256,7 @@ static void *reloc_kmap(struct drm_i915_gem_object *obj,
 	if (!obj->mm.dirty)
 		set_page_dirty(page);
 
-	vaddr = kmap_atomic(page);
+	vaddr = kmap_local_page(page);
 	cache->vaddr = unmask_flags(cache->vaddr) | (unsigned long)vaddr;
 	cache->page = pageno;
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [PATCH v3 9/9] drm/i915: Use kmap_local_page() in gem/i915_gem_execbuffer.c
@ 2023-12-03 13:29   ` Zhao Liu
  0 siblings, 0 replies; 49+ messages in thread
From: Zhao Liu @ 2023-12-03 13:29 UTC (permalink / raw)
  To: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin,
	David Airlie, Daniel Vetter, Ira Weiny, Fabio M . De Francesco,
	intel-gfx, dri-devel, linux-kernel
  Cc: Dave Hansen, Zhao Liu, Zhenyu Wang

From: Zhao Liu <zhao1.liu@intel.com>

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 (the preemption is
disabled for !PREEMPT_RT case, otherwise it only disables migration).

With kmap_local_page(), we can avoid the often unwanted side effect of
unnecessary page faults and preemption disables.

In i915_gem_execbuffer.c, eb->reloc_cache.vaddr is mapped by
kmap_atomic() in eb_relocate_entry(), and is unmapped by
kunmap_atomic() in reloc_cache_reset().

And this mapping/unmapping occurs in two places: one is in
eb_relocate_vma(), and another is in eb_relocate_vma_slow().

The function eb_relocate_vma() or eb_relocate_vma_slow() doesn't
need to disable pagefaults and preemption during the above mapping/
unmapping.

So it can simply use kmap_local_page() / kunmap_local() that can
instead do the mapping / unmapping regardless of the context.

Convert the calls of kmap_atomic() / kunmap_atomic() to
kmap_local_page() / kunmap_local().

[1]: https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com

Suggested-by: Ira Weiny <ira.weiny@intel.com>
Suggested-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
---
Suggested by credits:
  Ira: Referred to his task document, review comments.
  Fabio: Referred to his boiler plate commit message and his description
         about why kmap_local_page() should be preferred.
---
 drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
index 683fd8d3151c..18b0f3117074 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
@@ -1156,7 +1156,7 @@ static void reloc_cache_unmap(struct reloc_cache *cache)
 
 	vaddr = unmask_page(cache->vaddr);
 	if (cache->vaddr & KMAP)
-		kunmap_atomic(vaddr);
+		kunmap_local(vaddr);
 	else
 		io_mapping_unmap_atomic((void __iomem *)vaddr);
 }
@@ -1172,7 +1172,7 @@ static void reloc_cache_remap(struct reloc_cache *cache,
 	if (cache->vaddr & KMAP) {
 		struct page *page = i915_gem_object_get_page(obj, cache->page);
 
-		vaddr = kmap_atomic(page);
+		vaddr = kmap_local_page(page);
 		cache->vaddr = unmask_flags(cache->vaddr) |
 			(unsigned long)vaddr;
 	} else {
@@ -1202,7 +1202,7 @@ static void reloc_cache_reset(struct reloc_cache *cache, struct i915_execbuffer
 		if (cache->vaddr & CLFLUSH_AFTER)
 			mb();
 
-		kunmap_atomic(vaddr);
+		kunmap_local(vaddr);
 		i915_gem_object_finish_access(obj);
 	} else {
 		struct i915_ggtt *ggtt = cache_to_ggtt(cache);
@@ -1234,7 +1234,7 @@ static void *reloc_kmap(struct drm_i915_gem_object *obj,
 	struct page *page;
 
 	if (cache->vaddr) {
-		kunmap_atomic(unmask_page(cache->vaddr));
+		kunmap_local(unmask_page(cache->vaddr));
 	} else {
 		unsigned int flushes;
 		int err;
@@ -1256,7 +1256,7 @@ static void *reloc_kmap(struct drm_i915_gem_object *obj,
 	if (!obj->mm.dirty)
 		set_page_dirty(page);
 
-	vaddr = kmap_atomic(page);
+	vaddr = kmap_local_page(page);
 	cache->vaddr = unmask_flags(cache->vaddr) | (unsigned long)vaddr;
 	cache->page = pageno;
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [Intel-gfx] [PATCH v3 9/9] drm/i915: Use kmap_local_page() in gem/i915_gem_execbuffer.c
@ 2023-12-03 13:29   ` Zhao Liu
  0 siblings, 0 replies; 49+ messages in thread
From: Zhao Liu @ 2023-12-03 13:29 UTC (permalink / raw)
  To: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin,
	David Airlie, Daniel Vetter, Ira Weiny, Fabio M . De Francesco,
	intel-gfx, dri-devel, linux-kernel
  Cc: Dave Hansen, Zhao Liu, Zhenyu Wang

From: Zhao Liu <zhao1.liu@intel.com>

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 (the preemption is
disabled for !PREEMPT_RT case, otherwise it only disables migration).

With kmap_local_page(), we can avoid the often unwanted side effect of
unnecessary page faults and preemption disables.

In i915_gem_execbuffer.c, eb->reloc_cache.vaddr is mapped by
kmap_atomic() in eb_relocate_entry(), and is unmapped by
kunmap_atomic() in reloc_cache_reset().

And this mapping/unmapping occurs in two places: one is in
eb_relocate_vma(), and another is in eb_relocate_vma_slow().

The function eb_relocate_vma() or eb_relocate_vma_slow() doesn't
need to disable pagefaults and preemption during the above mapping/
unmapping.

So it can simply use kmap_local_page() / kunmap_local() that can
instead do the mapping / unmapping regardless of the context.

Convert the calls of kmap_atomic() / kunmap_atomic() to
kmap_local_page() / kunmap_local().

[1]: https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com

Suggested-by: Ira Weiny <ira.weiny@intel.com>
Suggested-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
---
Suggested by credits:
  Ira: Referred to his task document, review comments.
  Fabio: Referred to his boiler plate commit message and his description
         about why kmap_local_page() should be preferred.
---
 drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
index 683fd8d3151c..18b0f3117074 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
@@ -1156,7 +1156,7 @@ static void reloc_cache_unmap(struct reloc_cache *cache)
 
 	vaddr = unmask_page(cache->vaddr);
 	if (cache->vaddr & KMAP)
-		kunmap_atomic(vaddr);
+		kunmap_local(vaddr);
 	else
 		io_mapping_unmap_atomic((void __iomem *)vaddr);
 }
@@ -1172,7 +1172,7 @@ static void reloc_cache_remap(struct reloc_cache *cache,
 	if (cache->vaddr & KMAP) {
 		struct page *page = i915_gem_object_get_page(obj, cache->page);
 
-		vaddr = kmap_atomic(page);
+		vaddr = kmap_local_page(page);
 		cache->vaddr = unmask_flags(cache->vaddr) |
 			(unsigned long)vaddr;
 	} else {
@@ -1202,7 +1202,7 @@ static void reloc_cache_reset(struct reloc_cache *cache, struct i915_execbuffer
 		if (cache->vaddr & CLFLUSH_AFTER)
 			mb();
 
-		kunmap_atomic(vaddr);
+		kunmap_local(vaddr);
 		i915_gem_object_finish_access(obj);
 	} else {
 		struct i915_ggtt *ggtt = cache_to_ggtt(cache);
@@ -1234,7 +1234,7 @@ static void *reloc_kmap(struct drm_i915_gem_object *obj,
 	struct page *page;
 
 	if (cache->vaddr) {
-		kunmap_atomic(unmask_page(cache->vaddr));
+		kunmap_local(unmask_page(cache->vaddr));
 	} else {
 		unsigned int flushes;
 		int err;
@@ -1256,7 +1256,7 @@ static void *reloc_kmap(struct drm_i915_gem_object *obj,
 	if (!obj->mm.dirty)
 		set_page_dirty(page);
 
-	vaddr = kmap_atomic(page);
+	vaddr = kmap_local_page(page);
 	cache->vaddr = unmask_flags(cache->vaddr) | (unsigned long)vaddr;
 	cache->page = pageno;
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Replace kmap_atomic() with kmap_local_page() (rev2)
  2023-12-03 13:29 ` Zhao Liu
                   ` (10 preceding siblings ...)
  (?)
@ 2023-12-03 13:59 ` Patchwork
  -1 siblings, 0 replies; 49+ messages in thread
From: Patchwork @ 2023-12-03 13:59 UTC (permalink / raw)
  To: Zhao Liu; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Replace kmap_atomic() with kmap_local_page() (rev2)
URL   : https://patchwork.freedesktop.org/series/115769/
State : warning

== Summary ==

Error: dim checkpatch failed
3dbe1fea8502 drm/i915: Use kmap_local_page() in gem/i915_gem_object.c
-:39: WARNING:COMMIT_LOG_LONG_LINE: Prefer a maximum 75 chars per line (possible unwrapped commit description?)
#39: 
[1]: https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com

-:63: ERROR:CODE_INDENT: code indent should use tabs where possible
#63: FILE: drivers/gpu/drm/i915/gem/i915_gem_object.c:506:
+^I          + offset_in_page(offset);$

total: 1 errors, 1 warnings, 0 checks, 20 lines checked
b9f8592803f4 drm/i915: Use memcpy_[from/to]_page() in gem/i915_gem_pyhs.c
-:39: WARNING:COMMIT_LOG_LONG_LINE: Prefer a maximum 75 chars per line (possible unwrapped commit description?)
#39: 
[1]: https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com

total: 0 errors, 1 warnings, 0 checks, 34 lines checked
de0a94d29e8b drm/i915: Use kmap_local_page() in gem/i915_gem_shmem.c
-:24: WARNING:COMMIT_LOG_LONG_LINE: Prefer a maximum 75 chars per line (possible unwrapped commit description?)
#24: 
[1]: https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com

total: 0 errors, 1 warnings, 0 checks, 15 lines checked
95976ec3834b drm/i915: Use kmap_local_page() in gem/selftests/huge_pages.c
-:36: WARNING:COMMIT_LOG_LONG_LINE: Prefer a maximum 75 chars per line (possible unwrapped commit description?)
#36: 
[1]: https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com

total: 0 errors, 1 warnings, 0 checks, 22 lines checked
c956111d73bd drm/i915: Use kmap_local_page() in gem/selftests/i915_gem_coherency.c
-:37: WARNING:COMMIT_LOG_LONG_LINE: Prefer a maximum 75 chars per line (possible unwrapped commit description?)
#37: 
[1]: https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com

total: 0 errors, 1 warnings, 0 checks, 48 lines checked
46aae55d8cc4 drm/i915: Use kmap_local_page() in gem/selftests/i915_gem_context.c
-:38: WARNING:COMMIT_LOG_LONG_LINE: Prefer a maximum 75 chars per line (possible unwrapped commit description?)
#38: 
[1]: https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com

total: 0 errors, 1 warnings, 0 checks, 30 lines checked
d00c94b04735 drm/i915: Use memcpy_from_page() in gt/uc/intel_uc_fw.c
-:29: WARNING:COMMIT_LOG_LONG_LINE: Prefer a maximum 75 chars per line (possible unwrapped commit description?)
#29: 
[1]: https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com/T/#u

total: 0 errors, 1 warnings, 0 checks, 17 lines checked
1b79798a46f6 drm/i915: Use kmap_local_page() in i915_cmd_parser.c
-:34: WARNING:COMMIT_LOG_LONG_LINE: Prefer a maximum 75 chars per line (possible unwrapped commit description?)
#34: 
[1]: https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com

total: 0 errors, 1 warnings, 0 checks, 13 lines checked
2383cd11b380 drm/i915: Use kmap_local_page() in gem/i915_gem_execbuffer.c
-:34: WARNING:COMMIT_LOG_LONG_LINE: Prefer a maximum 75 chars per line (possible unwrapped commit description?)
#34: 
[1]: https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com

total: 0 errors, 1 warnings, 0 checks, 40 lines checked



^ permalink raw reply	[flat|nested] 49+ messages in thread

* [Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm/i915: Replace kmap_atomic() with kmap_local_page() (rev2)
  2023-12-03 13:29 ` Zhao Liu
                   ` (11 preceding siblings ...)
  (?)
@ 2023-12-03 13:59 ` Patchwork
  -1 siblings, 0 replies; 49+ messages in thread
From: Patchwork @ 2023-12-03 13:59 UTC (permalink / raw)
  To: Zhao Liu; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Replace kmap_atomic() with kmap_local_page() (rev2)
URL   : https://patchwork.freedesktop.org/series/115769/
State : warning

== Summary ==

Error: dim sparse failed
Sparse version: v0.6.2
Fast mode used, each commit won't be checked separately.



^ permalink raw reply	[flat|nested] 49+ messages in thread

* [Intel-gfx] ✗ Fi.CI.BAT: failure for drm/i915: Replace kmap_atomic() with kmap_local_page() (rev2)
  2023-12-03 13:29 ` Zhao Liu
                   ` (12 preceding siblings ...)
  (?)
@ 2023-12-03 14:17 ` Patchwork
  -1 siblings, 0 replies; 49+ messages in thread
From: Patchwork @ 2023-12-03 14:17 UTC (permalink / raw)
  To: Zhao Liu; +Cc: intel-gfx

[-- Attachment #1: Type: text/plain, Size: 14541 bytes --]

== Series Details ==

Series: drm/i915: Replace kmap_atomic() with kmap_local_page() (rev2)
URL   : https://patchwork.freedesktop.org/series/115769/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_13965 -> Patchwork_115769v2
====================================================

Summary
-------

  **FAILURE**

  Serious unknown changes coming with Patchwork_115769v2 absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in Patchwork_115769v2, please notify your bug team (I915-ci-infra@lists.freedesktop.org) to allow them
  to document this new failure mode, which will reduce false positives in CI.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v2/index.html

Participating hosts (36 -> 33)
------------------------------

  Additional (2): bat-dg2-8 bat-dg2-9 
  Missing    (5): bat-kbl-2 bat-dg1-5 bat-adlm-1 fi-snb-2520m bat-mtlp-8 

Possible new issues
-------------------

  Here are the unknown changes that may have been introduced in Patchwork_115769v2:

### IGT changes ###

#### Possible regressions ####

  * igt@kms_flip@basic-plain-flip@c-dp5:
    - bat-adlp-11:        [PASS][1] -> [DMESG-WARN][2]
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13965/bat-adlp-11/igt@kms_flip@basic-plain-flip@c-dp5.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v2/bat-adlp-11/igt@kms_flip@basic-plain-flip@c-dp5.html

  
New tests
---------

  New tests have been introduced between CI_DRM_13965 and Patchwork_115769v2:

### New IGT tests (12) ###

  * igt@kms_pipe_crc_basic@nonblocking-crc-frame-sequence@pipe-a-dp-7:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_pipe_crc_basic@nonblocking-crc-frame-sequence@pipe-c-dp-7:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_pipe_crc_basic@nonblocking-crc-frame-sequence@pipe-d-dp-7:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_pipe_crc_basic@nonblocking-crc@pipe-a-dp-7:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_pipe_crc_basic@nonblocking-crc@pipe-c-dp-7:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_pipe_crc_basic@nonblocking-crc@pipe-d-dp-7:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_pipe_crc_basic@read-crc-frame-sequence@pipe-a-dp-7:
    - Statuses : 1 abort(s)
    - Exec time: [0.0] s

  * igt@kms_pipe_crc_basic@read-crc-frame-sequence@pipe-c-dp-7:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_pipe_crc_basic@read-crc-frame-sequence@pipe-d-dp-7:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_pipe_crc_basic@read-crc@pipe-a-dp-7:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_pipe_crc_basic@read-crc@pipe-c-dp-7:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  * igt@kms_pipe_crc_basic@read-crc@pipe-d-dp-7:
    - Statuses : 1 pass(s)
    - Exec time: [0.0] s

  

Known issues
------------

  Here are the changes found in Patchwork_115769v2 that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@gem_exec_suspend@basic-s0@lmem0:
    - bat-dg2-8:          NOTRUN -> [INCOMPLETE][3] ([i915#9275])
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v2/bat-dg2-8/igt@gem_exec_suspend@basic-s0@lmem0.html

  * igt@gem_mmap@basic:
    - bat-dg2-9:          NOTRUN -> [SKIP][4] ([i915#4083])
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v2/bat-dg2-9/igt@gem_mmap@basic.html
    - bat-dg2-8:          NOTRUN -> [SKIP][5] ([i915#4083])
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v2/bat-dg2-8/igt@gem_mmap@basic.html

  * igt@gem_mmap_gtt@basic:
    - bat-dg2-9:          NOTRUN -> [SKIP][6] ([i915#4077]) +2 other tests skip
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v2/bat-dg2-9/igt@gem_mmap_gtt@basic.html
    - bat-dg2-8:          NOTRUN -> [SKIP][7] ([i915#4077]) +2 other tests skip
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v2/bat-dg2-8/igt@gem_mmap_gtt@basic.html

  * igt@gem_render_tiled_blits@basic:
    - bat-dg2-9:          NOTRUN -> [SKIP][8] ([i915#4079]) +1 other test skip
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v2/bat-dg2-9/igt@gem_render_tiled_blits@basic.html

  * igt@gem_tiled_pread_basic:
    - bat-dg2-8:          NOTRUN -> [SKIP][9] ([i915#4079]) +1 other test skip
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v2/bat-dg2-8/igt@gem_tiled_pread_basic.html

  * igt@i915_pm_rps@basic-api:
    - bat-dg2-9:          NOTRUN -> [SKIP][10] ([i915#6621])
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v2/bat-dg2-9/igt@i915_pm_rps@basic-api.html
    - bat-dg2-8:          NOTRUN -> [SKIP][11] ([i915#6621])
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v2/bat-dg2-8/igt@i915_pm_rps@basic-api.html

  * igt@i915_suspend@basic-s3-without-i915:
    - bat-dg2-8:          NOTRUN -> [SKIP][12] ([i915#6645])
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v2/bat-dg2-8/igt@i915_suspend@basic-s3-without-i915.html

  * igt@kms_addfb_basic@addfb25-y-tiled-small-legacy:
    - bat-dg2-9:          NOTRUN -> [SKIP][13] ([i915#5190])
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v2/bat-dg2-9/igt@kms_addfb_basic@addfb25-y-tiled-small-legacy.html
    - bat-dg2-8:          NOTRUN -> [SKIP][14] ([i915#5190])
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v2/bat-dg2-8/igt@kms_addfb_basic@addfb25-y-tiled-small-legacy.html

  * igt@kms_addfb_basic@basic-y-tiled-legacy:
    - bat-dg2-9:          NOTRUN -> [SKIP][15] ([i915#4215] / [i915#5190])
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v2/bat-dg2-9/igt@kms_addfb_basic@basic-y-tiled-legacy.html
    - bat-dg2-8:          NOTRUN -> [SKIP][16] ([i915#4215] / [i915#5190])
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v2/bat-dg2-8/igt@kms_addfb_basic@basic-y-tiled-legacy.html

  * igt@kms_addfb_basic@framebuffer-vs-set-tiling:
    - bat-dg2-9:          NOTRUN -> [SKIP][17] ([i915#4212]) +6 other tests skip
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v2/bat-dg2-9/igt@kms_addfb_basic@framebuffer-vs-set-tiling.html
    - bat-dg2-8:          NOTRUN -> [SKIP][18] ([i915#4212]) +6 other tests skip
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v2/bat-dg2-8/igt@kms_addfb_basic@framebuffer-vs-set-tiling.html

  * igt@kms_addfb_basic@tile-pitch-mismatch:
    - bat-dg2-9:          NOTRUN -> [SKIP][19] ([i915#4212] / [i915#5608])
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v2/bat-dg2-9/igt@kms_addfb_basic@tile-pitch-mismatch.html
    - bat-dg2-8:          NOTRUN -> [SKIP][20] ([i915#4212] / [i915#5608])
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v2/bat-dg2-8/igt@kms_addfb_basic@tile-pitch-mismatch.html

  * igt@kms_cursor_legacy@basic-busy-flip-before-cursor-legacy:
    - bat-dg2-9:          NOTRUN -> [SKIP][21] ([i915#4103] / [i915#4213] / [i915#5608]) +1 other test skip
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v2/bat-dg2-9/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-legacy.html
    - bat-dg2-8:          NOTRUN -> [SKIP][22] ([i915#4103] / [i915#4213] / [i915#5608]) +1 other test skip
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v2/bat-dg2-8/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-legacy.html

  * igt@kms_flip@basic-flip-vs-wf_vblank@a-dp6:
    - bat-adlp-11:        [PASS][23] -> [FAIL][24] ([i915#6121]) +3 other tests fail
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13965/bat-adlp-11/igt@kms_flip@basic-flip-vs-wf_vblank@a-dp6.html
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v2/bat-adlp-11/igt@kms_flip@basic-flip-vs-wf_vblank@a-dp6.html

  * igt@kms_flip@basic-flip-vs-wf_vblank@d-dp5:
    - bat-adlp-11:        [PASS][25] -> [DMESG-WARN][26] ([i915#6868])
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13965/bat-adlp-11/igt@kms_flip@basic-flip-vs-wf_vblank@d-dp5.html
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v2/bat-adlp-11/igt@kms_flip@basic-flip-vs-wf_vblank@d-dp5.html

  * igt@kms_force_connector_basic@force-load-detect:
    - bat-dg2-9:          NOTRUN -> [SKIP][27] ([fdo#109285])
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v2/bat-dg2-9/igt@kms_force_connector_basic@force-load-detect.html
    - bat-dg2-8:          NOTRUN -> [SKIP][28] ([fdo#109285])
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v2/bat-dg2-8/igt@kms_force_connector_basic@force-load-detect.html

  * igt@kms_force_connector_basic@prune-stale-modes:
    - bat-dg2-9:          NOTRUN -> [SKIP][29] ([i915#5274])
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v2/bat-dg2-9/igt@kms_force_connector_basic@prune-stale-modes.html
    - bat-dg2-8:          NOTRUN -> [SKIP][30] ([i915#5274])
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v2/bat-dg2-8/igt@kms_force_connector_basic@prune-stale-modes.html

  * igt@kms_pipe_crc_basic@read-crc-frame-sequence@pipe-a-dp-7 (NEW):
    - bat-adlp-11:        NOTRUN -> [ABORT][31] ([i915#8668])
   [31]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v2/bat-adlp-11/igt@kms_pipe_crc_basic@read-crc-frame-sequence@pipe-a-dp-7.html

  * igt@kms_setmode@basic-clone-single-crtc:
    - bat-dg2-9:          NOTRUN -> [SKIP][32] ([i915#3555] / [i915#4098])
   [32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v2/bat-dg2-9/igt@kms_setmode@basic-clone-single-crtc.html
    - bat-dg2-8:          NOTRUN -> [SKIP][33] ([i915#3555] / [i915#4098])
   [33]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v2/bat-dg2-8/igt@kms_setmode@basic-clone-single-crtc.html

  * igt@prime_vgem@basic-fence-flip:
    - bat-dg2-9:          NOTRUN -> [SKIP][34] ([i915#3708])
   [34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v2/bat-dg2-9/igt@prime_vgem@basic-fence-flip.html
    - bat-dg2-8:          NOTRUN -> [SKIP][35] ([i915#3708])
   [35]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v2/bat-dg2-8/igt@prime_vgem@basic-fence-flip.html

  * igt@prime_vgem@basic-fence-mmap:
    - bat-dg2-8:          NOTRUN -> [SKIP][36] ([i915#3708] / [i915#4077]) +1 other test skip
   [36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v2/bat-dg2-8/igt@prime_vgem@basic-fence-mmap.html
    - bat-dg2-9:          NOTRUN -> [SKIP][37] ([i915#3708] / [i915#4077]) +1 other test skip
   [37]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v2/bat-dg2-9/igt@prime_vgem@basic-fence-mmap.html

  * igt@prime_vgem@basic-write:
    - bat-dg2-9:          NOTRUN -> [SKIP][38] ([i915#3291] / [i915#3708]) +2 other tests skip
   [38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v2/bat-dg2-9/igt@prime_vgem@basic-write.html
    - bat-dg2-8:          NOTRUN -> [SKIP][39] ([i915#3291] / [i915#3708]) +2 other tests skip
   [39]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v2/bat-dg2-8/igt@prime_vgem@basic-write.html

  
#### Possible fixes ####

  * igt@i915_selftest@live@gem_contexts:
    - bat-mtlp-6:         [DMESG-FAIL][40] -> [PASS][41]
   [40]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13965/bat-mtlp-6/igt@i915_selftest@live@gem_contexts.html
   [41]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v2/bat-mtlp-6/igt@i915_selftest@live@gem_contexts.html

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [fdo#109285]: https://bugs.freedesktop.org/show_bug.cgi?id=109285
  [i915#3291]: https://gitlab.freedesktop.org/drm/intel/issues/3291
  [i915#3555]: https://gitlab.freedesktop.org/drm/intel/issues/3555
  [i915#3708]: https://gitlab.freedesktop.org/drm/intel/issues/3708
  [i915#4077]: https://gitlab.freedesktop.org/drm/intel/issues/4077
  [i915#4079]: https://gitlab.freedesktop.org/drm/intel/issues/4079
  [i915#4083]: https://gitlab.freedesktop.org/drm/intel/issues/4083
  [i915#4098]: https://gitlab.freedesktop.org/drm/intel/issues/4098
  [i915#4103]: https://gitlab.freedesktop.org/drm/intel/issues/4103
  [i915#4212]: https://gitlab.freedesktop.org/drm/intel/issues/4212
  [i915#4213]: https://gitlab.freedesktop.org/drm/intel/issues/4213
  [i915#4215]: https://gitlab.freedesktop.org/drm/intel/issues/4215
  [i915#5190]: https://gitlab.freedesktop.org/drm/intel/issues/5190
  [i915#5274]: https://gitlab.freedesktop.org/drm/intel/issues/5274
  [i915#5354]: https://gitlab.freedesktop.org/drm/intel/issues/5354
  [i915#5608]: https://gitlab.freedesktop.org/drm/intel/issues/5608
  [i915#6121]: https://gitlab.freedesktop.org/drm/intel/issues/6121
  [i915#6621]: https://gitlab.freedesktop.org/drm/intel/issues/6621
  [i915#6645]: https://gitlab.freedesktop.org/drm/intel/issues/6645
  [i915#6868]: https://gitlab.freedesktop.org/drm/intel/issues/6868
  [i915#8668]: https://gitlab.freedesktop.org/drm/intel/issues/8668
  [i915#9275]: https://gitlab.freedesktop.org/drm/intel/issues/9275
  [i915#9673]: https://gitlab.freedesktop.org/drm/intel/issues/9673
  [i915#9736]: https://gitlab.freedesktop.org/drm/intel/issues/9736


Build changes
-------------

  * Linux: CI_DRM_13965 -> Patchwork_115769v2

  CI-20190529: 20190529
  CI_DRM_13965: 7e0f4ea15ba144560df44985a89943ff9a36de9f @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_7614: c7298ec108dc1c861c9a2593e973648ad9b420b4 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
  Patchwork_115769v2: 7e0f4ea15ba144560df44985a89943ff9a36de9f @ git://anongit.freedesktop.org/gfx-ci/linux


### Linux commits

2fde9ceafb2f drm/i915: Use kmap_local_page() in gem/i915_gem_execbuffer.c
0de2844eef82 drm/i915: Use kmap_local_page() in i915_cmd_parser.c
f8e0fcd919e4 drm/i915: Use memcpy_from_page() in gt/uc/intel_uc_fw.c
6f02e524b9ef drm/i915: Use kmap_local_page() in gem/selftests/i915_gem_context.c
5d0b66318378 drm/i915: Use kmap_local_page() in gem/selftests/i915_gem_coherency.c
aa79f3dd2777 drm/i915: Use kmap_local_page() in gem/selftests/huge_pages.c
3db16b5206a1 drm/i915: Use kmap_local_page() in gem/i915_gem_shmem.c
2b37a8b169ab drm/i915: Use memcpy_[from/to]_page() in gem/i915_gem_pyhs.c
102d3891a69b drm/i915: Use kmap_local_page() in gem/i915_gem_object.c

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v2/index.html

[-- Attachment #2: Type: text/html, Size: 18109 bytes --]

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [PATCH v3 0/9] drm/i915: Replace kmap_atomic() with kmap_local_page()
  2023-12-03 13:29 ` Zhao Liu
@ 2023-12-14 13:19   ` Zhao Liu
  -1 siblings, 0 replies; 49+ messages in thread
From: Zhao Liu @ 2023-12-14 13:19 UTC (permalink / raw)
  To: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin,
	David Airlie, Daniel Vetter, Ira Weiny, Fabio M . De Francesco,
	intel-gfx, dri-devel, linux-kernel
  Cc: Dave Hansen, Zhenyu Wang, 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 <zhao1.liu@linux.intel.com>
> Subject: [PATCH v3 0/9] drm/i915: Replace kmap_atomic() with
>  kmap_local_page()
> X-Mailer: git-send-email 2.34.1
> 
> From: Zhao Liu <zhao1.liu@intel.com>
> 
> 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 code change in v3.
> 
> Thanks for all the review! And sorry v2 was missed, I'll pay more
> attention to this v3.
> 
> 
> Purpose of This Patchset
> ========================
> 
> The purpose of this pacthset is to replace all uses of kmap_atomic() in
> i915 with kmap_local_page() because the use of kmap_atomic() is being
> deprecated in favor of kmap_local_page()[2]. And 92b64bd (mm/highmem:
> add notes about conversions from kmap{,_atomic}()) has declared the
> deprecation of kmap_atomic().
> 
> 
> Motivation for Deprecating kmap_atomic() and Using kmap_local_page()
> ====================================================================
> 
> 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 migration).
> 
> With kmap_local_page(), we can avoid the often unwanted side effect of
> unnecessary page faults and preemption disables.
> 
> 
> Patch summary
> =============
> 
> Patch 1, 4-6 and 8-9 replace kmap_atomic()/kunmap_atomic() with
>         kmap_local_page()/kunmap_local() directly. With these local
>         mappings, the page faults and preemption are allowed.
> 
> Patch 2 and 7 use memcpy_from_page() and memcpy_to_page() to replace
>         kmap_atomic()/kunmap_atomic(). These two variants of memcpy()
>         are based on the local mapping, so page faults and preemption
>         are also allowed in these two interfaces.
> 
> Patch 3 replaces kmap_atomic()/kunmap_atomic() with kmap_local_page()/
>         kunmap_local() and also disable page fault since the for special
>         handling (pls see the commit message).
> 
> 
> Reference
> =========
> 
> [1]: https://lore.kernel.org/all/20230329073220.3982460-1-zhao1.liu@linux.intel.com/
> [2]: https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com
> 
> 
> Thanks and Best Regards,
> Zhao
> 
> ---
> Changlog:
> 
> Changes since v2:
> * Rebased on 968f35f4ab1c ("Merge tag 'v6.7-rc3-smb3-client-fixes' of
>   git://git.samba.org/sfrench/cifs-2.6").
> * Removed changelog (of v2) in commit message.
> * Fixed typo in cover letter (Fabio).
> * Added Reviewed-by tags from Ira and Fabio.
> 
> Changes since v1:
> * Dropped hot plug related description in commit message since it has
>   nothing to do with kmap_local_page().
> * Emphasized the motivation for using kmap_local_page() in commit
>   message.
> * Rebased patch 1 on f47e630 (drm/i915/gem: Typecheck page lookups) to
>   keep the "idx" variable of type pgoff_t here.
> * Used memcpy_from_page() and memcpy_to_page() to replace
>   kmap_local_page() + memcpy() in patch 2.
> 
> ---
> Zhao Liu (9):
>   drm/i915: Use kmap_local_page() in gem/i915_gem_object.c
>   drm/i915: Use memcpy_[from/to]_page() in gem/i915_gem_pyhs.c
>   drm/i915: Use kmap_local_page() in gem/i915_gem_shmem.c
>   drm/i915: Use kmap_local_page() in gem/selftests/huge_pages.c
>   drm/i915: Use kmap_local_page() in gem/selftests/i915_gem_coherency.c
>   drm/i915: Use kmap_local_page() in gem/selftests/i915_gem_context.c
>   drm/i915: Use memcpy_from_page() in gt/uc/intel_uc_fw.c
>   drm/i915: Use kmap_local_page() in i915_cmd_parser.c
>   drm/i915: Use kmap_local_page() in gem/i915_gem_execbuffer.c
> 
>  drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c       | 10 +++++-----
>  drivers/gpu/drm/i915/gem/i915_gem_object.c           |  8 +++-----
>  drivers/gpu/drm/i915/gem/i915_gem_phys.c             | 10 ++--------
>  drivers/gpu/drm/i915/gem/i915_gem_shmem.c            |  6 ++++--
>  drivers/gpu/drm/i915/gem/selftests/huge_pages.c      |  6 +++---
>  .../gpu/drm/i915/gem/selftests/i915_gem_coherency.c  | 12 ++++--------
>  .../gpu/drm/i915/gem/selftests/i915_gem_context.c    |  8 ++++----
>  drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c             |  5 +----
>  drivers/gpu/drm/i915/i915_cmd_parser.c               |  4 ++--
>  9 files changed, 28 insertions(+), 41 deletions(-)
> 
> -- 
> 2.34.1
> 

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [PATCH v3 0/9] drm/i915: Replace kmap_atomic() with kmap_local_page()
@ 2023-12-14 13:19   ` Zhao Liu
  0 siblings, 0 replies; 49+ messages in thread
From: Zhao Liu @ 2023-12-14 13:19 UTC (permalink / raw)
  To: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin,
	David Airlie, Daniel Vetter, Ira Weiny, Fabio M . De Francesco,
	intel-gfx, dri-devel, linux-kernel
  Cc: Dave Hansen, Zhao Liu, Zhenyu Wang

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 <zhao1.liu@linux.intel.com>
> Subject: [PATCH v3 0/9] drm/i915: Replace kmap_atomic() with
>  kmap_local_page()
> X-Mailer: git-send-email 2.34.1
> 
> From: Zhao Liu <zhao1.liu@intel.com>
> 
> 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 code change in v3.
> 
> Thanks for all the review! And sorry v2 was missed, I'll pay more
> attention to this v3.
> 
> 
> Purpose of This Patchset
> ========================
> 
> The purpose of this pacthset is to replace all uses of kmap_atomic() in
> i915 with kmap_local_page() because the use of kmap_atomic() is being
> deprecated in favor of kmap_local_page()[2]. And 92b64bd (mm/highmem:
> add notes about conversions from kmap{,_atomic}()) has declared the
> deprecation of kmap_atomic().
> 
> 
> Motivation for Deprecating kmap_atomic() and Using kmap_local_page()
> ====================================================================
> 
> 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 migration).
> 
> With kmap_local_page(), we can avoid the often unwanted side effect of
> unnecessary page faults and preemption disables.
> 
> 
> Patch summary
> =============
> 
> Patch 1, 4-6 and 8-9 replace kmap_atomic()/kunmap_atomic() with
>         kmap_local_page()/kunmap_local() directly. With these local
>         mappings, the page faults and preemption are allowed.
> 
> Patch 2 and 7 use memcpy_from_page() and memcpy_to_page() to replace
>         kmap_atomic()/kunmap_atomic(). These two variants of memcpy()
>         are based on the local mapping, so page faults and preemption
>         are also allowed in these two interfaces.
> 
> Patch 3 replaces kmap_atomic()/kunmap_atomic() with kmap_local_page()/
>         kunmap_local() and also disable page fault since the for special
>         handling (pls see the commit message).
> 
> 
> Reference
> =========
> 
> [1]: https://lore.kernel.org/all/20230329073220.3982460-1-zhao1.liu@linux.intel.com/
> [2]: https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com
> 
> 
> Thanks and Best Regards,
> Zhao
> 
> ---
> Changlog:
> 
> Changes since v2:
> * Rebased on 968f35f4ab1c ("Merge tag 'v6.7-rc3-smb3-client-fixes' of
>   git://git.samba.org/sfrench/cifs-2.6").
> * Removed changelog (of v2) in commit message.
> * Fixed typo in cover letter (Fabio).
> * Added Reviewed-by tags from Ira and Fabio.
> 
> Changes since v1:
> * Dropped hot plug related description in commit message since it has
>   nothing to do with kmap_local_page().
> * Emphasized the motivation for using kmap_local_page() in commit
>   message.
> * Rebased patch 1 on f47e630 (drm/i915/gem: Typecheck page lookups) to
>   keep the "idx" variable of type pgoff_t here.
> * Used memcpy_from_page() and memcpy_to_page() to replace
>   kmap_local_page() + memcpy() in patch 2.
> 
> ---
> Zhao Liu (9):
>   drm/i915: Use kmap_local_page() in gem/i915_gem_object.c
>   drm/i915: Use memcpy_[from/to]_page() in gem/i915_gem_pyhs.c
>   drm/i915: Use kmap_local_page() in gem/i915_gem_shmem.c
>   drm/i915: Use kmap_local_page() in gem/selftests/huge_pages.c
>   drm/i915: Use kmap_local_page() in gem/selftests/i915_gem_coherency.c
>   drm/i915: Use kmap_local_page() in gem/selftests/i915_gem_context.c
>   drm/i915: Use memcpy_from_page() in gt/uc/intel_uc_fw.c
>   drm/i915: Use kmap_local_page() in i915_cmd_parser.c
>   drm/i915: Use kmap_local_page() in gem/i915_gem_execbuffer.c
> 
>  drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c       | 10 +++++-----
>  drivers/gpu/drm/i915/gem/i915_gem_object.c           |  8 +++-----
>  drivers/gpu/drm/i915/gem/i915_gem_phys.c             | 10 ++--------
>  drivers/gpu/drm/i915/gem/i915_gem_shmem.c            |  6 ++++--
>  drivers/gpu/drm/i915/gem/selftests/huge_pages.c      |  6 +++---
>  .../gpu/drm/i915/gem/selftests/i915_gem_coherency.c  | 12 ++++--------
>  .../gpu/drm/i915/gem/selftests/i915_gem_context.c    |  8 ++++----
>  drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c             |  5 +----
>  drivers/gpu/drm/i915/i915_cmd_parser.c               |  4 ++--
>  9 files changed, 28 insertions(+), 41 deletions(-)
> 
> -- 
> 2.34.1
> 

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [PATCH v3 0/9] drm/i915: Replace kmap_atomic() with kmap_local_page()
  2023-12-14 13:19   ` Zhao Liu
@ 2023-12-14 13:45     ` Tvrtko Ursulin
  -1 siblings, 0 replies; 49+ messages in thread
From: Tvrtko Ursulin @ 2023-12-14 13:45 UTC (permalink / raw)
  To: Zhao Liu, Jani Nikula, Joonas Lahtinen, Rodrigo Vivi,
	David Airlie, Daniel Vetter, Ira Weiny, Fabio M . De Francesco,
	intel-gfx, dri-devel, linux-kernel
  Cc: Dave Hansen, Zhenyu Wang, Zhao Liu


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 certainly spotted your series last week or so but then it slipped my 
mind to go through it. Should be able to go through it today or tomorrow.

Regards,

Tvrtko

> 
> 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 <zhao1.liu@linux.intel.com>
>> Subject: [PATCH v3 0/9] drm/i915: Replace kmap_atomic() with
>>   kmap_local_page()
>> X-Mailer: git-send-email 2.34.1
>>
>> From: Zhao Liu <zhao1.liu@intel.com>
>>
>> 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 code change in v3.
>>
>> Thanks for all the review! And sorry v2 was missed, I'll pay more
>> attention to this v3.
>>
>>
>> Purpose of This Patchset
>> ========================
>>
>> The purpose of this pacthset is to replace all uses of kmap_atomic() in
>> i915 with kmap_local_page() because the use of kmap_atomic() is being
>> deprecated in favor of kmap_local_page()[2]. And 92b64bd (mm/highmem:
>> add notes about conversions from kmap{,_atomic}()) has declared the
>> deprecation of kmap_atomic().
>>
>>
>> Motivation for Deprecating kmap_atomic() and Using kmap_local_page()
>> ====================================================================
>>
>> 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 migration).
>>
>> With kmap_local_page(), we can avoid the often unwanted side effect of
>> unnecessary page faults and preemption disables.
>>
>>
>> Patch summary
>> =============
>>
>> Patch 1, 4-6 and 8-9 replace kmap_atomic()/kunmap_atomic() with
>>          kmap_local_page()/kunmap_local() directly. With these local
>>          mappings, the page faults and preemption are allowed.
>>
>> Patch 2 and 7 use memcpy_from_page() and memcpy_to_page() to replace
>>          kmap_atomic()/kunmap_atomic(). These two variants of memcpy()
>>          are based on the local mapping, so page faults and preemption
>>          are also allowed in these two interfaces.
>>
>> Patch 3 replaces kmap_atomic()/kunmap_atomic() with kmap_local_page()/
>>          kunmap_local() and also disable page fault since the for special
>>          handling (pls see the commit message).
>>
>>
>> Reference
>> =========
>>
>> [1]: https://lore.kernel.org/all/20230329073220.3982460-1-zhao1.liu@linux.intel.com/
>> [2]: https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com
>>
>>
>> Thanks and Best Regards,
>> Zhao
>>
>> ---
>> Changlog:
>>
>> Changes since v2:
>> * Rebased on 968f35f4ab1c ("Merge tag 'v6.7-rc3-smb3-client-fixes' of
>>    git://git.samba.org/sfrench/cifs-2.6").
>> * Removed changelog (of v2) in commit message.
>> * Fixed typo in cover letter (Fabio).
>> * Added Reviewed-by tags from Ira and Fabio.
>>
>> Changes since v1:
>> * Dropped hot plug related description in commit message since it has
>>    nothing to do with kmap_local_page().
>> * Emphasized the motivation for using kmap_local_page() in commit
>>    message.
>> * Rebased patch 1 on f47e630 (drm/i915/gem: Typecheck page lookups) to
>>    keep the "idx" variable of type pgoff_t here.
>> * Used memcpy_from_page() and memcpy_to_page() to replace
>>    kmap_local_page() + memcpy() in patch 2.
>>
>> ---
>> Zhao Liu (9):
>>    drm/i915: Use kmap_local_page() in gem/i915_gem_object.c
>>    drm/i915: Use memcpy_[from/to]_page() in gem/i915_gem_pyhs.c
>>    drm/i915: Use kmap_local_page() in gem/i915_gem_shmem.c
>>    drm/i915: Use kmap_local_page() in gem/selftests/huge_pages.c
>>    drm/i915: Use kmap_local_page() in gem/selftests/i915_gem_coherency.c
>>    drm/i915: Use kmap_local_page() in gem/selftests/i915_gem_context.c
>>    drm/i915: Use memcpy_from_page() in gt/uc/intel_uc_fw.c
>>    drm/i915: Use kmap_local_page() in i915_cmd_parser.c
>>    drm/i915: Use kmap_local_page() in gem/i915_gem_execbuffer.c
>>
>>   drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c       | 10 +++++-----
>>   drivers/gpu/drm/i915/gem/i915_gem_object.c           |  8 +++-----
>>   drivers/gpu/drm/i915/gem/i915_gem_phys.c             | 10 ++--------
>>   drivers/gpu/drm/i915/gem/i915_gem_shmem.c            |  6 ++++--
>>   drivers/gpu/drm/i915/gem/selftests/huge_pages.c      |  6 +++---
>>   .../gpu/drm/i915/gem/selftests/i915_gem_coherency.c  | 12 ++++--------
>>   .../gpu/drm/i915/gem/selftests/i915_gem_context.c    |  8 ++++----
>>   drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c             |  5 +----
>>   drivers/gpu/drm/i915/i915_cmd_parser.c               |  4 ++--
>>   9 files changed, 28 insertions(+), 41 deletions(-)
>>
>> -- 
>> 2.34.1
>>

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [PATCH v3 0/9] drm/i915: Replace kmap_atomic() with kmap_local_page()
@ 2023-12-14 13:45     ` Tvrtko Ursulin
  0 siblings, 0 replies; 49+ messages in thread
From: Tvrtko Ursulin @ 2023-12-14 13:45 UTC (permalink / raw)
  To: Zhao Liu, Jani Nikula, Joonas Lahtinen, Rodrigo Vivi,
	David Airlie, Daniel Vetter, Ira Weiny, Fabio M . De Francesco,
	intel-gfx, dri-devel, linux-kernel
  Cc: Dave Hansen, Zhao Liu, Zhenyu Wang


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 certainly spotted your series last week or so but then it slipped my 
mind to go through it. Should be able to go through it today or tomorrow.

Regards,

Tvrtko

> 
> 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 <zhao1.liu@linux.intel.com>
>> Subject: [PATCH v3 0/9] drm/i915: Replace kmap_atomic() with
>>   kmap_local_page()
>> X-Mailer: git-send-email 2.34.1
>>
>> From: Zhao Liu <zhao1.liu@intel.com>
>>
>> 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 code change in v3.
>>
>> Thanks for all the review! And sorry v2 was missed, I'll pay more
>> attention to this v3.
>>
>>
>> Purpose of This Patchset
>> ========================
>>
>> The purpose of this pacthset is to replace all uses of kmap_atomic() in
>> i915 with kmap_local_page() because the use of kmap_atomic() is being
>> deprecated in favor of kmap_local_page()[2]. And 92b64bd (mm/highmem:
>> add notes about conversions from kmap{,_atomic}()) has declared the
>> deprecation of kmap_atomic().
>>
>>
>> Motivation for Deprecating kmap_atomic() and Using kmap_local_page()
>> ====================================================================
>>
>> 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 migration).
>>
>> With kmap_local_page(), we can avoid the often unwanted side effect of
>> unnecessary page faults and preemption disables.
>>
>>
>> Patch summary
>> =============
>>
>> Patch 1, 4-6 and 8-9 replace kmap_atomic()/kunmap_atomic() with
>>          kmap_local_page()/kunmap_local() directly. With these local
>>          mappings, the page faults and preemption are allowed.
>>
>> Patch 2 and 7 use memcpy_from_page() and memcpy_to_page() to replace
>>          kmap_atomic()/kunmap_atomic(). These two variants of memcpy()
>>          are based on the local mapping, so page faults and preemption
>>          are also allowed in these two interfaces.
>>
>> Patch 3 replaces kmap_atomic()/kunmap_atomic() with kmap_local_page()/
>>          kunmap_local() and also disable page fault since the for special
>>          handling (pls see the commit message).
>>
>>
>> Reference
>> =========
>>
>> [1]: https://lore.kernel.org/all/20230329073220.3982460-1-zhao1.liu@linux.intel.com/
>> [2]: https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com
>>
>>
>> Thanks and Best Regards,
>> Zhao
>>
>> ---
>> Changlog:
>>
>> Changes since v2:
>> * Rebased on 968f35f4ab1c ("Merge tag 'v6.7-rc3-smb3-client-fixes' of
>>    git://git.samba.org/sfrench/cifs-2.6").
>> * Removed changelog (of v2) in commit message.
>> * Fixed typo in cover letter (Fabio).
>> * Added Reviewed-by tags from Ira and Fabio.
>>
>> Changes since v1:
>> * Dropped hot plug related description in commit message since it has
>>    nothing to do with kmap_local_page().
>> * Emphasized the motivation for using kmap_local_page() in commit
>>    message.
>> * Rebased patch 1 on f47e630 (drm/i915/gem: Typecheck page lookups) to
>>    keep the "idx" variable of type pgoff_t here.
>> * Used memcpy_from_page() and memcpy_to_page() to replace
>>    kmap_local_page() + memcpy() in patch 2.
>>
>> ---
>> Zhao Liu (9):
>>    drm/i915: Use kmap_local_page() in gem/i915_gem_object.c
>>    drm/i915: Use memcpy_[from/to]_page() in gem/i915_gem_pyhs.c
>>    drm/i915: Use kmap_local_page() in gem/i915_gem_shmem.c
>>    drm/i915: Use kmap_local_page() in gem/selftests/huge_pages.c
>>    drm/i915: Use kmap_local_page() in gem/selftests/i915_gem_coherency.c
>>    drm/i915: Use kmap_local_page() in gem/selftests/i915_gem_context.c
>>    drm/i915: Use memcpy_from_page() in gt/uc/intel_uc_fw.c
>>    drm/i915: Use kmap_local_page() in i915_cmd_parser.c
>>    drm/i915: Use kmap_local_page() in gem/i915_gem_execbuffer.c
>>
>>   drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c       | 10 +++++-----
>>   drivers/gpu/drm/i915/gem/i915_gem_object.c           |  8 +++-----
>>   drivers/gpu/drm/i915/gem/i915_gem_phys.c             | 10 ++--------
>>   drivers/gpu/drm/i915/gem/i915_gem_shmem.c            |  6 ++++--
>>   drivers/gpu/drm/i915/gem/selftests/huge_pages.c      |  6 +++---
>>   .../gpu/drm/i915/gem/selftests/i915_gem_coherency.c  | 12 ++++--------
>>   .../gpu/drm/i915/gem/selftests/i915_gem_context.c    |  8 ++++----
>>   drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c             |  5 +----
>>   drivers/gpu/drm/i915/i915_cmd_parser.c               |  4 ++--
>>   9 files changed, 28 insertions(+), 41 deletions(-)
>>
>> -- 
>> 2.34.1
>>

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [PATCH v3 0/9] drm/i915: Replace kmap_atomic() with kmap_local_page()
  2023-12-14 13:45     ` Tvrtko Ursulin
@ 2023-12-14 14:35       ` Tvrtko Ursulin
  -1 siblings, 0 replies; 49+ messages in thread
From: Tvrtko Ursulin @ 2023-12-14 14:35 UTC (permalink / raw)
  To: Zhao Liu, Jani Nikula, Joonas Lahtinen, Rodrigo Vivi,
	David Airlie, Daniel Vetter, Ira Weiny, Fabio M . De Francesco,
	intel-gfx, dri-devel, linux-kernel
  Cc: Dave Hansen, Zhenyu Wang, Zhao Liu


On 14/12/2023 13:45, Tvrtko Ursulin wrote:
> 
> 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 certainly spotted your series last week or so but then it slipped my 
> mind to go through it. Should be able to go through it today or tomorrow.

It all looks good to me. I only needed to queue a re-test in our CI 
since v3 failed BAT, but pretty sure it wasn't at fault. Once I am 
satisfied with the results I will merge the series. Thanks for the 
cleanups and your patience!

Regards,

Tvrtko


> Regards,
> 
> Tvrtko
> 
>>
>> 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 <zhao1.liu@linux.intel.com>
>>> Subject: [PATCH v3 0/9] drm/i915: Replace kmap_atomic() with
>>>   kmap_local_page()
>>> X-Mailer: git-send-email 2.34.1
>>>
>>> From: Zhao Liu <zhao1.liu@intel.com>
>>>
>>> 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 code change in v3.
>>>
>>> Thanks for all the review! And sorry v2 was missed, I'll pay more
>>> attention to this v3.
>>>
>>>
>>> Purpose of This Patchset
>>> ========================
>>>
>>> The purpose of this pacthset is to replace all uses of kmap_atomic() in
>>> i915 with kmap_local_page() because the use of kmap_atomic() is being
>>> deprecated in favor of kmap_local_page()[2]. And 92b64bd (mm/highmem:
>>> add notes about conversions from kmap{,_atomic}()) has declared the
>>> deprecation of kmap_atomic().
>>>
>>>
>>> Motivation for Deprecating kmap_atomic() and Using kmap_local_page()
>>> ====================================================================
>>>
>>> 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 migration).
>>>
>>> With kmap_local_page(), we can avoid the often unwanted side effect of
>>> unnecessary page faults and preemption disables.
>>>
>>>
>>> Patch summary
>>> =============
>>>
>>> Patch 1, 4-6 and 8-9 replace kmap_atomic()/kunmap_atomic() with
>>>          kmap_local_page()/kunmap_local() directly. With these local
>>>          mappings, the page faults and preemption are allowed.
>>>
>>> Patch 2 and 7 use memcpy_from_page() and memcpy_to_page() to replace
>>>          kmap_atomic()/kunmap_atomic(). These two variants of memcpy()
>>>          are based on the local mapping, so page faults and preemption
>>>          are also allowed in these two interfaces.
>>>
>>> Patch 3 replaces kmap_atomic()/kunmap_atomic() with kmap_local_page()/
>>>          kunmap_local() and also disable page fault since the for 
>>> special
>>>          handling (pls see the commit message).
>>>
>>>
>>> Reference
>>> =========
>>>
>>> [1]: 
>>> https://lore.kernel.org/all/20230329073220.3982460-1-zhao1.liu@linux.intel.com/
>>> [2]: 
>>> https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com
>>>
>>>
>>> Thanks and Best Regards,
>>> Zhao
>>>
>>> ---
>>> Changlog:
>>>
>>> Changes since v2:
>>> * Rebased on 968f35f4ab1c ("Merge tag 'v6.7-rc3-smb3-client-fixes' of
>>>    git://git.samba.org/sfrench/cifs-2.6").
>>> * Removed changelog (of v2) in commit message.
>>> * Fixed typo in cover letter (Fabio).
>>> * Added Reviewed-by tags from Ira and Fabio.
>>>
>>> Changes since v1:
>>> * Dropped hot plug related description in commit message since it has
>>>    nothing to do with kmap_local_page().
>>> * Emphasized the motivation for using kmap_local_page() in commit
>>>    message.
>>> * Rebased patch 1 on f47e630 (drm/i915/gem: Typecheck page lookups) to
>>>    keep the "idx" variable of type pgoff_t here.
>>> * Used memcpy_from_page() and memcpy_to_page() to replace
>>>    kmap_local_page() + memcpy() in patch 2.
>>>
>>> ---
>>> Zhao Liu (9):
>>>    drm/i915: Use kmap_local_page() in gem/i915_gem_object.c
>>>    drm/i915: Use memcpy_[from/to]_page() in gem/i915_gem_pyhs.c
>>>    drm/i915: Use kmap_local_page() in gem/i915_gem_shmem.c
>>>    drm/i915: Use kmap_local_page() in gem/selftests/huge_pages.c
>>>    drm/i915: Use kmap_local_page() in gem/selftests/i915_gem_coherency.c
>>>    drm/i915: Use kmap_local_page() in gem/selftests/i915_gem_context.c
>>>    drm/i915: Use memcpy_from_page() in gt/uc/intel_uc_fw.c
>>>    drm/i915: Use kmap_local_page() in i915_cmd_parser.c
>>>    drm/i915: Use kmap_local_page() in gem/i915_gem_execbuffer.c
>>>
>>>   drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c       | 10 +++++-----
>>>   drivers/gpu/drm/i915/gem/i915_gem_object.c           |  8 +++-----
>>>   drivers/gpu/drm/i915/gem/i915_gem_phys.c             | 10 ++--------
>>>   drivers/gpu/drm/i915/gem/i915_gem_shmem.c            |  6 ++++--
>>>   drivers/gpu/drm/i915/gem/selftests/huge_pages.c      |  6 +++---
>>>   .../gpu/drm/i915/gem/selftests/i915_gem_coherency.c  | 12 ++++--------
>>>   .../gpu/drm/i915/gem/selftests/i915_gem_context.c    |  8 ++++----
>>>   drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c             |  5 +----
>>>   drivers/gpu/drm/i915/i915_cmd_parser.c               |  4 ++--
>>>   9 files changed, 28 insertions(+), 41 deletions(-)
>>>
>>> -- 
>>> 2.34.1
>>>

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [PATCH v3 0/9] drm/i915: Replace kmap_atomic() with kmap_local_page()
@ 2023-12-14 14:35       ` Tvrtko Ursulin
  0 siblings, 0 replies; 49+ messages in thread
From: Tvrtko Ursulin @ 2023-12-14 14:35 UTC (permalink / raw)
  To: Zhao Liu, Jani Nikula, Joonas Lahtinen, Rodrigo Vivi,
	David Airlie, Daniel Vetter, Ira Weiny, Fabio M . De Francesco,
	intel-gfx, dri-devel, linux-kernel
  Cc: Dave Hansen, Zhao Liu, Zhenyu Wang


On 14/12/2023 13:45, Tvrtko Ursulin wrote:
> 
> 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 certainly spotted your series last week or so but then it slipped my 
> mind to go through it. Should be able to go through it today or tomorrow.

It all looks good to me. I only needed to queue a re-test in our CI 
since v3 failed BAT, but pretty sure it wasn't at fault. Once I am 
satisfied with the results I will merge the series. Thanks for the 
cleanups and your patience!

Regards,

Tvrtko


> Regards,
> 
> Tvrtko
> 
>>
>> 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 <zhao1.liu@linux.intel.com>
>>> Subject: [PATCH v3 0/9] drm/i915: Replace kmap_atomic() with
>>>   kmap_local_page()
>>> X-Mailer: git-send-email 2.34.1
>>>
>>> From: Zhao Liu <zhao1.liu@intel.com>
>>>
>>> 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 code change in v3.
>>>
>>> Thanks for all the review! And sorry v2 was missed, I'll pay more
>>> attention to this v3.
>>>
>>>
>>> Purpose of This Patchset
>>> ========================
>>>
>>> The purpose of this pacthset is to replace all uses of kmap_atomic() in
>>> i915 with kmap_local_page() because the use of kmap_atomic() is being
>>> deprecated in favor of kmap_local_page()[2]. And 92b64bd (mm/highmem:
>>> add notes about conversions from kmap{,_atomic}()) has declared the
>>> deprecation of kmap_atomic().
>>>
>>>
>>> Motivation for Deprecating kmap_atomic() and Using kmap_local_page()
>>> ====================================================================
>>>
>>> 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 migration).
>>>
>>> With kmap_local_page(), we can avoid the often unwanted side effect of
>>> unnecessary page faults and preemption disables.
>>>
>>>
>>> Patch summary
>>> =============
>>>
>>> Patch 1, 4-6 and 8-9 replace kmap_atomic()/kunmap_atomic() with
>>>          kmap_local_page()/kunmap_local() directly. With these local
>>>          mappings, the page faults and preemption are allowed.
>>>
>>> Patch 2 and 7 use memcpy_from_page() and memcpy_to_page() to replace
>>>          kmap_atomic()/kunmap_atomic(). These two variants of memcpy()
>>>          are based on the local mapping, so page faults and preemption
>>>          are also allowed in these two interfaces.
>>>
>>> Patch 3 replaces kmap_atomic()/kunmap_atomic() with kmap_local_page()/
>>>          kunmap_local() and also disable page fault since the for 
>>> special
>>>          handling (pls see the commit message).
>>>
>>>
>>> Reference
>>> =========
>>>
>>> [1]: 
>>> https://lore.kernel.org/all/20230329073220.3982460-1-zhao1.liu@linux.intel.com/
>>> [2]: 
>>> https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com
>>>
>>>
>>> Thanks and Best Regards,
>>> Zhao
>>>
>>> ---
>>> Changlog:
>>>
>>> Changes since v2:
>>> * Rebased on 968f35f4ab1c ("Merge tag 'v6.7-rc3-smb3-client-fixes' of
>>>    git://git.samba.org/sfrench/cifs-2.6").
>>> * Removed changelog (of v2) in commit message.
>>> * Fixed typo in cover letter (Fabio).
>>> * Added Reviewed-by tags from Ira and Fabio.
>>>
>>> Changes since v1:
>>> * Dropped hot plug related description in commit message since it has
>>>    nothing to do with kmap_local_page().
>>> * Emphasized the motivation for using kmap_local_page() in commit
>>>    message.
>>> * Rebased patch 1 on f47e630 (drm/i915/gem: Typecheck page lookups) to
>>>    keep the "idx" variable of type pgoff_t here.
>>> * Used memcpy_from_page() and memcpy_to_page() to replace
>>>    kmap_local_page() + memcpy() in patch 2.
>>>
>>> ---
>>> Zhao Liu (9):
>>>    drm/i915: Use kmap_local_page() in gem/i915_gem_object.c
>>>    drm/i915: Use memcpy_[from/to]_page() in gem/i915_gem_pyhs.c
>>>    drm/i915: Use kmap_local_page() in gem/i915_gem_shmem.c
>>>    drm/i915: Use kmap_local_page() in gem/selftests/huge_pages.c
>>>    drm/i915: Use kmap_local_page() in gem/selftests/i915_gem_coherency.c
>>>    drm/i915: Use kmap_local_page() in gem/selftests/i915_gem_context.c
>>>    drm/i915: Use memcpy_from_page() in gt/uc/intel_uc_fw.c
>>>    drm/i915: Use kmap_local_page() in i915_cmd_parser.c
>>>    drm/i915: Use kmap_local_page() in gem/i915_gem_execbuffer.c
>>>
>>>   drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c       | 10 +++++-----
>>>   drivers/gpu/drm/i915/gem/i915_gem_object.c           |  8 +++-----
>>>   drivers/gpu/drm/i915/gem/i915_gem_phys.c             | 10 ++--------
>>>   drivers/gpu/drm/i915/gem/i915_gem_shmem.c            |  6 ++++--
>>>   drivers/gpu/drm/i915/gem/selftests/huge_pages.c      |  6 +++---
>>>   .../gpu/drm/i915/gem/selftests/i915_gem_coherency.c  | 12 ++++--------
>>>   .../gpu/drm/i915/gem/selftests/i915_gem_context.c    |  8 ++++----
>>>   drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c             |  5 +----
>>>   drivers/gpu/drm/i915/i915_cmd_parser.c               |  4 ++--
>>>   9 files changed, 28 insertions(+), 41 deletions(-)
>>>
>>> -- 
>>> 2.34.1
>>>

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [PATCH v3 0/9] drm/i915: Replace kmap_atomic() with kmap_local_page()
  2023-12-14 14:35       ` Tvrtko Ursulin
  (?)
@ 2023-12-14 15:04         ` Zhao Liu
  -1 siblings, 0 replies; 49+ messages in thread
From: Zhao Liu @ 2023-12-14 15:04 UTC (permalink / raw)
  To: Tvrtko Ursulin
  Cc: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, David Airlie,
	Daniel Vetter, Ira Weiny, Fabio M . De Francesco, intel-gfx,
	dri-devel, linux-kernel, Dave Hansen, Zhenyu Wang, Zhao Liu

On Thu, Dec 14, 2023 at 02:35:26PM +0000, Tvrtko Ursulin wrote:
> Date: Thu, 14 Dec 2023 14:35:26 +0000
> From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
> Subject: Re: [PATCH v3 0/9] drm/i915: Replace kmap_atomic() with
>  kmap_local_page()
> 
> 
> On 14/12/2023 13:45, Tvrtko Ursulin wrote:
> > 
> > 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 certainly spotted your series last week or so but then it slipped my
> > mind to go through it. Should be able to go through it today or
> > tomorrow.
> 
> It all looks good to me. I only needed to queue a re-test in our CI since v3
> failed BAT, but pretty sure it wasn't at fault. Once I am satisfied with the
> results I will merge the series. Thanks for the cleanups and your patience!
> 
> Regards,
> 
> Tvrtko
> 

Thanks for your review!

Regards,
Zhao

> 
> > Regards,
> > 
> > Tvrtko
> > 
> > > 
> > > 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 <zhao1.liu@linux.intel.com>
> > > > Subject: [PATCH v3 0/9] drm/i915: Replace kmap_atomic() with
> > > >   kmap_local_page()
> > > > X-Mailer: git-send-email 2.34.1
> > > > 
> > > > From: Zhao Liu <zhao1.liu@intel.com>
> > > > 
> > > > 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 code change in v3.
> > > > 
> > > > Thanks for all the review! And sorry v2 was missed, I'll pay more
> > > > attention to this v3.
> > > > 
> > > > 
> > > > Purpose of This Patchset
> > > > ========================
> > > > 
> > > > The purpose of this pacthset is to replace all uses of kmap_atomic() in
> > > > i915 with kmap_local_page() because the use of kmap_atomic() is being
> > > > deprecated in favor of kmap_local_page()[2]. And 92b64bd (mm/highmem:
> > > > add notes about conversions from kmap{,_atomic}()) has declared the
> > > > deprecation of kmap_atomic().
> > > > 
> > > > 
> > > > Motivation for Deprecating kmap_atomic() and Using kmap_local_page()
> > > > ====================================================================
> > > > 
> > > > 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 migration).
> > > > 
> > > > With kmap_local_page(), we can avoid the often unwanted side effect of
> > > > unnecessary page faults and preemption disables.
> > > > 
> > > > 
> > > > Patch summary
> > > > =============
> > > > 
> > > > Patch 1, 4-6 and 8-9 replace kmap_atomic()/kunmap_atomic() with
> > > >          kmap_local_page()/kunmap_local() directly. With these local
> > > >          mappings, the page faults and preemption are allowed.
> > > > 
> > > > Patch 2 and 7 use memcpy_from_page() and memcpy_to_page() to replace
> > > >          kmap_atomic()/kunmap_atomic(). These two variants of memcpy()
> > > >          are based on the local mapping, so page faults and preemption
> > > >          are also allowed in these two interfaces.
> > > > 
> > > > Patch 3 replaces kmap_atomic()/kunmap_atomic() with kmap_local_page()/
> > > >          kunmap_local() and also disable page fault since the
> > > > for special
> > > >          handling (pls see the commit message).
> > > > 
> > > > 
> > > > Reference
> > > > =========
> > > > 
> > > > [1]: https://lore.kernel.org/all/20230329073220.3982460-1-zhao1.liu@linux.intel.com/
> > > > [2]:
> > > > https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com
> > > > 
> > > > 
> > > > Thanks and Best Regards,
> > > > Zhao
> > > > 
> > > > ---
> > > > Changlog:
> > > > 
> > > > Changes since v2:
> > > > * Rebased on 968f35f4ab1c ("Merge tag 'v6.7-rc3-smb3-client-fixes' of
> > > >    git://git.samba.org/sfrench/cifs-2.6").
> > > > * Removed changelog (of v2) in commit message.
> > > > * Fixed typo in cover letter (Fabio).
> > > > * Added Reviewed-by tags from Ira and Fabio.
> > > > 
> > > > Changes since v1:
> > > > * Dropped hot plug related description in commit message since it has
> > > >    nothing to do with kmap_local_page().
> > > > * Emphasized the motivation for using kmap_local_page() in commit
> > > >    message.
> > > > * Rebased patch 1 on f47e630 (drm/i915/gem: Typecheck page lookups) to
> > > >    keep the "idx" variable of type pgoff_t here.
> > > > * Used memcpy_from_page() and memcpy_to_page() to replace
> > > >    kmap_local_page() + memcpy() in patch 2.
> > > > 
> > > > ---
> > > > Zhao Liu (9):
> > > >    drm/i915: Use kmap_local_page() in gem/i915_gem_object.c
> > > >    drm/i915: Use memcpy_[from/to]_page() in gem/i915_gem_pyhs.c
> > > >    drm/i915: Use kmap_local_page() in gem/i915_gem_shmem.c
> > > >    drm/i915: Use kmap_local_page() in gem/selftests/huge_pages.c
> > > >    drm/i915: Use kmap_local_page() in gem/selftests/i915_gem_coherency.c
> > > >    drm/i915: Use kmap_local_page() in gem/selftests/i915_gem_context.c
> > > >    drm/i915: Use memcpy_from_page() in gt/uc/intel_uc_fw.c
> > > >    drm/i915: Use kmap_local_page() in i915_cmd_parser.c
> > > >    drm/i915: Use kmap_local_page() in gem/i915_gem_execbuffer.c
> > > > 
> > > >   drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c       | 10 +++++-----
> > > >   drivers/gpu/drm/i915/gem/i915_gem_object.c           |  8 +++-----
> > > >   drivers/gpu/drm/i915/gem/i915_gem_phys.c             | 10 ++--------
> > > >   drivers/gpu/drm/i915/gem/i915_gem_shmem.c            |  6 ++++--
> > > >   drivers/gpu/drm/i915/gem/selftests/huge_pages.c      |  6 +++---
> > > >   .../gpu/drm/i915/gem/selftests/i915_gem_coherency.c  | 12 ++++--------
> > > >   .../gpu/drm/i915/gem/selftests/i915_gem_context.c    |  8 ++++----
> > > >   drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c             |  5 +----
> > > >   drivers/gpu/drm/i915/i915_cmd_parser.c               |  4 ++--
> > > >   9 files changed, 28 insertions(+), 41 deletions(-)
> > > > 
> > > > -- 
> > > > 2.34.1
> > > > 

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [PATCH v3 0/9] drm/i915: Replace kmap_atomic() with kmap_local_page()
@ 2023-12-14 15:04         ` Zhao Liu
  0 siblings, 0 replies; 49+ messages in thread
From: Zhao Liu @ 2023-12-14 15:04 UTC (permalink / raw)
  To: Tvrtko Ursulin
  Cc: Zhenyu Wang, intel-gfx, linux-kernel, Dave Hansen, dri-devel,
	Rodrigo Vivi, Ira Weiny, Zhao Liu, Fabio M . De Francesco

On Thu, Dec 14, 2023 at 02:35:26PM +0000, Tvrtko Ursulin wrote:
> Date: Thu, 14 Dec 2023 14:35:26 +0000
> From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
> Subject: Re: [PATCH v3 0/9] drm/i915: Replace kmap_atomic() with
>  kmap_local_page()
> 
> 
> On 14/12/2023 13:45, Tvrtko Ursulin wrote:
> > 
> > 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 certainly spotted your series last week or so but then it slipped my
> > mind to go through it. Should be able to go through it today or
> > tomorrow.
> 
> It all looks good to me. I only needed to queue a re-test in our CI since v3
> failed BAT, but pretty sure it wasn't at fault. Once I am satisfied with the
> results I will merge the series. Thanks for the cleanups and your patience!
> 
> Regards,
> 
> Tvrtko
> 

Thanks for your review!

Regards,
Zhao

> 
> > Regards,
> > 
> > Tvrtko
> > 
> > > 
> > > 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 <zhao1.liu@linux.intel.com>
> > > > Subject: [PATCH v3 0/9] drm/i915: Replace kmap_atomic() with
> > > >   kmap_local_page()
> > > > X-Mailer: git-send-email 2.34.1
> > > > 
> > > > From: Zhao Liu <zhao1.liu@intel.com>
> > > > 
> > > > 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 code change in v3.
> > > > 
> > > > Thanks for all the review! And sorry v2 was missed, I'll pay more
> > > > attention to this v3.
> > > > 
> > > > 
> > > > Purpose of This Patchset
> > > > ========================
> > > > 
> > > > The purpose of this pacthset is to replace all uses of kmap_atomic() in
> > > > i915 with kmap_local_page() because the use of kmap_atomic() is being
> > > > deprecated in favor of kmap_local_page()[2]. And 92b64bd (mm/highmem:
> > > > add notes about conversions from kmap{,_atomic}()) has declared the
> > > > deprecation of kmap_atomic().
> > > > 
> > > > 
> > > > Motivation for Deprecating kmap_atomic() and Using kmap_local_page()
> > > > ====================================================================
> > > > 
> > > > 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 migration).
> > > > 
> > > > With kmap_local_page(), we can avoid the often unwanted side effect of
> > > > unnecessary page faults and preemption disables.
> > > > 
> > > > 
> > > > Patch summary
> > > > =============
> > > > 
> > > > Patch 1, 4-6 and 8-9 replace kmap_atomic()/kunmap_atomic() with
> > > >          kmap_local_page()/kunmap_local() directly. With these local
> > > >          mappings, the page faults and preemption are allowed.
> > > > 
> > > > Patch 2 and 7 use memcpy_from_page() and memcpy_to_page() to replace
> > > >          kmap_atomic()/kunmap_atomic(). These two variants of memcpy()
> > > >          are based on the local mapping, so page faults and preemption
> > > >          are also allowed in these two interfaces.
> > > > 
> > > > Patch 3 replaces kmap_atomic()/kunmap_atomic() with kmap_local_page()/
> > > >          kunmap_local() and also disable page fault since the
> > > > for special
> > > >          handling (pls see the commit message).
> > > > 
> > > > 
> > > > Reference
> > > > =========
> > > > 
> > > > [1]: https://lore.kernel.org/all/20230329073220.3982460-1-zhao1.liu@linux.intel.com/
> > > > [2]:
> > > > https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com
> > > > 
> > > > 
> > > > Thanks and Best Regards,
> > > > Zhao
> > > > 
> > > > ---
> > > > Changlog:
> > > > 
> > > > Changes since v2:
> > > > * Rebased on 968f35f4ab1c ("Merge tag 'v6.7-rc3-smb3-client-fixes' of
> > > >    git://git.samba.org/sfrench/cifs-2.6").
> > > > * Removed changelog (of v2) in commit message.
> > > > * Fixed typo in cover letter (Fabio).
> > > > * Added Reviewed-by tags from Ira and Fabio.
> > > > 
> > > > Changes since v1:
> > > > * Dropped hot plug related description in commit message since it has
> > > >    nothing to do with kmap_local_page().
> > > > * Emphasized the motivation for using kmap_local_page() in commit
> > > >    message.
> > > > * Rebased patch 1 on f47e630 (drm/i915/gem: Typecheck page lookups) to
> > > >    keep the "idx" variable of type pgoff_t here.
> > > > * Used memcpy_from_page() and memcpy_to_page() to replace
> > > >    kmap_local_page() + memcpy() in patch 2.
> > > > 
> > > > ---
> > > > Zhao Liu (9):
> > > >    drm/i915: Use kmap_local_page() in gem/i915_gem_object.c
> > > >    drm/i915: Use memcpy_[from/to]_page() in gem/i915_gem_pyhs.c
> > > >    drm/i915: Use kmap_local_page() in gem/i915_gem_shmem.c
> > > >    drm/i915: Use kmap_local_page() in gem/selftests/huge_pages.c
> > > >    drm/i915: Use kmap_local_page() in gem/selftests/i915_gem_coherency.c
> > > >    drm/i915: Use kmap_local_page() in gem/selftests/i915_gem_context.c
> > > >    drm/i915: Use memcpy_from_page() in gt/uc/intel_uc_fw.c
> > > >    drm/i915: Use kmap_local_page() in i915_cmd_parser.c
> > > >    drm/i915: Use kmap_local_page() in gem/i915_gem_execbuffer.c
> > > > 
> > > >   drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c       | 10 +++++-----
> > > >   drivers/gpu/drm/i915/gem/i915_gem_object.c           |  8 +++-----
> > > >   drivers/gpu/drm/i915/gem/i915_gem_phys.c             | 10 ++--------
> > > >   drivers/gpu/drm/i915/gem/i915_gem_shmem.c            |  6 ++++--
> > > >   drivers/gpu/drm/i915/gem/selftests/huge_pages.c      |  6 +++---
> > > >   .../gpu/drm/i915/gem/selftests/i915_gem_coherency.c  | 12 ++++--------
> > > >   .../gpu/drm/i915/gem/selftests/i915_gem_context.c    |  8 ++++----
> > > >   drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c             |  5 +----
> > > >   drivers/gpu/drm/i915/i915_cmd_parser.c               |  4 ++--
> > > >   9 files changed, 28 insertions(+), 41 deletions(-)
> > > > 
> > > > -- 
> > > > 2.34.1
> > > > 

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [PATCH v3 0/9] drm/i915: Replace kmap_atomic() with kmap_local_page()
@ 2023-12-14 15:04         ` Zhao Liu
  0 siblings, 0 replies; 49+ messages in thread
From: Zhao Liu @ 2023-12-14 15:04 UTC (permalink / raw)
  To: Tvrtko Ursulin
  Cc: Zhenyu Wang, David Airlie, intel-gfx, linux-kernel, Dave Hansen,
	dri-devel, Daniel Vetter, Rodrigo Vivi, Ira Weiny, Zhao Liu,
	Fabio M . De Francesco

On Thu, Dec 14, 2023 at 02:35:26PM +0000, Tvrtko Ursulin wrote:
> Date: Thu, 14 Dec 2023 14:35:26 +0000
> From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
> Subject: Re: [PATCH v3 0/9] drm/i915: Replace kmap_atomic() with
>  kmap_local_page()
> 
> 
> On 14/12/2023 13:45, Tvrtko Ursulin wrote:
> > 
> > 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 certainly spotted your series last week or so but then it slipped my
> > mind to go through it. Should be able to go through it today or
> > tomorrow.
> 
> It all looks good to me. I only needed to queue a re-test in our CI since v3
> failed BAT, but pretty sure it wasn't at fault. Once I am satisfied with the
> results I will merge the series. Thanks for the cleanups and your patience!
> 
> Regards,
> 
> Tvrtko
> 

Thanks for your review!

Regards,
Zhao

> 
> > Regards,
> > 
> > Tvrtko
> > 
> > > 
> > > 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 <zhao1.liu@linux.intel.com>
> > > > Subject: [PATCH v3 0/9] drm/i915: Replace kmap_atomic() with
> > > >   kmap_local_page()
> > > > X-Mailer: git-send-email 2.34.1
> > > > 
> > > > From: Zhao Liu <zhao1.liu@intel.com>
> > > > 
> > > > 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 code change in v3.
> > > > 
> > > > Thanks for all the review! And sorry v2 was missed, I'll pay more
> > > > attention to this v3.
> > > > 
> > > > 
> > > > Purpose of This Patchset
> > > > ========================
> > > > 
> > > > The purpose of this pacthset is to replace all uses of kmap_atomic() in
> > > > i915 with kmap_local_page() because the use of kmap_atomic() is being
> > > > deprecated in favor of kmap_local_page()[2]. And 92b64bd (mm/highmem:
> > > > add notes about conversions from kmap{,_atomic}()) has declared the
> > > > deprecation of kmap_atomic().
> > > > 
> > > > 
> > > > Motivation for Deprecating kmap_atomic() and Using kmap_local_page()
> > > > ====================================================================
> > > > 
> > > > 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 migration).
> > > > 
> > > > With kmap_local_page(), we can avoid the often unwanted side effect of
> > > > unnecessary page faults and preemption disables.
> > > > 
> > > > 
> > > > Patch summary
> > > > =============
> > > > 
> > > > Patch 1, 4-6 and 8-9 replace kmap_atomic()/kunmap_atomic() with
> > > >          kmap_local_page()/kunmap_local() directly. With these local
> > > >          mappings, the page faults and preemption are allowed.
> > > > 
> > > > Patch 2 and 7 use memcpy_from_page() and memcpy_to_page() to replace
> > > >          kmap_atomic()/kunmap_atomic(). These two variants of memcpy()
> > > >          are based on the local mapping, so page faults and preemption
> > > >          are also allowed in these two interfaces.
> > > > 
> > > > Patch 3 replaces kmap_atomic()/kunmap_atomic() with kmap_local_page()/
> > > >          kunmap_local() and also disable page fault since the
> > > > for special
> > > >          handling (pls see the commit message).
> > > > 
> > > > 
> > > > Reference
> > > > =========
> > > > 
> > > > [1]: https://lore.kernel.org/all/20230329073220.3982460-1-zhao1.liu@linux.intel.com/
> > > > [2]:
> > > > https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com
> > > > 
> > > > 
> > > > Thanks and Best Regards,
> > > > Zhao
> > > > 
> > > > ---
> > > > Changlog:
> > > > 
> > > > Changes since v2:
> > > > * Rebased on 968f35f4ab1c ("Merge tag 'v6.7-rc3-smb3-client-fixes' of
> > > >    git://git.samba.org/sfrench/cifs-2.6").
> > > > * Removed changelog (of v2) in commit message.
> > > > * Fixed typo in cover letter (Fabio).
> > > > * Added Reviewed-by tags from Ira and Fabio.
> > > > 
> > > > Changes since v1:
> > > > * Dropped hot plug related description in commit message since it has
> > > >    nothing to do with kmap_local_page().
> > > > * Emphasized the motivation for using kmap_local_page() in commit
> > > >    message.
> > > > * Rebased patch 1 on f47e630 (drm/i915/gem: Typecheck page lookups) to
> > > >    keep the "idx" variable of type pgoff_t here.
> > > > * Used memcpy_from_page() and memcpy_to_page() to replace
> > > >    kmap_local_page() + memcpy() in patch 2.
> > > > 
> > > > ---
> > > > Zhao Liu (9):
> > > >    drm/i915: Use kmap_local_page() in gem/i915_gem_object.c
> > > >    drm/i915: Use memcpy_[from/to]_page() in gem/i915_gem_pyhs.c
> > > >    drm/i915: Use kmap_local_page() in gem/i915_gem_shmem.c
> > > >    drm/i915: Use kmap_local_page() in gem/selftests/huge_pages.c
> > > >    drm/i915: Use kmap_local_page() in gem/selftests/i915_gem_coherency.c
> > > >    drm/i915: Use kmap_local_page() in gem/selftests/i915_gem_context.c
> > > >    drm/i915: Use memcpy_from_page() in gt/uc/intel_uc_fw.c
> > > >    drm/i915: Use kmap_local_page() in i915_cmd_parser.c
> > > >    drm/i915: Use kmap_local_page() in gem/i915_gem_execbuffer.c
> > > > 
> > > >   drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c       | 10 +++++-----
> > > >   drivers/gpu/drm/i915/gem/i915_gem_object.c           |  8 +++-----
> > > >   drivers/gpu/drm/i915/gem/i915_gem_phys.c             | 10 ++--------
> > > >   drivers/gpu/drm/i915/gem/i915_gem_shmem.c            |  6 ++++--
> > > >   drivers/gpu/drm/i915/gem/selftests/huge_pages.c      |  6 +++---
> > > >   .../gpu/drm/i915/gem/selftests/i915_gem_coherency.c  | 12 ++++--------
> > > >   .../gpu/drm/i915/gem/selftests/i915_gem_context.c    |  8 ++++----
> > > >   drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c             |  5 +----
> > > >   drivers/gpu/drm/i915/i915_cmd_parser.c               |  4 ++--
> > > >   9 files changed, 28 insertions(+), 41 deletions(-)
> > > > 
> > > > -- 
> > > > 2.34.1
> > > > 

^ permalink raw reply	[flat|nested] 49+ messages in thread

* ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Replace kmap_atomic() with kmap_local_page() (rev3)
  2023-12-03 13:29 ` Zhao Liu
                   ` (14 preceding siblings ...)
  (?)
@ 2023-12-14 19:04 ` Patchwork
  -1 siblings, 0 replies; 49+ messages in thread
From: Patchwork @ 2023-12-14 19:04 UTC (permalink / raw)
  To: Zhao Liu; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Replace kmap_atomic() with kmap_local_page() (rev3)
URL   : https://patchwork.freedesktop.org/series/115769/
State : warning

== Summary ==

Error: dim checkpatch failed
5089a4873acd drm/i915: Use kmap_local_page() in gem/i915_gem_object.c
-:39: WARNING:COMMIT_LOG_LONG_LINE: Prefer a maximum 75 chars per line (possible unwrapped commit description?)
#39: 
[1]: https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com

-:63: ERROR:CODE_INDENT: code indent should use tabs where possible
#63: FILE: drivers/gpu/drm/i915/gem/i915_gem_object.c:506:
+^I          + offset_in_page(offset);$

total: 1 errors, 1 warnings, 0 checks, 20 lines checked
7b2fca2701ac drm/i915: Use memcpy_[from/to]_page() in gem/i915_gem_pyhs.c
-:39: WARNING:COMMIT_LOG_LONG_LINE: Prefer a maximum 75 chars per line (possible unwrapped commit description?)
#39: 
[1]: https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com

total: 0 errors, 1 warnings, 0 checks, 34 lines checked
9f45f1946609 drm/i915: Use kmap_local_page() in gem/i915_gem_shmem.c
-:24: WARNING:COMMIT_LOG_LONG_LINE: Prefer a maximum 75 chars per line (possible unwrapped commit description?)
#24: 
[1]: https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com

total: 0 errors, 1 warnings, 0 checks, 15 lines checked
db5545d1bfac drm/i915: Use kmap_local_page() in gem/selftests/huge_pages.c
-:36: WARNING:COMMIT_LOG_LONG_LINE: Prefer a maximum 75 chars per line (possible unwrapped commit description?)
#36: 
[1]: https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com

total: 0 errors, 1 warnings, 0 checks, 22 lines checked
f29591541a73 drm/i915: Use kmap_local_page() in gem/selftests/i915_gem_coherency.c
-:37: WARNING:COMMIT_LOG_LONG_LINE: Prefer a maximum 75 chars per line (possible unwrapped commit description?)
#37: 
[1]: https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com

total: 0 errors, 1 warnings, 0 checks, 48 lines checked
90cbc7415093 drm/i915: Use kmap_local_page() in gem/selftests/i915_gem_context.c
-:38: WARNING:COMMIT_LOG_LONG_LINE: Prefer a maximum 75 chars per line (possible unwrapped commit description?)
#38: 
[1]: https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com

total: 0 errors, 1 warnings, 0 checks, 30 lines checked
69a02c2cd306 drm/i915: Use memcpy_from_page() in gt/uc/intel_uc_fw.c
-:29: WARNING:COMMIT_LOG_LONG_LINE: Prefer a maximum 75 chars per line (possible unwrapped commit description?)
#29: 
[1]: https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com/T/#u

total: 0 errors, 1 warnings, 0 checks, 17 lines checked
0d4712b4d4a7 drm/i915: Use kmap_local_page() in i915_cmd_parser.c
-:34: WARNING:COMMIT_LOG_LONG_LINE: Prefer a maximum 75 chars per line (possible unwrapped commit description?)
#34: 
[1]: https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com

total: 0 errors, 1 warnings, 0 checks, 13 lines checked
3b536da924e3 drm/i915: Use kmap_local_page() in gem/i915_gem_execbuffer.c
-:34: WARNING:COMMIT_LOG_LONG_LINE: Prefer a maximum 75 chars per line (possible unwrapped commit description?)
#34: 
[1]: https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com

total: 0 errors, 1 warnings, 0 checks, 40 lines checked



^ permalink raw reply	[flat|nested] 49+ messages in thread

* ✗ Fi.CI.SPARSE: warning for drm/i915: Replace kmap_atomic() with kmap_local_page() (rev3)
  2023-12-03 13:29 ` Zhao Liu
                   ` (15 preceding siblings ...)
  (?)
@ 2023-12-14 19:04 ` Patchwork
  -1 siblings, 0 replies; 49+ messages in thread
From: Patchwork @ 2023-12-14 19:04 UTC (permalink / raw)
  To: Zhao Liu; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Replace kmap_atomic() with kmap_local_page() (rev3)
URL   : https://patchwork.freedesktop.org/series/115769/
State : warning

== Summary ==

Error: dim sparse failed
Sparse version: v0.6.2
Fast mode used, each commit won't be checked separately.



^ permalink raw reply	[flat|nested] 49+ messages in thread

* ✓ Fi.CI.BAT: success for drm/i915: Replace kmap_atomic() with kmap_local_page() (rev3)
  2023-12-03 13:29 ` Zhao Liu
                   ` (16 preceding siblings ...)
  (?)
@ 2023-12-14 19:51 ` Patchwork
  -1 siblings, 0 replies; 49+ messages in thread
From: Patchwork @ 2023-12-14 19:51 UTC (permalink / raw)
  To: Zhao Liu; +Cc: intel-gfx

[-- Attachment #1: Type: text/plain, Size: 2905 bytes --]

== Series Details ==

Series: drm/i915: Replace kmap_atomic() with kmap_local_page() (rev3)
URL   : https://patchwork.freedesktop.org/series/115769/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_14022 -> Patchwork_115769v3
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/index.html

Participating hosts (38 -> 36)
------------------------------

  Additional (1): fi-pnv-d510 
  Missing    (3): bat-mtlp-8 bat-adlp-6 fi-snb-2520m 

Known issues
------------

  Here are the changes found in Patchwork_115769v3 that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@gem_lmem_swapping@basic:
    - fi-pnv-d510:        NOTRUN -> [SKIP][1] ([fdo#109271]) +28 other tests skip
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/fi-pnv-d510/igt@gem_lmem_swapping@basic.html

  
#### Possible fixes ####

  * igt@kms_pipe_crc_basic@suspend-read-crc@pipe-c-hdmi-a-2:
    - fi-bsw-n3050:       [DMESG-WARN][2] ([i915#1982]) -> [PASS][3]
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14022/fi-bsw-n3050/igt@kms_pipe_crc_basic@suspend-read-crc@pipe-c-hdmi-a-2.html
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/fi-bsw-n3050/igt@kms_pipe_crc_basic@suspend-read-crc@pipe-c-hdmi-a-2.html

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [i915#1982]: https://gitlab.freedesktop.org/drm/intel/issues/1982


Build changes
-------------

  * Linux: CI_DRM_14022 -> Patchwork_115769v3

  CI-20190529: 20190529
  CI_DRM_14022: 87fdea3fd86a02e2e7855e372c0d3fb32e53e4e6 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_7643: ced22f8bf4263ff395dc852c86b682e62a7a1c1b @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
  Patchwork_115769v3: 87fdea3fd86a02e2e7855e372c0d3fb32e53e4e6 @ git://anongit.freedesktop.org/gfx-ci/linux


### Linux commits

e4eca37c6638 drm/i915: Use kmap_local_page() in gem/i915_gem_execbuffer.c
7a38f4fc02a3 drm/i915: Use kmap_local_page() in i915_cmd_parser.c
ea9067eed123 drm/i915: Use memcpy_from_page() in gt/uc/intel_uc_fw.c
6b0c09456114 drm/i915: Use kmap_local_page() in gem/selftests/i915_gem_context.c
7fc1e0e2c0e6 drm/i915: Use kmap_local_page() in gem/selftests/i915_gem_coherency.c
b3c77009b5a4 drm/i915: Use kmap_local_page() in gem/selftests/huge_pages.c
c07f4b45abea drm/i915: Use kmap_local_page() in gem/i915_gem_shmem.c
7d26dd6b5142 drm/i915: Use memcpy_[from/to]_page() in gem/i915_gem_pyhs.c
ca94dc81a037 drm/i915: Use kmap_local_page() in gem/i915_gem_object.c

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/index.html

[-- Attachment #2: Type: text/html, Size: 3588 bytes --]

^ permalink raw reply	[flat|nested] 49+ messages in thread

* ✓ Fi.CI.IGT: success for drm/i915: Replace kmap_atomic() with kmap_local_page() (rev3)
  2023-12-03 13:29 ` Zhao Liu
                   ` (17 preceding siblings ...)
  (?)
@ 2023-12-14 20:47 ` Patchwork
  -1 siblings, 0 replies; 49+ messages in thread
From: Patchwork @ 2023-12-14 20:47 UTC (permalink / raw)
  To: Zhao Liu; +Cc: intel-gfx

[-- Attachment #1: Type: text/plain, Size: 31412 bytes --]

== Series Details ==

Series: drm/i915: Replace kmap_atomic() with kmap_local_page() (rev3)
URL   : https://patchwork.freedesktop.org/series/115769/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_14022_full -> Patchwork_115769v3_full
====================================================

Summary
-------

  **WARNING**

  Minor unknown changes coming with Patchwork_115769v3_full need to be verified
  manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in Patchwork_115769v3_full, please notify your bug team (I915-ci-infra@lists.freedesktop.org) to allow them
  to document this new failure mode, which will reduce false positives in CI.

  

Participating hosts (7 -> 8)
------------------------------

  Additional (1): shard-glk-0 

Possible new issues
-------------------

  Here are the unknown changes that may have been introduced in Patchwork_115769v3_full:

### IGT changes ###

#### Warnings ####

  * igt@gem_ctx_freq@sysfs@gt0:
    - shard-rkl:          [ABORT][1] ([i915#9847]) -> [INCOMPLETE][2]
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14022/shard-rkl-3/igt@gem_ctx_freq@sysfs@gt0.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-rkl-1/igt@gem_ctx_freq@sysfs@gt0.html
    - shard-dg1:          [INCOMPLETE][3] ([i915#9855]) -> [INCOMPLETE][4]
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14022/shard-dg1-16/igt@gem_ctx_freq@sysfs@gt0.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-dg1-17/igt@gem_ctx_freq@sysfs@gt0.html

  * igt@i915_pm_rps@engine-order:
    - shard-dg2:          [INCOMPLETE][5] ([i915#9847]) -> [INCOMPLETE][6]
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14022/shard-dg2-6/igt@i915_pm_rps@engine-order.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-dg2-10/igt@i915_pm_rps@engine-order.html

  * igt@i915_pm_rps@fence-order:
    - shard-snb:          [INCOMPLETE][7] ([i915#9847]) -> [INCOMPLETE][8]
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14022/shard-snb5/igt@i915_pm_rps@fence-order.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-snb4/igt@i915_pm_rps@fence-order.html

  
Known issues
------------

  Here are the changes found in Patchwork_115769v3_full that come from known issues:

### CI changes ###

#### Issues hit ####

  * boot:
    - shard-glk:          ([PASS][9], [PASS][10], [PASS][11], [PASS][12], [PASS][13], [PASS][14], [PASS][15], [PASS][16], [PASS][17], [PASS][18], [PASS][19], [PASS][20], [PASS][21], [PASS][22], [PASS][23], [PASS][24], [PASS][25], [PASS][26], [PASS][27], [PASS][28], [PASS][29], [PASS][30], [PASS][31], [PASS][32], [PASS][33]) -> ([PASS][34], [PASS][35], [PASS][36], [PASS][37], [PASS][38], [PASS][39], [PASS][40], [PASS][41], [PASS][42], [FAIL][43], [PASS][44], [PASS][45], [PASS][46], [PASS][47], [PASS][48], [PASS][49], [PASS][50], [PASS][51], [PASS][52], [PASS][53], [PASS][54], [PASS][55], [PASS][56], [PASS][57], [PASS][58]) ([i915#8293])
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14022/shard-glk1/boot.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14022/shard-glk1/boot.html
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14022/shard-glk2/boot.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14022/shard-glk2/boot.html
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14022/shard-glk2/boot.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14022/shard-glk2/boot.html
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14022/shard-glk3/boot.html
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14022/shard-glk3/boot.html
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14022/shard-glk3/boot.html
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14022/shard-glk3/boot.html
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14022/shard-glk4/boot.html
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14022/shard-glk4/boot.html
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14022/shard-glk4/boot.html
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14022/shard-glk5/boot.html
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14022/shard-glk5/boot.html
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14022/shard-glk6/boot.html
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14022/shard-glk6/boot.html
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14022/shard-glk6/boot.html
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14022/shard-glk7/boot.html
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14022/shard-glk8/boot.html
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14022/shard-glk8/boot.html
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14022/shard-glk8/boot.html
   [31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14022/shard-glk9/boot.html
   [32]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14022/shard-glk9/boot.html
   [33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14022/shard-glk9/boot.html
   [34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-glk9/boot.html
   [35]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-glk9/boot.html
   [36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-glk8/boot.html
   [37]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-glk8/boot.html
   [38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-glk8/boot.html
   [39]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-glk8/boot.html
   [40]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-glk7/boot.html
   [41]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-glk7/boot.html
   [42]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-glk6/boot.html
   [43]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-glk6/boot.html
   [44]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-glk5/boot.html
   [45]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-glk5/boot.html
   [46]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-glk4/boot.html
   [47]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-glk4/boot.html
   [48]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-glk4/boot.html
   [49]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-glk3/boot.html
   [50]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-glk3/boot.html
   [51]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-glk3/boot.html
   [52]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-glk3/boot.html
   [53]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-glk2/boot.html
   [54]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-glk2/boot.html
   [55]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-glk2/boot.html
   [56]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-glk1/boot.html
   [57]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-glk1/boot.html
   [58]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-glk1/boot.html

  

### IGT changes ###

#### Issues hit ####

  * igt@gem_ctx_freq@sysfs:
    - shard-snb:          NOTRUN -> [INCOMPLETE][59] ([i915#9860])
   [59]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-snb7/igt@gem_ctx_freq@sysfs.html

  * igt@gem_exec_balancer@bonded-false-hang:
    - shard-rkl:          NOTRUN -> [ABORT][60] ([i915#9855])
   [60]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-rkl-5/igt@gem_exec_balancer@bonded-false-hang.html

  * igt@gem_exec_balancer@full-late:
    - shard-rkl:          NOTRUN -> [ABORT][61] ([i915#9855] / [i915#9856]) +1 other test abort
   [61]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-rkl-5/igt@gem_exec_balancer@full-late.html

  * igt@gem_exec_balancer@hang:
    - shard-mtlp:         NOTRUN -> [ABORT][62] ([i915#9855]) +1 other test abort
   [62]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-mtlp-6/igt@gem_exec_balancer@hang.html

  * igt@gem_exec_balancer@individual:
    - shard-glk:          NOTRUN -> [ABORT][63] ([i915#9855])
   [63]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-glk1/igt@gem_exec_balancer@individual.html

  * igt@gem_exec_balancer@parallel-bb-first:
    - shard-dg1:          NOTRUN -> [ABORT][64] ([i915#9855])
   [64]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-dg1-13/igt@gem_exec_balancer@parallel-bb-first.html

  * igt@gem_exec_reloc@basic-gtt-noreloc:
    - shard-mtlp:         NOTRUN -> [SKIP][65] ([i915#3281])
   [65]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-mtlp-5/igt@gem_exec_reloc@basic-gtt-noreloc.html

  * igt@gem_exec_whisper@basic-contexts-priority:
    - shard-mtlp:         [PASS][66] -> [ABORT][67] ([i915#9855] / [i915#9857])
   [66]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14022/shard-mtlp-5/igt@gem_exec_whisper@basic-contexts-priority.html
   [67]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-mtlp-6/igt@gem_exec_whisper@basic-contexts-priority.html

  * igt@gem_exec_whisper@basic-fds-forked-all:
    - shard-mtlp:         [PASS][68] -> [ABORT][69] ([i915#7392] / [i915#9857])
   [68]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14022/shard-mtlp-5/igt@gem_exec_whisper@basic-fds-forked-all.html
   [69]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-mtlp-6/igt@gem_exec_whisper@basic-fds-forked-all.html

  * igt@gem_lmem_swapping@random-engines:
    - shard-mtlp:         NOTRUN -> [SKIP][70] ([i915#4613])
   [70]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-mtlp-6/igt@gem_lmem_swapping@random-engines.html

  * igt@gem_mmap_gtt@flink-race:
    - shard-mtlp:         NOTRUN -> [SKIP][71] ([i915#4077]) +1 other test skip
   [71]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-mtlp-5/igt@gem_mmap_gtt@flink-race.html

  * igt@gem_mmap_wc@coherency:
    - shard-mtlp:         NOTRUN -> [SKIP][72] ([i915#4083])
   [72]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-mtlp-5/igt@gem_mmap_wc@coherency.html

  * igt@gem_pwrite@basic-self:
    - shard-mtlp:         NOTRUN -> [SKIP][73] ([i915#3282])
   [73]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-mtlp-5/igt@gem_pwrite@basic-self.html

  * igt@gem_pxp@verify-pxp-stale-buf-optout-execution:
    - shard-mtlp:         NOTRUN -> [SKIP][74] ([i915#4270])
   [74]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-mtlp-6/igt@gem_pxp@verify-pxp-stale-buf-optout-execution.html

  * igt@gem_render_copy@y-tiled-to-vebox-x-tiled:
    - shard-mtlp:         NOTRUN -> [SKIP][75] ([i915#8428])
   [75]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-mtlp-5/igt@gem_render_copy@y-tiled-to-vebox-x-tiled.html

  * igt@gem_set_tiling_vs_gtt:
    - shard-mtlp:         NOTRUN -> [SKIP][76] ([i915#4079])
   [76]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-mtlp-5/igt@gem_set_tiling_vs_gtt.html

  * igt@gen7_exec_parse@basic-offset:
    - shard-mtlp:         NOTRUN -> [SKIP][77] ([fdo#109289]) +1 other test skip
   [77]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-mtlp-5/igt@gen7_exec_parse@basic-offset.html

  * igt@gen9_exec_parse@basic-rejected:
    - shard-mtlp:         NOTRUN -> [SKIP][78] ([i915#2856])
   [78]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-mtlp-6/igt@gen9_exec_parse@basic-rejected.html

  * igt@i915_pm_rps@waitboost:
    - shard-mtlp:         NOTRUN -> [FAIL][79] ([i915#8346])
   [79]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-mtlp-5/igt@i915_pm_rps@waitboost.html

  * igt@kms_big_fb@4-tiled-16bpp-rotate-90:
    - shard-mtlp:         NOTRUN -> [SKIP][80] ([fdo#111614]) +1 other test skip
   [80]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-mtlp-6/igt@kms_big_fb@4-tiled-16bpp-rotate-90.html

  * igt@kms_big_fb@linear-8bpp-rotate-90:
    - shard-dg2:          NOTRUN -> [SKIP][81] ([fdo#111614])
   [81]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-dg2-3/igt@kms_big_fb@linear-8bpp-rotate-90.html

  * igt@kms_ccs@pipe-a-bad-aux-stride-y-tiled-gen12-mc-ccs:
    - shard-dg2:          NOTRUN -> [SKIP][82] ([i915#5354]) +1 other test skip
   [82]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-dg2-3/igt@kms_ccs@pipe-a-bad-aux-stride-y-tiled-gen12-mc-ccs.html

  * igt@kms_ccs@pipe-a-ccs-on-another-bo-y-tiled-ccs:
    - shard-mtlp:         NOTRUN -> [SKIP][83] ([i915#5354] / [i915#6095]) +5 other tests skip
   [83]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-mtlp-5/igt@kms_ccs@pipe-a-ccs-on-another-bo-y-tiled-ccs.html

  * igt@kms_ccs@pipe-b-crc-primary-rotation-180-yf-tiled-ccs:
    - shard-rkl:          NOTRUN -> [SKIP][84] ([i915#5354] / [i915#6095]) +1 other test skip
   [84]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-rkl-5/igt@kms_ccs@pipe-b-crc-primary-rotation-180-yf-tiled-ccs.html

  * igt@kms_chamelium_frames@dp-crc-single:
    - shard-mtlp:         NOTRUN -> [SKIP][85] ([i915#7828]) +1 other test skip
   [85]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-mtlp-6/igt@kms_chamelium_frames@dp-crc-single.html

  * igt@kms_chamelium_frames@vga-frame-dump:
    - shard-rkl:          NOTRUN -> [SKIP][86] ([i915#7828])
   [86]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-rkl-5/igt@kms_chamelium_frames@vga-frame-dump.html

  * igt@kms_content_protection@srm@pipe-a-dp-4:
    - shard-dg2:          NOTRUN -> [TIMEOUT][87] ([i915#7173])
   [87]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-dg2-11/igt@kms_content_protection@srm@pipe-a-dp-4.html

  * igt@kms_cursor_crc@cursor-sliding-32x10:
    - shard-dg2:          NOTRUN -> [SKIP][88] ([i915#3555])
   [88]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-dg2-3/igt@kms_cursor_crc@cursor-sliding-32x10.html

  * igt@kms_cursor_legacy@cursora-vs-flipb-legacy:
    - shard-rkl:          NOTRUN -> [SKIP][89] ([fdo#111825]) +1 other test skip
   [89]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-rkl-5/igt@kms_cursor_legacy@cursora-vs-flipb-legacy.html

  * igt@kms_cursor_legacy@cursorb-vs-flipb-atomic-transitions:
    - shard-snb:          [PASS][90] -> [SKIP][91] ([fdo#109271] / [fdo#111767])
   [90]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14022/shard-snb7/igt@kms_cursor_legacy@cursorb-vs-flipb-atomic-transitions.html
   [91]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-snb1/igt@kms_cursor_legacy@cursorb-vs-flipb-atomic-transitions.html

  * igt@kms_dirtyfb@fbc-dirtyfb-ioctl@a-hdmi-a-1:
    - shard-dg2:          NOTRUN -> [SKIP][92] ([i915#9227])
   [92]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-dg2-10/igt@kms_dirtyfb@fbc-dirtyfb-ioctl@a-hdmi-a-1.html

  * igt@kms_flip@2x-absolute-wf_vblank:
    - shard-mtlp:         NOTRUN -> [SKIP][93] ([i915#3637]) +1 other test skip
   [93]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-mtlp-6/igt@kms_flip@2x-absolute-wf_vblank.html

  * igt@kms_flip@2x-flip-vs-rmfb-interruptible:
    - shard-rkl:          NOTRUN -> [SKIP][94] ([fdo#111767] / [fdo#111825])
   [94]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-rkl-5/igt@kms_flip@2x-flip-vs-rmfb-interruptible.html

  * igt@kms_flip_scaled_crc@flip-64bpp-yftile-to-16bpp-yftile-upscaling@pipe-a-valid-mode:
    - shard-rkl:          NOTRUN -> [SKIP][95] ([i915#2672])
   [95]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-rkl-5/igt@kms_flip_scaled_crc@flip-64bpp-yftile-to-16bpp-yftile-upscaling@pipe-a-valid-mode.html

  * igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-mmap-wc:
    - shard-dg2:          NOTRUN -> [SKIP][96] ([i915#8708])
   [96]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-dg2-3/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-mmap-wc.html

  * igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-pri-indfb-draw-mmap-gtt:
    - shard-snb:          [PASS][97] -> [SKIP][98] ([fdo#109271]) +5 other tests skip
   [97]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14022/shard-snb7/igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-pri-indfb-draw-mmap-gtt.html
   [98]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-snb1/igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-pri-indfb-draw-mmap-gtt.html

  * igt@kms_frontbuffer_tracking@fbcpsr-2p-primscrn-cur-indfb-draw-render:
    - shard-rkl:          NOTRUN -> [SKIP][99] ([fdo#111825] / [i915#1825])
   [99]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-rkl-5/igt@kms_frontbuffer_tracking@fbcpsr-2p-primscrn-cur-indfb-draw-render.html

  * igt@kms_frontbuffer_tracking@psr-2p-scndscrn-pri-indfb-draw-render:
    - shard-mtlp:         NOTRUN -> [SKIP][100] ([i915#1825]) +7 other tests skip
   [100]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-mtlp-5/igt@kms_frontbuffer_tracking@psr-2p-scndscrn-pri-indfb-draw-render.html

  * igt@kms_frontbuffer_tracking@psr-modesetfrombusy:
    - shard-rkl:          NOTRUN -> [SKIP][101] ([i915#3023])
   [101]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-rkl-5/igt@kms_frontbuffer_tracking@psr-modesetfrombusy.html

  * igt@kms_pipe_b_c_ivb@enable-pipe-c-while-b-has-3-lanes:
    - shard-rkl:          NOTRUN -> [SKIP][102] ([fdo#109289])
   [102]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-rkl-5/igt@kms_pipe_b_c_ivb@enable-pipe-c-while-b-has-3-lanes.html

  * igt@kms_plane_scaling@plane-scaler-with-clipping-clamping-rotation@pipe-a-hdmi-a-3:
    - shard-dg1:          NOTRUN -> [SKIP][103] ([i915#5176] / [i915#9423]) +3 other tests skip
   [103]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-dg1-12/igt@kms_plane_scaling@plane-scaler-with-clipping-clamping-rotation@pipe-a-hdmi-a-3.html

  * igt@kms_plane_scaling@planes-downscale-factor-0-25-unity-scaling@pipe-b-hdmi-a-1:
    - shard-rkl:          NOTRUN -> [SKIP][104] ([i915#5235]) +1 other test skip
   [104]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-rkl-2/igt@kms_plane_scaling@planes-downscale-factor-0-25-unity-scaling@pipe-b-hdmi-a-1.html

  * igt@kms_plane_scaling@planes-downscale-factor-0-25-unity-scaling@pipe-c-hdmi-a-3:
    - shard-dg1:          NOTRUN -> [SKIP][105] ([i915#5235]) +3 other tests skip
   [105]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-dg1-13/igt@kms_plane_scaling@planes-downscale-factor-0-25-unity-scaling@pipe-c-hdmi-a-3.html

  * igt@kms_pm_rpm@dpms-non-lpsp:
    - shard-mtlp:         NOTRUN -> [SKIP][106] ([i915#9519])
   [106]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-mtlp-5/igt@kms_pm_rpm@dpms-non-lpsp.html

  * igt@kms_pm_rpm@modeset-non-lpsp-stress:
    - shard-dg2:          [PASS][107] -> [SKIP][108] ([i915#9519])
   [107]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14022/shard-dg2-3/igt@kms_pm_rpm@modeset-non-lpsp-stress.html
   [108]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-dg2-10/igt@kms_pm_rpm@modeset-non-lpsp-stress.html

  * igt@kms_psr2_sf@overlay-plane-update-sf-dmg-area:
    - shard-rkl:          NOTRUN -> [SKIP][109] ([fdo#111068] / [i915#9683])
   [109]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-rkl-5/igt@kms_psr2_sf@overlay-plane-update-sf-dmg-area.html

  * igt@kms_psr2_su@page_flip-nv12:
    - shard-dg2:          NOTRUN -> [SKIP][110] ([i915#9683])
   [110]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-dg2-3/igt@kms_psr2_su@page_flip-nv12.html

  * igt@perf@gen12-mi-rpc@rcs0:
    - shard-dg2:          NOTRUN -> [ABORT][111] ([i915#9847]) +2 other tests abort
   [111]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-dg2-7/igt@perf@gen12-mi-rpc@rcs0.html

  * igt@perf@invalid-oa-metric-set-id:
    - shard-rkl:          NOTRUN -> [ABORT][112] ([i915#9847])
   [112]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-rkl-6/igt@perf@invalid-oa-metric-set-id.html

  * igt@perf@polling-parameterized:
    - shard-glk:          NOTRUN -> [ABORT][113] ([i915#9847])
   [113]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-glk1/igt@perf@polling-parameterized.html

  * igt@perf_pmu@faulting-read:
    - shard-snb:          NOTRUN -> [INCOMPLETE][114] ([i915#9853])
   [114]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-snb5/igt@perf_pmu@faulting-read.html

  * igt@perf_pmu@init-wait:
    - shard-dg2:          NOTRUN -> [INCOMPLETE][115] ([i915#9853])
   [115]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-dg2-6/igt@perf_pmu@init-wait.html

  * igt@prime_vgem@fence-read-hang:
    - shard-mtlp:         NOTRUN -> [SKIP][116] ([i915#3708])
   [116]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-mtlp-5/igt@prime_vgem@fence-read-hang.html

  * igt@v3d/v3d_get_param@base-params:
    - shard-mtlp:         NOTRUN -> [SKIP][117] ([i915#2575]) +2 other tests skip
   [117]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-mtlp-5/igt@v3d/v3d_get_param@base-params.html

  * igt@vc4/vc4_wait_bo@bad-bo:
    - shard-mtlp:         NOTRUN -> [SKIP][118] ([i915#7711])
   [118]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-mtlp-5/igt@vc4/vc4_wait_bo@bad-bo.html

  
#### Possible fixes ####

  * igt@kms_cursor_legacy@cursora-vs-flipb-legacy:
    - shard-snb:          [SKIP][119] ([fdo#109271]) -> [PASS][120]
   [119]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14022/shard-snb4/igt@kms_cursor_legacy@cursora-vs-flipb-legacy.html
   [120]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-snb7/igt@kms_cursor_legacy@cursora-vs-flipb-legacy.html

  
#### Warnings ####

  * igt@gem_exec_balancer@full-late:
    - shard-glk:          [ABORT][121] ([i915#9855] / [i915#9856]) -> [INCOMPLETE][122] ([i915#9856])
   [121]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14022/shard-glk1/igt@gem_exec_balancer@full-late.html
   [122]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-glk9/igt@gem_exec_balancer@full-late.html

  * igt@gem_exec_balancer@nop:
    - shard-rkl:          [INCOMPLETE][123] ([i915#9856]) -> [ABORT][124] ([i915#9855] / [i915#9856])
   [123]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14022/shard-rkl-7/igt@gem_exec_balancer@nop.html
   [124]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-rkl-5/igt@gem_exec_balancer@nop.html

  * igt@gem_exec_balancer@smoke:
    - shard-dg1:          [ABORT][125] ([i915#9856]) -> [INCOMPLETE][126] ([i915#9856])
   [125]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14022/shard-dg1-13/igt@gem_exec_balancer@smoke.html
   [126]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-dg1-16/igt@gem_exec_balancer@smoke.html

  * igt@i915_pm_rps@engine-order:
    - shard-rkl:          [INCOMPLETE][127] -> [ABORT][128] ([i915#9847])
   [127]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14022/shard-rkl-1/igt@i915_pm_rps@engine-order.html
   [128]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-rkl-5/igt@i915_pm_rps@engine-order.html

  * igt@kms_content_protection@atomic:
    - shard-snb:          [INCOMPLETE][129] ([i915#8816]) -> [SKIP][130] ([fdo#109271])
   [129]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14022/shard-snb7/igt@kms_content_protection@atomic.html
   [130]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-snb1/igt@kms_content_protection@atomic.html

  * igt@kms_fbcon_fbt@psr:
    - shard-rkl:          [SKIP][131] ([i915#3955]) -> [SKIP][132] ([fdo#110189] / [i915#3955])
   [131]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14022/shard-rkl-6/igt@kms_fbcon_fbt@psr.html
   [132]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-rkl-1/igt@kms_fbcon_fbt@psr.html

  * igt@kms_fbcon_fbt@psr-suspend:
    - shard-rkl:          [SKIP][133] ([fdo#110189] / [i915#3955]) -> [SKIP][134] ([i915#3955])
   [133]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14022/shard-rkl-1/igt@kms_fbcon_fbt@psr-suspend.html
   [134]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-rkl-6/igt@kms_fbcon_fbt@psr-suspend.html

  * igt@perf_pmu@gt-awake:
    - shard-glk:          [INCOMPLETE][135] ([i915#9853]) -> [ABORT][136] ([i915#9847] / [i915#9853])
   [135]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14022/shard-glk4/igt@perf_pmu@gt-awake.html
   [136]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-glk1/igt@perf_pmu@gt-awake.html
    - shard-dg2:          [ABORT][137] ([i915#9847] / [i915#9853]) -> [INCOMPLETE][138] ([i915#9853])
   [137]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14022/shard-dg2-7/igt@perf_pmu@gt-awake.html
   [138]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-dg2-1/igt@perf_pmu@gt-awake.html

  * igt@perf_pmu@module-unload:
    - shard-dg1:          [ABORT][139] ([i915#9847] / [i915#9853]) -> [INCOMPLETE][140] ([i915#9853])
   [139]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14022/shard-dg1-13/igt@perf_pmu@module-unload.html
   [140]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-dg1-18/igt@perf_pmu@module-unload.html

  * igt@perf_pmu@most-busy-idle-check-all@rcs0:
    - shard-rkl:          [INCOMPLETE][141] ([i915#9853]) -> [ABORT][142] ([i915#9847] / [i915#9853])
   [141]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14022/shard-rkl-2/igt@perf_pmu@most-busy-idle-check-all@rcs0.html
   [142]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-rkl-6/igt@perf_pmu@most-busy-idle-check-all@rcs0.html
    - shard-dg1:          [INCOMPLETE][143] ([i915#9853]) -> [ABORT][144] ([i915#9847] / [i915#9853])
   [143]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14022/shard-dg1-15/igt@perf_pmu@most-busy-idle-check-all@rcs0.html
   [144]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-dg1-13/igt@perf_pmu@most-busy-idle-check-all@rcs0.html

  * igt@perf_pmu@semaphore-wait@rcs0:
    - shard-dg2:          [INCOMPLETE][145] ([i915#9853]) -> [ABORT][146] ([i915#9847] / [i915#9853]) +1 other test abort
   [145]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14022/shard-dg2-1/igt@perf_pmu@semaphore-wait@rcs0.html
   [146]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-dg2-7/igt@perf_pmu@semaphore-wait@rcs0.html
    - shard-rkl:          [ABORT][147] ([i915#9847] / [i915#9853]) -> [INCOMPLETE][148] ([i915#9853]) +1 other test incomplete
   [147]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14022/shard-rkl-5/igt@perf_pmu@semaphore-wait@rcs0.html
   [148]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115769v3/shard-rkl-7/igt@perf_pmu@semaphore-wait@rcs0.html

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109289]: https://bugs.freedesktop.org/show_bug.cgi?id=109289
  [fdo#110189]: https://bugs.freedesktop.org/show_bug.cgi?id=110189
  [fdo#111068]: https://bugs.freedesktop.org/show_bug.cgi?id=111068
  [fdo#111614]: https://bugs.freedesktop.org/show_bug.cgi?id=111614
  [fdo#111767]: https://bugs.freedesktop.org/show_bug.cgi?id=111767
  [fdo#111825]: https://bugs.freedesktop.org/show_bug.cgi?id=111825
  [i915#1825]: https://gitlab.freedesktop.org/drm/intel/issues/1825
  [i915#2575]: https://gitlab.freedesktop.org/drm/intel/issues/2575
  [i915#2672]: https://gitlab.freedesktop.org/drm/intel/issues/2672
  [i915#2856]: https://gitlab.freedesktop.org/drm/intel/issues/2856
  [i915#3023]: https://gitlab.freedesktop.org/drm/intel/issues/3023
  [i915#3281]: https://gitlab.freedesktop.org/drm/intel/issues/3281
  [i915#3282]: https://gitlab.freedesktop.org/drm/intel/issues/3282
  [i915#3555]: https://gitlab.freedesktop.org/drm/intel/issues/3555
  [i915#3637]: https://gitlab.freedesktop.org/drm/intel/issues/3637
  [i915#3708]: https://gitlab.freedesktop.org/drm/intel/issues/3708
  [i915#3955]: https://gitlab.freedesktop.org/drm/intel/issues/3955
  [i915#4077]: https://gitlab.freedesktop.org/drm/intel/issues/4077
  [i915#4079]: https://gitlab.freedesktop.org/drm/intel/issues/4079
  [i915#4083]: https://gitlab.freedesktop.org/drm/intel/issues/4083
  [i915#4270]: https://gitlab.freedesktop.org/drm/intel/issues/4270
  [i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
  [i915#5176]: https://gitlab.freedesktop.org/drm/intel/issues/5176
  [i915#5235]: https://gitlab.freedesktop.org/drm/intel/issues/5235
  [i915#5354]: https://gitlab.freedesktop.org/drm/intel/issues/5354
  [i915#6095]: https://gitlab.freedesktop.org/drm/intel/issues/6095
  [i915#7173]: https://gitlab.freedesktop.org/drm/intel/issues/7173
  [i915#7392]: https://gitlab.freedesktop.org/drm/intel/issues/7392
  [i915#7711]: https://gitlab.freedesktop.org/drm/intel/issues/7711
  [i915#7828]: https://gitlab.freedesktop.org/drm/intel/issues/7828
  [i915#8293]: https://gitlab.freedesktop.org/drm/intel/issues/8293
  [i915#8346]: https://gitlab.freedesktop.org/drm/intel/issues/8346
  [i915#8428]: https://gitlab.freedesktop.org/drm/intel/issues/8428
  [i915#8708]: https://gitlab.freedesktop.org/drm/intel/issues/8708
  [i915#8816]: https://gitlab.freedesktop.org/drm/intel/issues/8816
  [i915#9227]: https://gitlab.freedesktop.org/drm/intel/issues/9227
  [i915#9423]: https://gitlab.freedesktop.org/drm/intel/issues/9423
  [i915#9519]: https://gitlab.freedesktop.org/drm/intel/issues/9519
  [i915#9673]: https://gitlab.freedesktop.org/drm/intel/issues/9673
  [i915#9683]: https://gitlab.freedesktop.org/drm/intel/issues/9683
  [i915#9688]: https://gitlab.freedesktop.org/drm/intel/issues/9688
  [i915#9732]: https://gitlab.freedesktop.org/drm/intel/issues/9732
  [i915#9847]: https://gitlab.freedesktop.org/drm/intel/issues/9847
  [i915#9853]: https://gitlab.freedesktop.org/drm/intel/issues/9853
  [i915#9855]: https://gitlab.freedesktop.org/drm/intel/issues/9855
  [i915#9856]: https://gitlab.freedesktop.org/drm/intel/issues/9856
  [i915#9857]: https://gitlab.freedesktop.org/drm/intel/issues/9857
  [i915#9860]: https://gitlab.freedesktop.org/drm/intel/issues/9860


Build changes
-------------

  * Linux: CI_DRM_14022 -> Patchwork_115769v3

  CI-20190529: 20190529
  CI_DRM_14022: 87fdea3fd86a02e2e7855e372c0d3fb32e53e4e6 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_7643: ced22f8bf4263ff395dc852c86b682e62a7a1c1b @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
  Patchwork_115769v3: 87fdea3fd86a02e2e7855e372c0d3fb32e53e4e6 @ 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_115769v3/index.html

[-- Attachment #2: Type: text/html, Size: 38250 bytes --]

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [PATCH v3 0/9] drm/i915: Replace kmap_atomic() with kmap_local_page()
  2023-12-14 15:04         ` Zhao Liu
  (?)
@ 2023-12-15  9:37           ` Tvrtko Ursulin
  -1 siblings, 0 replies; 49+ messages in thread
From: Tvrtko Ursulin @ 2023-12-15  9:37 UTC (permalink / raw)
  To: Zhao Liu
  Cc: Zhenyu Wang, intel-gfx, linux-kernel, Dave Hansen, dri-devel,
	Rodrigo Vivi, Ira Weiny, Zhao Liu, Fabio M . De Francesco


On 14/12/2023 15:04, Zhao Liu wrote:
> On Thu, Dec 14, 2023 at 02:35:26PM +0000, Tvrtko Ursulin wrote:
>> Date: Thu, 14 Dec 2023 14:35:26 +0000
>> From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
>> Subject: Re: [PATCH v3 0/9] drm/i915: Replace kmap_atomic() with
>>   kmap_local_page()
>>
>>
>> On 14/12/2023 13:45, Tvrtko Ursulin wrote:
>>>
>>> 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 certainly spotted your series last week or so but then it slipped my
>>> mind to go through it. Should be able to go through it today or
>>> tomorrow.
>>
>> It all looks good to me. I only needed to queue a re-test in our CI since v3
>> failed BAT, but pretty sure it wasn't at fault. Once I am satisfied with the
>> results I will merge the series. Thanks for the cleanups and your patience!
>>
>> Regards,
>>
>> Tvrtko
>>
> 
> Thanks for your review!

Pushed to drm-intel-gt-next, thanks again!

Regards,

Tvrtko

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [PATCH v3 0/9] drm/i915: Replace kmap_atomic() with kmap_local_page()
@ 2023-12-15  9:37           ` Tvrtko Ursulin
  0 siblings, 0 replies; 49+ messages in thread
From: Tvrtko Ursulin @ 2023-12-15  9:37 UTC (permalink / raw)
  To: Zhao Liu
  Cc: Zhenyu Wang, David Airlie, intel-gfx, linux-kernel, Dave Hansen,
	dri-devel, Daniel Vetter, Rodrigo Vivi, Ira Weiny, Zhao Liu,
	Fabio M . De Francesco


On 14/12/2023 15:04, Zhao Liu wrote:
> On Thu, Dec 14, 2023 at 02:35:26PM +0000, Tvrtko Ursulin wrote:
>> Date: Thu, 14 Dec 2023 14:35:26 +0000
>> From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
>> Subject: Re: [PATCH v3 0/9] drm/i915: Replace kmap_atomic() with
>>   kmap_local_page()
>>
>>
>> On 14/12/2023 13:45, Tvrtko Ursulin wrote:
>>>
>>> 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 certainly spotted your series last week or so but then it slipped my
>>> mind to go through it. Should be able to go through it today or
>>> tomorrow.
>>
>> It all looks good to me. I only needed to queue a re-test in our CI since v3
>> failed BAT, but pretty sure it wasn't at fault. Once I am satisfied with the
>> results I will merge the series. Thanks for the cleanups and your patience!
>>
>> Regards,
>>
>> Tvrtko
>>
> 
> Thanks for your review!

Pushed to drm-intel-gt-next, thanks again!

Regards,

Tvrtko

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [PATCH v3 0/9] drm/i915: Replace kmap_atomic() with kmap_local_page()
@ 2023-12-15  9:37           ` Tvrtko Ursulin
  0 siblings, 0 replies; 49+ messages in thread
From: Tvrtko Ursulin @ 2023-12-15  9:37 UTC (permalink / raw)
  To: Zhao Liu
  Cc: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, David Airlie,
	Daniel Vetter, Ira Weiny, Fabio M . De Francesco, intel-gfx,
	dri-devel, linux-kernel, Dave Hansen, Zhenyu Wang, Zhao Liu


On 14/12/2023 15:04, Zhao Liu wrote:
> On Thu, Dec 14, 2023 at 02:35:26PM +0000, Tvrtko Ursulin wrote:
>> Date: Thu, 14 Dec 2023 14:35:26 +0000
>> From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
>> Subject: Re: [PATCH v3 0/9] drm/i915: Replace kmap_atomic() with
>>   kmap_local_page()
>>
>>
>> On 14/12/2023 13:45, Tvrtko Ursulin wrote:
>>>
>>> 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 certainly spotted your series last week or so but then it slipped my
>>> mind to go through it. Should be able to go through it today or
>>> tomorrow.
>>
>> It all looks good to me. I only needed to queue a re-test in our CI since v3
>> failed BAT, but pretty sure it wasn't at fault. Once I am satisfied with the
>> results I will merge the series. Thanks for the cleanups and your patience!
>>
>> Regards,
>>
>> Tvrtko
>>
> 
> Thanks for your review!

Pushed to drm-intel-gt-next, thanks again!

Regards,

Tvrtko

^ permalink raw reply	[flat|nested] 49+ messages in thread

end of thread, other threads:[~2023-12-15  9:37 UTC | newest]

Thread overview: 49+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-03 13:29 [PATCH v3 0/9] drm/i915: Replace kmap_atomic() with kmap_local_page() Zhao Liu
2023-12-03 13:29 ` [Intel-gfx] " Zhao Liu
2023-12-03 13:29 ` Zhao Liu
2023-12-03 13:29 ` [PATCH v3 1/9] drm/i915: Use kmap_local_page() in gem/i915_gem_object.c Zhao Liu
2023-12-03 13:29   ` [Intel-gfx] " Zhao Liu
2023-12-03 13:29   ` Zhao Liu
2023-12-03 13:29 ` [PATCH v3 2/9] drm/i915: Use memcpy_[from/to]_page() in gem/i915_gem_pyhs.c Zhao Liu
2023-12-03 13:29   ` [Intel-gfx] " Zhao Liu
2023-12-03 13:29   ` Zhao Liu
2023-12-03 13:29 ` [PATCH v3 3/9] drm/i915: Use kmap_local_page() in gem/i915_gem_shmem.c Zhao Liu
2023-12-03 13:29   ` [Intel-gfx] " Zhao Liu
2023-12-03 13:29   ` Zhao Liu
2023-12-03 13:29 ` [PATCH v3 4/9] drm/i915: Use kmap_local_page() in gem/selftests/huge_pages.c Zhao Liu
2023-12-03 13:29   ` [Intel-gfx] " Zhao Liu
2023-12-03 13:29   ` Zhao Liu
2023-12-03 13:29 ` [PATCH v3 5/9] drm/i915: Use kmap_local_page() in gem/selftests/i915_gem_coherency.c Zhao Liu
2023-12-03 13:29   ` [Intel-gfx] " Zhao Liu
2023-12-03 13:29   ` Zhao Liu
2023-12-03 13:29 ` [PATCH v3 6/9] drm/i915: Use kmap_local_page() in gem/selftests/i915_gem_context.c Zhao Liu
2023-12-03 13:29   ` [Intel-gfx] " Zhao Liu
2023-12-03 13:29   ` Zhao Liu
2023-12-03 13:29 ` [PATCH v3 7/9] drm/i915: Use memcpy_from_page() in gt/uc/intel_uc_fw.c Zhao Liu
2023-12-03 13:29   ` [Intel-gfx] " Zhao Liu
2023-12-03 13:29   ` Zhao Liu
2023-12-03 13:29 ` [PATCH v3 8/9] drm/i915: Use kmap_local_page() in i915_cmd_parser.c Zhao Liu
2023-12-03 13:29   ` [Intel-gfx] " Zhao Liu
2023-12-03 13:29   ` Zhao Liu
2023-12-03 13:29 ` [PATCH v3 9/9] drm/i915: Use kmap_local_page() in gem/i915_gem_execbuffer.c Zhao Liu
2023-12-03 13:29   ` [Intel-gfx] " Zhao Liu
2023-12-03 13:29   ` Zhao Liu
2023-12-03 13:59 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Replace kmap_atomic() with kmap_local_page() (rev2) Patchwork
2023-12-03 13:59 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2023-12-03 14:17 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2023-12-14 13:19 ` [PATCH v3 0/9] drm/i915: Replace kmap_atomic() with kmap_local_page() Zhao Liu
2023-12-14 13:19   ` Zhao Liu
2023-12-14 13:45   ` Tvrtko Ursulin
2023-12-14 13:45     ` Tvrtko Ursulin
2023-12-14 14:35     ` Tvrtko Ursulin
2023-12-14 14:35       ` Tvrtko Ursulin
2023-12-14 15:04       ` Zhao Liu
2023-12-14 15:04         ` Zhao Liu
2023-12-14 15:04         ` Zhao Liu
2023-12-15  9:37         ` Tvrtko Ursulin
2023-12-15  9:37           ` Tvrtko Ursulin
2023-12-15  9:37           ` Tvrtko Ursulin
2023-12-14 19:04 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Replace kmap_atomic() with kmap_local_page() (rev3) Patchwork
2023-12-14 19:04 ` ✗ Fi.CI.SPARSE: " Patchwork
2023-12-14 19:51 ` ✓ Fi.CI.BAT: success " Patchwork
2023-12-14 20:47 ` ✓ Fi.CI.IGT: " Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.