Skip to contentSkip to conversation

drm/i915: Replace kmap_atomic() with kmap_local_page()

PATCH Superseded Zhao Liu 4 participants 32 messages Oct 17, 2022 – Feb 16, 2023

Subsystems (4)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Zhao Liu

author
#0 lore raw

cover drm/i915: Replace kmap_atomic() with kmap_local_page()

From: Zhao Liu <[email protected]>

The use of kmap_atomic() is being deprecated in favor of kmap_local_page()[1].

In the following patches, we can convert the calls of kmap_atomic() / kunmap_atomic() to kmap_local_page() / kunmap_local(), which can instead do the mapping / unmapping regardless of the context.

With kmap_local_page(), the mapping is per thread, CPU local and not globally visible.

[1]: https://lore.kernel.org/all/[email protected]
---
Zhao Liu (9):
drm/i915: Use kmap_local_page() in gem/i915_gem_object.c drm/i915: Use kmap_local_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             |  8 ++++----
 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, 30 insertions(+), 37 deletions(-)
Signature · 1 line
2.34.1
author
#1 lore raw

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

From: Zhao Liu <[email protected]>

The use of kmap_atomic() is being deprecated in favor of kmap_local_page()[1].

The main difference between atomic and local mappings is that local mappings doesn't disable page faults or preemption.

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

1. The flush operation is safe for CPU hotplug when preemption is not disabled. In drm/i915/gem/i915_gem_object.c, the function 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 and any issue with cpu's being added or removed can be handled safely.

2. Any context switch caused by preemption or sleep (pagefault 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/[email protected]

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

---
 drivers/gpu/drm/i915/gem/i915_gem_object.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_object.c +3 -5
index 369006c5317f..a0072abed75e 100644
@@ -413,17 +413,15 @@ void __i915_gem_object_invalidate_frontbuffer(struct drm_i915_gem_object *obj,
 static void
 i915_gem_object_read_from_page_kmap(struct drm_i915_gem_object *obj, u64 offset, void *dst, int size)
 {
-	void *src_map;
 	void *src_ptr;
 
-	src_map = kmap_atomic(i915_gem_object_get_page(obj, offset >> PAGE_SHIFT));
-
-	src_ptr = src_map + offset_in_page(offset);
+	src_ptr = kmap_local_page(i915_gem_object_get_page(obj, offset >> PAGE_SHIFT))
+	          + 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
Signature · 1 line
2.34.1
#2 lore raw

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

Quoted 7 lines · On lunedì 17 ottobre 2022 11:37:17 CEST Zhao Liu wrote:

From: Zhao Liu <[email protected]>

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.

You are right about about page faults which are never disabled by kmap_local_page(). However kmap_atomic might not disable preemption. It depends on CONFIG_PREEMPT_RT.

Please refer to how kmap_atomic_prot() works (this function is called by kmap_atomic() when kernels have HIGHMEM enabled).

Quoted 6 lines

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 for CPU hotplug when preemption is not disabled.

I'm confused here. Why are you talking about CPU hotplug?
In any case, developers should never rely on implicit calls of preempt_disable() for the reasons said above. Therefore, flush operations should be allowed regardless that kmap_atomic() potential side effect.

Quoted 2 lines

In drm/i915/gem/i915_gem_object.c, the function i915_gem_object_read_from_page_kmap() calls drm_clflush_virt_range()

If I recall correctly, drm_clflush_virt_range() can always be called with page faults and preemption enabled. If so, this is enough to say that the conversion is safe.

Is this code explicitly related to flushing the cache lines before removing / adding CPUs? If I recall correctly, there are several other reasons behind the need to issue cache lines flushes. Am I wrong about this?

Can you please say more about what I'm missing here?

Quoted 5 lines

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 and any issue with cpu's being added or removed can be handled safely.

Again your main concern is about CPU hotplug.

Even if I'm missing something, do we really need all these details about the inner workings of drm_clflush_virt_range()?

I'm not an expert, so may be that I'm wrong about all I wrote above.

Therefore, can you please elaborate a little more for readers with very little knowledge of these kinds of things (like me and perhaps others)?

Quoted 2 lines

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

I'd replace "preemption or sleep" with "preemption and page faults" since yourself then added that page faults lead to tasks being put to sleep.

Quoted 22 lines

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/[email protected]

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

Quoted 6 lines
---
 drivers/gpu/drm/i915/gem/i915_gem_object.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
(quoted diff) +0 -0

b/drivers/gpu/drm/i915/gem/i915_gem_object.c index

369006c5317f..a0072abed75e 100644

Quoted 5 lines
drivers/gpu/drm/i915/gem/i915_gem_object.c +0 -0
@@ -413,17 +413,15 @@ void __i915_gem_object_invalidate_frontbuffer(struct

drm_i915_gem_object *obj, static void
i915_gem_object_read_from_page_kmap(struct drm_i915_gem_object *obj, u64

offset, void

drivers/gpu/drm/i915/gem/i915_gem_object.c void __i915_gem_object_invalidate_frontbuffer(struct drm_i915_gem_object *obj,

Quoted 5 lines

*dst, int size) {

drivers/gpu/drm/i915/gem/i915_gem_object.c +0 -2
-	void *src_map;
 	void *src_ptr;
 
-	src_map = kmap_atomic(i915_gem_object_get_page(obj, offset >> 

PAGE_SHIFT));

drivers/gpu/drm/i915/gem/i915_gem_object.c void __i915_gem_object_invalidate_frontbuffer(struct drm_i915_gem_object *obj,

Quoted 3 lines
drivers/gpu/drm/i915/gem/i915_gem_object.c +1 -2
-
-	src_ptr = src_map + offset_in_page(offset);
+	src_ptr = kmap_local_page(i915_gem_object_get_page(obj, offset >> 

PAGE_SHIFT))

drivers/gpu/drm/i915/gem/i915_gem_object.c void __i915_gem_object_invalidate_frontbuffer(struct drm_i915_gem_object *obj, · line 427

Quoted 10 lines
drivers/gpu/drm/i915/gem/i915_gem_object.c +2 -1
+	          + 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

The changes look good, but I'd like to better understand the commit message.

Thanks,

Fabio

#3 lore raw

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

Quoted 17 lines · Fabio M. De Francesco
Quoted 7 lines · On lunedì 17 ottobre 2022 11:37:17 CEST Zhao Liu wrote:

From: Zhao Liu <[email protected]>

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.

You are right about about page faults which are never disabled by kmap_local_page(). However kmap_atomic might not disable preemption. It depends on CONFIG_PREEMPT_RT.

Please refer to how kmap_atomic_prot() works (this function is called by kmap_atomic() when kernels have HIGHMEM enabled).

Quoted 1 line
Quoted 7 lines
Quoted 5 lines

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 for CPU hotplug when preemption is not disabled.

I'm confused here. Why are you talking about CPU hotplug?

I agree with Fabio here. I'm not making the connection between cpu hotplug and this code path.

Ira

Quoted 102 lines

In any case, developers should never rely on implicit calls of preempt_disable() for the reasons said above. Therefore, flush operations should be allowed regardless that kmap_atomic() potential side effect.

Quoted 2 lines

In drm/i915/gem/i915_gem_object.c, the function i915_gem_object_read_from_page_kmap() calls drm_clflush_virt_range()

If I recall correctly, drm_clflush_virt_range() can always be called with page faults and preemption enabled. If so, this is enough to say that the conversion is safe.

Is this code explicitly related to flushing the cache lines before removing / adding CPUs? If I recall correctly, there are several other reasons behind the need to issue cache lines flushes. Am I wrong about this?

Can you please say more about what I'm missing here?

Quoted 5 lines

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 and any issue with cpu's being added or removed can be handled safely.

Again your main concern is about CPU hotplug.

Even if I'm missing something, do we really need all these details about the inner workings of drm_clflush_virt_range()?

I'm not an expert, so may be that I'm wrong about all I wrote above.

Therefore, can you please elaborate a little more for readers with very little knowledge of these kinds of things (like me and perhaps others)?

Quoted 2 lines

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

I'd replace "preemption or sleep" with "preemption and page faults" since yourself then added that page faults lead to tasks being put to sleep.

Quoted 22 lines

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/[email protected]

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

Quoted 6 lines
---
 drivers/gpu/drm/i915/gem/i915_gem_object.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
(quoted diff) +0 -0

b/drivers/gpu/drm/i915/gem/i915_gem_object.c index

369006c5317f..a0072abed75e 100644

Quoted 5 lines
drivers/gpu/drm/i915/gem/i915_gem_object.c +0 -0
@@ -413,17 +413,15 @@ void __i915_gem_object_invalidate_frontbuffer(struct

drm_i915_gem_object *obj, static void
i915_gem_object_read_from_page_kmap(struct drm_i915_gem_object *obj, u64

offset, void

drivers/gpu/drm/i915/gem/i915_gem_object.c void __i915_gem_object_invalidate_frontbuffer(struct drm_i915_gem_object *obj,

Quoted 5 lines

*dst, int size) {

drivers/gpu/drm/i915/gem/i915_gem_object.c +0 -2
-	void *src_map;
 	void *src_ptr;
 
-	src_map = kmap_atomic(i915_gem_object_get_page(obj, offset >> 

PAGE_SHIFT));

drivers/gpu/drm/i915/gem/i915_gem_object.c void __i915_gem_object_invalidate_frontbuffer(struct drm_i915_gem_object *obj,

Quoted 3 lines
drivers/gpu/drm/i915/gem/i915_gem_object.c +1 -2
-
-	src_ptr = src_map + offset_in_page(offset);
+	src_ptr = kmap_local_page(i915_gem_object_get_page(obj, offset >> 

PAGE_SHIFT))

drivers/gpu/drm/i915/gem/i915_gem_object.c void __i915_gem_object_invalidate_frontbuffer(struct drm_i915_gem_object *obj, · line 427

Quoted 10 lines
drivers/gpu/drm/i915/gem/i915_gem_object.c +2 -1
+	          + 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

The changes look good, but I'd like to better understand the commit message.

Thanks,

Fabio

#4 lore raw

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

Quoted 20 lines · On giovedì 3 novembre 2022 17:51:23 CET Ira Weiny wrote:
Quoted 19 lines · Fabio M. De Francesco
Quoted 7 lines · On lunedì 17 ottobre 2022 11:37:17 CEST Zhao Liu wrote:

From: Zhao Liu <[email protected]>

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.

You are right about about page faults which are never disabled by kmap_local_page(). However kmap_atomic might not disable preemption. It depends on CONFIG_PREEMPT_RT.

Please refer to how kmap_atomic_prot() works (this function is called by kmap_atomic() when kernels have HIGHMEM enabled).

Quoted 3 lines

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

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

1. The flush operation is safe for CPU hotplug when preemption is not disabled.

I'm confused here. Why are you talking about CPU hotplug?

I agree with Fabio here. I'm not making the connection between cpu hotplug

and

Quoted 3 lines

this code path.

Ira

@Zhao,

I'd like to add that I was about to put my reviewed-by tag. The other things I objected are minor nits. Please just clarify this connection.

Your code is good and deserves to be applied.

Fabio

Quoted 9 lines
Quoted 9 lines

In any case, developers should never rely on implicit calls of preempt_disable() for the reasons said above. Therefore, flush operations should be allowed regardless that kmap_atomic() potential side effect.

Quoted 2 lines

In drm/i915/gem/i915_gem_object.c, the function i915_gem_object_read_from_page_kmap() calls drm_clflush_virt_range()

If I recall correctly, drm_clflush_virt_range() can always be called with

page

Quoted 4 lines
Quoted 4 lines

faults and preemption enabled. If so, this is enough to say that the conversion is safe.

Is this code explicitly related to flushing the cache lines before

removing /

Quoted 1 line
Quoted 1 line

adding CPUs? If I recall correctly, there are several other reasons behind

the

Quoted 10 lines
Quoted 10 lines

need to issue cache lines flushes. Am I wrong about this?

Can you please say more about what I'm missing here?

Quoted 5 lines

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 and any issue with cpu's being added or removed can be handled safely.

Quoted 3 lines
Quoted 3 lines

Again your main concern is about CPU hotplug.

Even if I'm missing something, do we really need all these details about

the

Quoted 5 lines
Quoted 5 lines

inner workings of drm_clflush_virt_range()?

I'm not an expert, so may be that I'm wrong about all I wrote above.

Therefore, can you please elaborate a little more for readers with very

little

Quoted 26 lines
Quoted 26 lines

knowledge of these kinds of things (like me and perhaps others)?

Quoted 2 lines

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

I'd replace "preemption or sleep" with "preemption and page faults" since yourself then added that page faults lead to tasks being put to sleep.

Quoted 18 lines

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/[email protected]

---

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Suggested by credits:
Dave: Referred to his explanation about cache flush.
Ira: Referred to his task document, review comments and explanation

about

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines

cache flush.

Fabio: Referred to his boiler plate commit message.

---

 drivers/gpu/drm/i915/gem/i915_gem_object.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
Quoted 8 lines
Quoted 8 lines
Quoted 2 lines
(quoted diff) +0 -0

b/drivers/gpu/drm/i915/gem/i915_gem_object.c index

369006c5317f..a0072abed75e 100644

drivers/gpu/drm/i915/gem/i915_gem_object.c void

Quoted 3 lines
drivers/gpu/drm/i915/gem/i915_gem_object.c +0 -0
@@ -413,17 +413,15 @@ void 

__i915_gem_object_invalidate_frontbuffer(struct

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

drm_i915_gem_object *obj, static void

i915_gem_object_read_from_page_kmap(struct drm_i915_gem_object *obj,

u64

Quoted 26 lines
Quoted 26 lines

offset, void

drivers/gpu/drm/i915/gem/i915_gem_object.c void __i915_gem_object_invalidate_frontbuffer(struct drm_i915_gem_object *obj,

Quoted 6 lines

*dst, int size) {

drivers/gpu/drm/i915/gem/i915_gem_object.c +0 -2
-	void *src_map;
 
 	void *src_ptr;
 
-	src_map = kmap_atomic(i915_gem_object_get_page(obj, offset >>

PAGE_SHIFT));

drivers/gpu/drm/i915/gem/i915_gem_object.c void __i915_gem_object_invalidate_frontbuffer(struct drm_i915_gem_object *obj,

Quoted 3 lines
drivers/gpu/drm/i915/gem/i915_gem_object.c +1 -2
-
-	src_ptr = src_map + offset_in_page(offset);
+	src_ptr = kmap_local_page(i915_gem_object_get_page(obj, offset >>

PAGE_SHIFT))

Quoted 8 lines
drivers/gpu/drm/i915/gem/i915_gem_object.c +1 -0
+	          + 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);
Quoted 8 lines
Quoted 8 lines

drivers/gpu/drm/i915/gem/i915_gem_object.c void __i915_gem_object_invalidate_frontbuffer(struct drm_i915_gem_object *obj, · line 427

Quoted 6 lines
drivers/gpu/drm/i915/gem/i915_gem_object.c +1 -1
-	kunmap_atomic(src_map);
+	kunmap_local(src_ptr);
 
 }
 
 static void

The changes look good, but I'd like to better understand the commit

message.

Quoted 4 lines
Quoted 4 lines

Thanks,

Fabio

author
#5 lore raw

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

Quoted 33 lines · Fabio M. De Francesco

Date: Thu, 03 Nov 2022 20:22:04 +0100
From: "Fabio M. De Francesco" <[email protected]>
Subject: Re: [PATCH 1/9] drm/i915: Use kmap_local_page() in
gem/i915_gem_object.c

Quoted 20 lines · On gioved? 3 novembre 2022 17:51:23 CET Ira Weiny wrote:
Quoted 19 lines · Fabio M. De Francesco
Quoted 7 lines · On luned? 17 ottobre 2022 11:37:17 CEST Zhao Liu wrote:

From: Zhao Liu <[email protected]>

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.

You are right about about page faults which are never disabled by kmap_local_page(). However kmap_atomic might not disable preemption. It depends on CONFIG_PREEMPT_RT.

Please refer to how kmap_atomic_prot() works (this function is called by kmap_atomic() when kernels have HIGHMEM enabled).

Quoted 3 lines

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

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

1. The flush operation is safe for CPU hotplug when preemption is not disabled.

I'm confused here. Why are you talking about CPU hotplug?

I agree with Fabio here. I'm not making the connection between cpu hotplug

and

Quoted 8 lines
Quoted 3 lines

this code path.

Ira

@Zhao,

I'd like to add that I was about to put my reviewed-by tag. The other things I objected are minor nits. Please just clarify this connection.

Thanks Fabio for your comments! Sorry I missed the mails that day. This connection is my misunderstanding. Other thoughts please refer to my reply to your first email in this thread.

Thanks,
Zhao

author
#6 lore raw

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

In reply to Ira Weiny
Quoted 26 lines · Ira Weiny

Date: Thu, 3 Nov 2022 09:51:23 -0700
From: Ira Weiny <[email protected]>
Subject: Re: [PATCH 1/9] drm/i915: Use kmap_local_page() in
gem/i915_gem_object.c

Quoted 20 lines · Fabio M. De Francesco
Quoted 7 lines · On luned? 17 ottobre 2022 11:37:17 CEST Zhao Liu wrote:

From: Zhao Liu <[email protected]>

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.

You are right about about page faults which are never disabled by kmap_local_page(). However kmap_atomic might not disable preemption. It depends on CONFIG_PREEMPT_RT.

Please refer to how kmap_atomic_prot() works (this function is called by kmap_atomic() when kernels have HIGHMEM enabled).

Quoted 4 lines

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

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

1. The flush operation is safe for CPU hotplug when preemption is not disabled.

I'm confused here. Why are you talking about CPU hotplug?

I agree with Fabio here. I'm not making the connection between cpu hotplug and this code path.

Sorry, my misunderstanding. Will delete this wrong explanation.

Thanks,
Zhao

author
#7 lore raw

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

In reply to Fabio M. De Francesco
Quoted 14 lines · Fabio M. De Francesco

Date: Sat, 29 Oct 2022 13:17:03 +0200
From: "Fabio M. De Francesco" <[email protected]>
Subject: Re: [PATCH 1/9] drm/i915: Use kmap_local_page() in
gem/i915_gem_object.c

Quoted 7 lines · On luned? 17 ottobre 2022 11:37:17 CEST Zhao Liu wrote:

From: Zhao Liu <[email protected]>

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.

Quoted 6 lines

You are right about about page faults which are never disabled by kmap_local_page(). However kmap_atomic might not disable preemption. It depends on CONFIG_PREEMPT_RT.

Please refer to how kmap_atomic_prot() works (this function is called by kmap_atomic() when kernels have HIGHMEM enabled).

Yes, there is some ambiguity here. What about "The main difference between atomic and local mappings is that local mappings never disable page faults or preemption"?

Quoted 5 lines
Quoted 5 lines

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

Quoted 7 lines
Quoted 2 lines

1. The flush operation is safe for CPU hotplug when preemption is not disabled.

I'm confused here. Why are you talking about CPU hotplug?
In any case, developers should never rely on implicit calls of preempt_disable() for the reasons said above. Therefore, flush operations should be allowed regardless that kmap_atomic() potential side effect.

Sorry, it's my fault, my misunderstanding about the connection between hotplug and flush here. When mapping exists, the cpu cannot be unplugged via CPU-hotplug. But whether plug or unplug, it has nothing to do with flush. I will delete this wrong description.

My initial consideration is that this interface of flush may require an atomic context, so I want to explain more from the details of its implementation that cache consistency can be guaranteed without atomic context. Is this consideration redundant?
Also, do I need to state that migration is still ok for this flush interface here (since __kmap_local_page_prot() doesn't always disable migration)?

Quoted 26 lines
Quoted 2 lines

In drm/i915/gem/i915_gem_object.c, the function i915_gem_object_read_from_page_kmap() calls drm_clflush_virt_range()

If I recall correctly, drm_clflush_virt_range() can always be called with page faults and preemption enabled. If so, this is enough to say that the conversion is safe.

Is this code explicitly related to flushing the cache lines before removing / adding CPUs? If I recall correctly, there are several other reasons behind the need to issue cache lines flushes. Am I wrong about this?

Can you please say more about what I'm missing here?

Quoted 5 lines

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 and any issue with cpu's being added or removed can be handled safely.

Again your main concern is about CPU hotplug.

Even if I'm missing something, do we really need all these details about the inner workings of drm_clflush_virt_range()?

I'm not an expert, so may be that I'm wrong about all I wrote above.

Quoted 8 lines

Therefore, can you please elaborate a little more for readers with very little knowledge of these kinds of things (like me and perhaps others)?

Quoted 2 lines

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

I'd replace "preemption or sleep" with "preemption and page faults" since yourself then added that page faults lead to tasks being put to sleep.

Thanks, good advice.

Zhao

author
#8 lore raw

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

In reply to Zhao Liu

From: Zhao Liu <[email protected]>

The use of kmap_atomic() is being deprecated in favor of kmap_local_page()[1].

The main difference between atomic and local mappings is that local mappings doesn't disable page faults or preemption.

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

1. The flush operation is safe for CPU hotplug when preemption is not disabled. In drm/i915/gem/i915_gem_object.c, the functions 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 and any issue with cpu's being added or removed can be handled safely.

2. Any context switch caused by preemption or sleep (pagefault 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 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/[email protected]

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

---
 drivers/gpu/drm/i915/gem/i915_gem_phys.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_phys.c +4 -4
index 0d0e46dae559..d602ba19ecb2 100644
@@ -66,10 +66,10 @@ static int i915_gem_object_get_pages_phys(struct drm_i915_gem_object *obj)
 		if (IS_ERR(page))
 			goto err_st;
 
-		src = kmap_atomic(page);
+		src = kmap_local_page(page);
 		memcpy(dst, src, PAGE_SIZE);
 		drm_clflush_virt_range(dst, PAGE_SIZE);
-		kunmap_atomic(src);
+		kunmap_local(src);
 
 		put_page(page);
 		dst += PAGE_SIZE;
@@ -114,10 +114,10 @@ i915_gem_object_put_pages_phys(struct drm_i915_gem_object *obj,
 			if (IS_ERR(page))
 				continue;
 
-			dst = kmap_atomic(page);
+			dst = kmap_local_page(page);
 			drm_clflush_virt_range(src, PAGE_SIZE);
 			memcpy(dst, src, PAGE_SIZE);
-			kunmap_atomic(dst);
+			kunmap_local(dst);
 
 			set_page_dirty(page);
 			if (obj->mm.madv == I915_MADV_WILLNEED)
Signature · 1 line
2.34.1
#9 lore raw

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

Quoted 24 lines · On lunedì 17 ottobre 2022 11:37:18 CEST Zhao Liu wrote:

From: Zhao Liu <[email protected]>

The use of kmap_atomic() is being deprecated in favor of kmap_local_page()[1].

The main difference between atomic and local mappings is that local mappings doesn't disable page faults or preemption.

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

1. The flush operation is safe for CPU hotplug when preemption is not disabled. In drm/i915/gem/i915_gem_object.c, the functions 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 and any issue with cpu's being added or removed can be handled safely.

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

Quoted 7 lines

Therefore, i915_gem_object_get_pages_phys() and i915_gem_object_put_pages_phys() are two 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().

I have here the same questions as in 1/9.

Quoted 12 lines

[1]: https://lore.kernel.org/all/[email protected]

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

Quoted 6 lines
---
 drivers/gpu/drm/i915/gem/i915_gem_phys.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
(quoted diff) +0 -0

b/drivers/gpu/drm/i915/gem/i915_gem_phys.c index 0d0e46dae559..d602ba19ecb2

100644

drivers/gpu/drm/i915/gem/i915_gem_phys.c static int i915_gem_object_get_pages_phys(struct

Quoted 3 lines
drivers/gpu/drm/i915/gem/i915_gem_phys.c +0 -0
@@ -66,10 +66,10 @@ static int i915_gem_object_get_pages_phys(struct 

drm_i915_gem_object

drivers/gpu/drm/i915/gem/i915_gem_phys.c static int i915_gem_object_get_pages_phys(struct drm_i915_gem_object *obj) · line 72

Quoted 9 lines
drivers/gpu/drm/i915/gem/i915_gem_phys.c +2 -2
 *obj) if (IS_ERR(page))
 			goto err_st;
 
-		src = kmap_atomic(page);
+		src = kmap_local_page(page);
 		memcpy(dst, src, PAGE_SIZE);
 		drm_clflush_virt_range(dst, PAGE_SIZE);
-		kunmap_atomic(src);
+		kunmap_local(src);

Please use memcpy_from_page() instead of open coding mapping + memcpy() + unmapping.

drivers/gpu/drm/i915/gem/i915_gem_phys.c i915_gem_object_put_pages_phys(struct

Quoted 4 lines
drivers/gpu/drm/i915/gem/i915_gem_phys.c +0 -0
 		put_page(page);
 		dst += PAGE_SIZE;
@@ -114,10 +114,10 @@ i915_gem_object_put_pages_phys(struct 

drm_i915_gem_object *obj,

drivers/gpu/drm/i915/gem/i915_gem_phys.c i915_gem_object_put_pages_phys(struct drm_i915_gem_object *obj, · line 120

Quoted 9 lines
drivers/gpu/drm/i915/gem/i915_gem_phys.c +2 -2
 			if (IS_ERR(page))
 				continue;
 
-			dst = kmap_atomic(page);
+			dst = kmap_local_page(page);
 			drm_clflush_virt_range(src, PAGE_SIZE);
 			memcpy(dst, src, PAGE_SIZE);
-			kunmap_atomic(dst);
+			kunmap_local(dst);

For the same reasons said above, memcpy_to_page() should be used here and avoid open coding of three functions.

Using those helpers forces you to move drm_clflush_virt_range() out of the mapping / un-mapping region. I may be wrong, however I'm pretty sure that the relative positions of each of those call sites is something that cannot be randomly chosen.

Thanks,

Fabio

Quoted 3 lines
drivers/gpu/drm/i915/gem/i915_gem_phys.c +0 -0
 			set_page_dirty(page);
 			if (obj->mm.madv == I915_MADV_WILLNEED)
author
#10 lore raw

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

Quoted 66 lines · Fabio M. De Francesco

Date: Sat, 29 Oct 2022 15:32:08 +0200
From: "Fabio M. De Francesco" <[email protected]>
Subject: Re: [PATCH 2/9] drm/i915: Use kmap_local_page() in
gem/i915_gem_pyhs.c

Quoted 24 lines · On luned? 17 ottobre 2022 11:37:18 CEST Zhao Liu wrote:

From: Zhao Liu <[email protected]>

The use of kmap_atomic() is being deprecated in favor of kmap_local_page()[1].

The main difference between atomic and local mappings is that local mappings doesn't disable page faults or preemption.

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

1. The flush operation is safe for CPU hotplug when preemption is not disabled. In drm/i915/gem/i915_gem_object.c, the functions 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 and any issue with cpu's being added or removed can be handled safely.

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

Quoted 7 lines

Therefore, i915_gem_object_get_pages_phys() and i915_gem_object_put_pages_phys() are two 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().

I have here the same questions as in 1/9.

Quoted 12 lines

[1]: https://lore.kernel.org/all/[email protected]

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

Quoted 6 lines
---
 drivers/gpu/drm/i915/gem/i915_gem_phys.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
(quoted diff) +0 -0

b/drivers/gpu/drm/i915/gem/i915_gem_phys.c index 0d0e46dae559..d602ba19ecb2

100644

drivers/gpu/drm/i915/gem/i915_gem_phys.c static int i915_gem_object_get_pages_phys(struct

Quoted 3 lines
drivers/gpu/drm/i915/gem/i915_gem_phys.c +0 -0
@@ -66,10 +66,10 @@ static int i915_gem_object_get_pages_phys(struct 

drm_i915_gem_object

Quoted 3 lines
drivers/gpu/drm/i915/gem/i915_gem_phys.c +0 -0
 *obj) if (IS_ERR(page))
 			goto err_st;
 
Quoted 9 lines

drivers/gpu/drm/i915/gem/i915_gem_phys.c static int i915_gem_object_get_pages_phys(struct drm_i915_gem_object *obj) · line 72

Quoted 6 lines
drivers/gpu/drm/i915/gem/i915_gem_phys.c +2 -2
-		src = kmap_atomic(page);
+		src = kmap_local_page(page);
 		memcpy(dst, src, PAGE_SIZE);
 		drm_clflush_virt_range(dst, PAGE_SIZE);
-		kunmap_atomic(src);
+		kunmap_local(src);

Please use memcpy_from_page() instead of open coding mapping + memcpy() + unmapping.

Ok.

Quoted 19 lines

drivers/gpu/drm/i915/gem/i915_gem_phys.c i915_gem_object_put_pages_phys(struct

Quoted 5 lines
drivers/gpu/drm/i915/gem/i915_gem_phys.c +0 -0
 		put_page(page);
 		dst += PAGE_SIZE;
@@ -114,10 +114,10 @@ i915_gem_object_put_pages_phys(struct 

drm_i915_gem_object *obj,

drivers/gpu/drm/i915/gem/i915_gem_phys.c i915_gem_object_put_pages_phys(struct drm_i915_gem_object *obj, · line 120

Quoted 9 lines
drivers/gpu/drm/i915/gem/i915_gem_phys.c +2 -2
 			if (IS_ERR(page))
 				continue;
 
-			dst = kmap_atomic(page);
+			dst = kmap_local_page(page);
 			drm_clflush_virt_range(src, PAGE_SIZE);
 			memcpy(dst, src, PAGE_SIZE);
-			kunmap_atomic(dst);
+			kunmap_local(dst);

For the same reasons said above, memcpy_to_page() should be used here and avoid open coding of three functions.

Quoted 4 lines

Using those helpers forces you to move drm_clflush_virt_range() out of the mapping / un-mapping region. I may be wrong, however I'm pretty sure that the relative positions of each of those call sites is something that cannot be randomly chosen.

I agree. Will use memcpy_to_page().

Thanks,
Zhao

Quoted 11 lines

Thanks,

Fabio

Quoted 3 lines
drivers/gpu/drm/i915/gem/i915_gem_phys.c +0 -0
 			set_page_dirty(page);
 			if (obj->mm.madv == I915_MADV_WILLNEED)
author
#11 lore raw

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

In reply to Zhao Liu

From: Zhao Liu <[email protected]>

The use of kmap_atomic() is being deprecated in favor of kmap_local_page()[1].

The main difference between atomic and local mappings is that local mappings doesn't disable page faults or preemption.

In drm/i915/gem/i915_gem_shmem.c, the function shmem_pwrite() need to disable 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/[email protected]
[2]: https://patchwork.freedesktop.org/patch/295840/

---
Suggested by credits:
Ira: Referred to his suggestions about keeping pagefault_disable().

---
 drivers/gpu/drm/i915/gem/i915_gem_shmem.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_shmem.c +4 -2
index f42ca1179f37..e279a3e30c02 100644
@@ -472,11 +472,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);
Signature · 1 line
2.34.1
Reviewed-by on v1 3/9
#12 lore raw

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

Quoted 13 lines · Zhao Liu

From: Zhao Liu <[email protected]>

The use of kmap_atomic() is being deprecated in favor of kmap_local_page()[1].

The main difference between atomic and local mappings is that local mappings doesn't disable page faults or preemption.

In drm/i915/gem/i915_gem_shmem.c, the function shmem_pwrite() need to disable 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.

Quoted 7 lines

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

[1]: https://lore.kernel.org/all/[email protected]
[2]: https://patchwork.freedesktop.org/patch/295840/

Quoted 31 lines

---
Suggested by credits:
Ira: Referred to his suggestions about keeping pagefault_disable().

---
 drivers/gpu/drm/i915/gem/i915_gem_shmem.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_shmem.c +4 -2
index f42ca1179f37..e279a3e30c02 100644
@@ -472,11 +472,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);
Signature · 1 line
2.34.1
Reviewed-by on v1 3/9
#13 lore raw

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

In reply to Zhao Liu
Quoted 18 lines · On lunedì 17 ottobre 2022 11:37:19 CET Zhao Liu wrote:

From: Zhao Liu <[email protected]>

The use of kmap_atomic() is being deprecated in favor of kmap_local_page()[1].

The main difference between atomic and local mappings is that local mappings doesn't disable page faults or preemption.

In drm/i915/gem/i915_gem_shmem.c, the function shmem_pwrite() need to disable 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/[email protected]
[2]: https://patchwork.freedesktop.org/patch/295840/

Quoted 8 lines

---
Suggested by credits:
Ira: Referred to his suggestions about keeping pagefault_disable().

---
 drivers/gpu/drm/i915/gem/i915_gem_shmem.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

The commit message explains clearly and the changes to the code look good. The necessity to reuse pagefault_disable() / pagefault_enable() from the main kmap_atomic() side effect is a nice catch.

Thanks!

Quoted 2 lines
(quoted diff) +0 -0

b/drivers/gpu/drm/i915/gem/i915_gem_shmem.c index f42ca1179f37..e279a3e30c02

100644

Quoted 7 lines
drivers/gpu/drm/i915/gem/i915_gem_shmem.c +0 -1
@@ -472,11 +472,13 @@ shmem_pwrite(struct drm_i915_gem_object *obj,
 		if (err < 0)
 			return err;
 
-		vaddr = kmap_atomic(page);

drivers/gpu/drm/i915/gem/i915_gem_shmem.c shmem_pwrite(struct drm_i915_gem_object *obj, · line 483

Quoted 10 lines
drivers/gpu/drm/i915/gem/i915_gem_shmem.c +4 -1
+		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,

Quoted 1 line
drivers/gpu/drm/i915/gem/i915_gem_shmem.c +0 -0
 				      len - unwritten, page, data);
author
#14 lore raw

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

In reply to Zhao Liu

From: Zhao Liu <[email protected]>

The use of kmap_atomic() is being deprecated in favor of kmap_local_page()[1].

The main difference between atomic and local mappings is that local mappings doesn't disable page faults or preemption.

In drm/i915/gem/selftests/huge_pages.c, function __cpu_check_shmem() mainly uses 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 for CPU hotplug when preemption is not disabled. 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 and any issue with cpu's being added or removed can be handled safely.

2. Any context switch caused by preemption or sleep (pagefault 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/[email protected]

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

---
 drivers/gpu/drm/i915/gem/selftests/huge_pages.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/gem/selftests/huge_pages.c +3 -3
index c570cf780079..6f4efe905105 100644
@@ -1022,7 +1022,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);
@@ -1030,12 +1030,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);
Signature · 1 line
2.34.1
author
#15 lore raw

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

In reply to Zhao Liu

From: Zhao Liu <[email protected]>

The use of kmap_atomic() is being deprecated in favor of kmap_local_page()[1].

The main difference between atomic and local mappings is that local mappings doesn't disable page faults or preemption.

In drm/i915/gem/selftests/i915_gem_coherency.c, functions cpu_set() and cpu_get() 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 for CPU hotplug when preemption is not disabled. 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 and any issue with cpu's being added or removed can be handled safely.

2. Any context switch caused by preemption or sleep (pagefault 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/[email protected]

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

---
 .../gpu/drm/i915/gem/selftests/i915_gem_coherency.c  | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)
drivers/gpu/drm/i915/gem/selftests/i915_gem_coherency.c +4 -8
index a666d7e610f5..b12402c74424 100644
@@ -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:
Signature · 1 line
2.34.1
author
#16 lore raw

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

In reply to Zhao Liu

From: Zhao Liu <[email protected]>

The use of kmap_atomic() is being deprecated in favor of kmap_local_page()[1].

The main difference between atomic and local mappings is that local mappings doesn't disable page faults or preemption.

In drm/i915/gem/selftests/i915_gem_context.c, functions cpu_fill() and cpu_check() 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 for CPU hotplug when preemption is not disabled. 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 and any issue with cpu's being added or removed can be handled safely.

2. Any context switch caused by preemption or sleep (pagefault 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/[email protected]

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

---
 drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c +4 -4
index c6ad67b90e8a..736337f23f78 100644
@@ -466,12 +466,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);
@@ -496,7 +496,7 @@ static noinline int cpu_check(struct drm_i915_gem_object *obj,
 	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));
 		if (needs_flush & CLFLUSH_BEFORE)
 			drm_clflush_virt_range(map, PAGE_SIZE);
 
@@ -522,7 +522,7 @@ static noinline int cpu_check(struct drm_i915_gem_object *obj,
 		}
 
 out_unmap:
-		kunmap_atomic(map);
+		kunmap_local(map);
 		if (err)
 			break;
 	}
Signature · 1 line
2.34.1
author
#17 lore raw

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

In reply to Zhao Liu

From: Zhao Liu <[email protected]>

The use of kmap_atomic() is being deprecated in favor of kmap_local_page()[1].

The main difference between atomic and local mappings is that local mappings doesn't disable page faults or preemption.

In drm/i915/gt/uc/intel_us_fw.c, the function intel_uc_fw_copy_rsa() just use 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/[email protected]/T/#u

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

---
 drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c +1 -4
index b91ad4aede1f..64d56f175d32 100644
@@ -962,16 +962,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;
Signature · 1 line
2.34.1
Reviewed-by on v1 7/9
#18 lore raw

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

Quoted 17 lines · Zhao Liu

From: Zhao Liu <[email protected]>

The use of kmap_atomic() is being deprecated in favor of kmap_local_page()[1].

The main difference between atomic and local mappings is that local mappings doesn't disable page faults or preemption.

In drm/i915/gt/uc/intel_us_fw.c, the function intel_uc_fw_copy_rsa() just use 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.

Quoted 6 lines

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/[email protected]/T/#u

Quoted 36 lines

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

---
 drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c +1 -4
index b91ad4aede1f..64d56f175d32 100644
@@ -962,16 +962,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;
Signature · 1 line
2.34.1
author
#19 lore raw

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

In reply to Zhao Liu

From: Zhao Liu <[email protected]>

The use of kmap_atomic() is being deprecated in favor of kmap_local_page()[1].

The main difference between atomic and local mappings is that local mappings doesn't disable page faults or preemption.

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

1. The flush operation is safe for CPU hotplug when preemption is not disabled. In i915_cmd_parser.c, the function 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 and any issue with cpu's being added or removed can be handled safely.

2. Any context switch caused by preemption or sleep (pagefault 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/[email protected]

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

---
 drivers/gpu/drm/i915/i915_cmd_parser.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_cmd_parser.c +2 -2
index f93e6122f247..1a56000d7476 100644
@@ -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;
Signature · 1 line
2.34.1
author
#20 lore raw

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

In reply to Zhao Liu

From: Zhao Liu <[email protected]>

kmap() is being deprecated in favor of kmap_local_page()[1].

There are two main problems with kmap(): (1) It comes with an overhead as mapping space is restricted and protected by a global lock for synchronization and (2) it also requires global TLB invalidation when the kmap's pool wraps and it might block when the mapping space is fully utilized until a slot becomes available.

With kmap_local_page() the mappings are per thread, CPU local, can take page faults, and can be called from any context (including interrupts).
It is faster than kmap() in kernels with HIGHMEM enabled. Furthermore, the tasks can be preempted and, when they are scheduled to run again, the kernel virtual addresses are restored and are still valid.

Since its use in hyperv/hv_init.c is safe, it should be preferred.

Therefore, replace kmap() with kmap_local_page() in hyperv/hv_init.c.

[1]: https://lore.kernel.org/all/[email protected]

---
Suggested by credits.
Ira: Referred to his task documentation and review comments.
Fabio: Stole some of his boiler plate commit message.

---
Changelog:
v2:
- Fix wrong incoming parameters in kunmap_local();
- Add Fabio as suggester since I quoted his commit message.

---
 arch/x86/hyperv/hv_init.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/hyperv/hv_init.c +2 -2
index 3de6d8b53367..72fe46eb183f 100644
@@ -459,13 +459,13 @@ void __init hyperv_init(void)
                wrmsrl(HV_X64_MSR_HYPERCALL, hypercall_msr.as_uint64);
 
                pg = vmalloc_to_page(hv_hypercall_pg);
-               dst = kmap(pg);
+               dst = kmap_local_page(pg);
                src = memremap(hypercall_msr.guest_physical_address << PAGE_SHIFT, PAGE_SIZE,
                                MEMREMAP_WB);
                BUG_ON(!(src && dst));
                memcpy(dst, src, HV_HYP_PAGE_SIZE);
                memunmap(src);
-               kunmap(pg);
+               kunmap_local(dst);
        } else {
                hypercall_msr.guest_physical_address = vmalloc_to_pfn(hv_hypercall_pg);
                wrmsrl(HV_X64_MSR_HYPERCALL, hypercall_msr.as_uint64);

--
2.34.1

author
#21 lore raw

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

Sorry, please ignore the last hyperv patch, I made a mistake.

Zhao

Quoted 62 lines · Zhao Liu

Date: Mon, 17 Oct 2022 17:37:26 +0800
From: Zhao Liu <[email protected]>
Subject: [PATCH v3] x86/hyperv: Replace kmap() with kmap_local_page()
X-Mailer: git-send-email 2.34.1

From: Zhao Liu <[email protected]>

kmap() is being deprecated in favor of kmap_local_page()[1].

There are two main problems with kmap(): (1) It comes with an overhead as mapping space is restricted and protected by a global lock for synchronization and (2) it also requires global TLB invalidation when the kmap's pool wraps and it might block when the mapping space is fully utilized until a slot becomes available.

With kmap_local_page() the mappings are per thread, CPU local, can take page faults, and can be called from any context (including interrupts).
It is faster than kmap() in kernels with HIGHMEM enabled. Furthermore, the tasks can be preempted and, when they are scheduled to run again, the kernel virtual addresses are restored and are still valid.

Since its use in hyperv/hv_init.c is safe, it should be preferred.

Therefore, replace kmap() with kmap_local_page() in hyperv/hv_init.c.

[1]: https://lore.kernel.org/all/[email protected]

---
Suggested by credits.
Ira: Referred to his task documentation and review comments.
Fabio: Stole some of his boiler plate commit message.

---
Changelog:
v2:
- Fix wrong incoming parameters in kunmap_local();
- Add Fabio as suggester since I quoted his commit message.

---
 arch/x86/hyperv/hv_init.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/hyperv/hv_init.c +2 -3
index 3de6d8b53367..72fe46eb183f 100644
@@ -459,13 +459,13 @@ void __init hyperv_init(void)
                wrmsrl(HV_X64_MSR_HYPERCALL, hypercall_msr.as_uint64);
 
                pg = vmalloc_to_page(hv_hypercall_pg);
-               dst = kmap(pg);
+               dst = kmap_local_page(pg);
                src = memremap(hypercall_msr.guest_physical_address << PAGE_SHIFT, PAGE_SIZE,
                                MEMREMAP_WB);
                BUG_ON(!(src && dst));
                memcpy(dst, src, HV_HYP_PAGE_SIZE);
                memunmap(src);
-               kunmap(pg);
+               kunmap_local(dst);
        } else {
                hypercall_msr.guest_physical_address = vmalloc_to_pfn(hv_hypercall_pg);
                wrmsrl(HV_X64_MSR_HYPERCALL, hypercall_msr.as_uint64);
--

2.34.1

author
#22 lore raw

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

In reply to Zhao Liu

From: Zhao Liu <[email protected]>

The use of kmap_atomic() is being deprecated in favor of kmap_local_page()[1].

The main difference between atomic and local mappings is that local mappings doesn't disable page faults or preemption.

In i915_gem_execbuffer.c, eb->reloc_cache.vaddr is mapped by kmap_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/[email protected]

---
 drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c +5 -5
index 845023c14eb3..8263d4e6620a 100644
@@ -1110,7 +1110,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);
 }
@@ -1126,7 +1126,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 {
@@ -1156,7 +1156,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);
@@ -1188,7 +1188,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;
@@ -1210,7 +1210,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;
 
Signature · 1 line
2.34.1
#23 lore raw

[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for x86/hyperv: Replace kmap() with kmap_local_page()

In reply to Zhao Liu
== Series Details ==

== Series Details ==

Series: x86/hyperv: Replace kmap() with kmap_local_page()
URL : https://patchwork.freedesktop.org/series/109762/
State : warning

== Summary ==

Error: dim checkpatch failed
94f5a3ebd264 drm/i915: Use kmap_local_page() in gem/i915_gem_object.c
-:36: WARNING:COMMIT_LOG_LONG_LINE: Possible unwrapped commit description (prefer a maximum 75 chars per line) #36:
[1]: https://lore.kernel.org/all/[email protected]

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

total: 1 errors, 1 warnings, 0 checks, 20 lines checked
28b17b9feee4 drm/i915: Use kmap_local_page() in gem/i915_gem_pyhs.c
-:35: WARNING:COMMIT_LOG_LONG_LINE: Possible unwrapped commit description (prefer a maximum 75 chars per line) #35:
[1]: https://lore.kernel.org/all/[email protected]

total: 0 errors, 1 warnings, 0 checks, 24 lines checked
eaa5326f369c drm/i915: Use kmap_local_page() in gem/i915_gem_shmem.c
-:20: WARNING:COMMIT_LOG_LONG_LINE: Possible unwrapped commit description (prefer a maximum 75 chars per line) #20:
[1]: https://lore.kernel.org/all/[email protected]

total: 0 errors, 1 warnings, 0 checks, 15 lines checked
1af0cf05e783 drm/i915: Use kmap_local_page() in gem/selftests/huge_pages.c
-:33: WARNING:COMMIT_LOG_LONG_LINE: Possible unwrapped commit description (prefer a maximum 75 chars per line) #33:
[1]: https://lore.kernel.org/all/[email protected]

total: 0 errors, 1 warnings, 0 checks, 22 lines checked
12b88a322bea drm/i915: Use kmap_local_page() in gem/selftests/i915_gem_coherency.c
-:34: WARNING:COMMIT_LOG_LONG_LINE: Possible unwrapped commit description (prefer a maximum 75 chars per line) #34:
[1]: https://lore.kernel.org/all/[email protected]

total: 0 errors, 1 warnings, 0 checks, 48 lines checked
06618dde00cf drm/i915: Use kmap_local_page() in gem/selftests/i915_gem_context.c
-:36: WARNING:COMMIT_LOG_LONG_LINE: Possible unwrapped commit description (prefer a maximum 75 chars per line) #36:
[1]: https://lore.kernel.org/all/[email protected]

total: 0 errors, 1 warnings, 0 checks, 30 lines checked
6b630c742132 drm/i915: Use memcpy_from_page() in gt/uc/intel_uc_fw.c
-:24: WARNING:COMMIT_LOG_LONG_LINE: Possible unwrapped commit description (prefer a maximum 75 chars per line) #24:
[1]: https://lore.kernel.org/all/[email protected]/T/#u

total: 0 errors, 1 warnings, 0 checks, 17 lines checked
e482142fdccb drm/i915: Use kmap_local_page() in i915_cmd_parser.c
-:31: WARNING:COMMIT_LOG_LONG_LINE: Possible unwrapped commit description (prefer a maximum 75 chars per line) #31:
[1]: https://lore.kernel.org/all/[email protected]

total: 0 errors, 1 warnings, 0 checks, 13 lines checked
67e1e69c2291 drm/i915: Use kmap_local_page() in gem/i915_gem_execbuffer.c
-:29: WARNING:COMMIT_LOG_LONG_LINE: Possible unwrapped commit description (prefer a maximum 75 chars per line) #29:
[1]: https://lore.kernel.org/all/[email protected]

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

#24 lore raw

[Intel-gfx] ✗ Fi.CI.SPARSE: warning for x86/hyperv: Replace kmap() with kmap_local_page()

In reply to Zhao Liu
== Series Details ==

== Series Details ==

Series: x86/hyperv: Replace kmap() with kmap_local_page()
URL : https://patchwork.freedesktop.org/series/109762/
State : warning

== Summary ==

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

#25 lore raw

[Intel-gfx] ✓ Fi.CI.BAT: success for x86/hyperv: Replace kmap() with kmap_local_page()

In reply to Zhao Liu
== Series Details ==

== Series Details ==

Series: x86/hyperv: Replace kmap() with kmap_local_page()
URL : https://patchwork.freedesktop.org/series/109762/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_12251 -> Patchwork_109762v1
====================================================

Summary
-------

**SUCCESS**

No regressions found.

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

Participating hosts (44 -> 45)
------------------------------

Additional (2): fi-hsw-4770 fi-rkl-11600
Missing (1): fi-bdw-samus

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

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

### IGT changes ###

#### Issues hit ####

* igt@gem_softpin@allocator-basic-reserve:
- fi-hsw-4770: NOTRUN -> [SKIP][1] ([fdo#109271]) +9 similar issues
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/fi-hsw-4770/igt@[email protected]

* igt@i915_pm_backlight@basic-brightness:
- fi-hsw-4770: NOTRUN -> [SKIP][2] ([fdo#109271] / [i915#3012])
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/fi-hsw-4770/igt@[email protected]

* igt@i915_pm_rpm@module-reload:
- fi-hsw-4770: NOTRUN -> [INCOMPLETE][3] ([i915#7221])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/fi-hsw-4770/igt@[email protected]

* igt@kms_chamelium@dp-crc-fast:
- fi-hsw-4770: NOTRUN -> [SKIP][4] ([fdo#109271] / [fdo#111827]) +7 similar issues
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/fi-hsw-4770/igt@[email protected]

* igt@kms_psr@sprite_plane_onoff:
- fi-hsw-4770: NOTRUN -> [SKIP][5] ([fdo#109271] / [i915#1072]) +3 similar issues
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/fi-hsw-4770/igt@kms_psr@sprite_plane_onoff.html

* igt@runner@aborted:
- fi-hsw-4770: NOTRUN -> [FAIL][6] ([fdo#109271] / [i915#4312] / [i915#5594])
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/fi-hsw-4770/igt@[email protected]
- fi-rkl-11600: NOTRUN -> [FAIL][7] ([i915#7220])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/fi-rkl-11600/igt@[email protected]

#### Possible fixes ####

* igt@kms_cursor_legacy@basic-busy-flip-before-cursor@atomic-transitions-varying-size:
- fi-bsw-kefka: [FAIL][8] ([i915#6298]) -> [PASS][9]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/fi-bsw-kefka/igt@kms_cursor_legacy@basic-busy-flip-before-cursor@atomic-transitions-varying-size.html
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/fi-bsw-kefka/igt@kms_cursor_legacy@basic-busy-flip-before-cursor@atomic-transitions-varying-size.html

#### Warnings ####

* igt@i915_suspend@basic-s3-without-i915:
- fi-bdw-gvtdvm: [FAIL][10] ([fdo#103375]) -> [INCOMPLETE][11] ([i915#146])
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/fi-bdw-gvtdvm/igt@[email protected]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/fi-bdw-gvtdvm/igt@[email protected]

[fdo#103375]: https://bugs.freedesktop.org/show_bug.cgi?id=103375
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
[i915#1072]: https://gitlab.freedesktop.org/drm/intel/issues/1072
[i915#146]: https://gitlab.freedesktop.org/drm/intel/issues/146
[i915#3012]: https://gitlab.freedesktop.org/drm/intel/issues/3012
[i915#4312]: https://gitlab.freedesktop.org/drm/intel/issues/4312
[i915#5594]: https://gitlab.freedesktop.org/drm/intel/issues/5594
[i915#6298]: https://gitlab.freedesktop.org/drm/intel/issues/6298
[i915#7220]: https://gitlab.freedesktop.org/drm/intel/issues/7220
[i915#7221]: https://gitlab.freedesktop.org/drm/intel/issues/7221

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

* Linux: CI_DRM_12251 -> Patchwork_109762v1

CI-20190529: 20190529
CI_DRM_12251: ff61e79b01712f5d31a4c4f23c6971bbaa71cecb @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_7016: 642f4bf44e2b42791b4d1684936a1bfbe2d099ee @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_109762v1: ff61e79b01712f5d31a4c4f23c6971bbaa71cecb @ git://anongit.freedesktop.org/gfx-ci/linux

### Linux commits

60f65f857ad4 drm/i915: Use kmap_local_page() in gem/i915_gem_execbuffer.c edce02a1dc0c drm/i915: Use kmap_local_page() in i915_cmd_parser.c e2f05fccc2a4 drm/i915: Use memcpy_from_page() in gt/uc/intel_uc_fw.c 274d6cb33340 drm/i915: Use kmap_local_page() in gem/selftests/i915_gem_context.c 79f319e29898 drm/i915: Use kmap_local_page() in gem/selftests/i915_gem_coherency.c 1079670a97a7 drm/i915: Use kmap_local_page() in gem/selftests/huge_pages.c 0e42919ea344 drm/i915: Use kmap_local_page() in gem/i915_gem_shmem.c 5b9df1fad9a1 drm/i915: Use kmap_local_page() in gem/i915_gem_pyhs.c 8eef1374bd53 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_109762v1/index.html

#26 lore raw

[Intel-gfx] ✗ Fi.CI.IGT: failure for x86/hyperv: Replace kmap() with kmap_local_page()

In reply to Zhao Liu
== Series Details ==

== Series Details ==

Series: x86/hyperv: Replace kmap() with kmap_local_page()
URL : https://patchwork.freedesktop.org/series/109762/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_12251_full -> Patchwork_109762v1_full
====================================================

Summary
-------

**FAILURE**

Serious unknown changes coming with Patchwork_109762v1_full absolutely need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in Patchwork_109762v1_full, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.

Participating hosts (12 -> 12)
------------------------------

No changes in participating hosts

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

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

### IGT changes ###

#### Possible regressions ####

* igt@i915_module_load@reload-with-fault-injection:
- shard-tglb: [PASS][1] -> [INCOMPLETE][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-tglb7/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/shard-tglb5/igt@[email protected]

* igt@i915_suspend@debugfs-reader:
- shard-apl: NOTRUN -> [INCOMPLETE][3]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/shard-apl2/igt@[email protected]

#### Warnings ####

* igt@gem_eio@in-flight-suspend:
- shard-apl: [INCOMPLETE][4] ([i915#7112]) -> [INCOMPLETE][5]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-apl2/igt@[email protected]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/shard-apl1/igt@[email protected]

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

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

### CI changes ###

#### Possible fixes ####

* boot:
- shard-snb: ([PASS][6], [PASS][7], [PASS][8], [PASS][9], [PASS][10], [PASS][11], [PASS][12], [PASS][13], [FAIL][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]) ([i915#4338]) -> ([PASS][31], [PASS][32], [PASS][33], [PASS][34], [PASS][35], [PASS][36], [PASS][37], [PASS][38], [PASS][39], [PASS][40], [PASS][41], [PASS][42], [PASS][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])
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-snb7/boot.html
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-snb7/boot.html
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-snb7/boot.html
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-snb7/boot.html
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-snb6/boot.html
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-snb6/boot.html
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-snb6/boot.html
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-snb6/boot.html
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-snb6/boot.html
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-snb5/boot.html
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-snb5/boot.html
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-snb5/boot.html
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-snb5/boot.html
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-snb5/boot.html
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-snb5/boot.html
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-snb4/boot.html
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-snb4/boot.html
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-snb4/boot.html
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-snb4/boot.html
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-snb4/boot.html
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-snb2/boot.html
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-snb2/boot.html
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-snb2/boot.html
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-snb2/boot.html
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-snb2/boot.html
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/shard-snb7/boot.html
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/shard-snb7/boot.html
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/shard-snb7/boot.html
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/shard-snb7/boot.html
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/shard-snb7/boot.html
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/shard-snb6/boot.html
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/shard-snb6/boot.html
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/shard-snb6/boot.html
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/shard-snb6/boot.html
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/shard-snb6/boot.html
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/shard-snb6/boot.html
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/shard-snb5/boot.html
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/shard-snb5/boot.html
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/shard-snb5/boot.html
[45]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/shard-snb5/boot.html
[46]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/shard-snb4/boot.html
[47]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/shard-snb4/boot.html
[48]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/shard-snb4/boot.html
[49]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/shard-snb4/boot.html
[50]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/shard-snb4/boot.html
[51]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/shard-snb2/boot.html
[52]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/shard-snb2/boot.html
[53]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/shard-snb2/boot.html
[54]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/shard-snb2/boot.html
[55]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/shard-snb2/boot.html

### IGT changes ###

#### Issues hit ####

* igt@gem_create@create-ext-cpu-access-sanity-check:
- shard-tglb: NOTRUN -> [SKIP][56] ([i915#6335])
[56]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/shard-tglb2/igt@[email protected]

* igt@gem_ctx_sseu@mmap-args:
- shard-tglb: NOTRUN -> [SKIP][57] ([i915#280])
[57]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/shard-tglb2/igt@[email protected]

* igt@gem_exec_fair@basic-pace-share@rcs0:
- shard-tglb: [PASS][58] -> [FAIL][59] ([i915#2842])
[58]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-tglb1/igt@gem_exec_fair@[email protected]
[59]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/shard-tglb2/igt@gem_exec_fair@[email protected]

* igt@gem_exec_fair@basic-pace-solo@rcs0:
- shard-tglb: NOTRUN -> [FAIL][60] ([i915#2842])
[60]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/shard-tglb2/igt@gem_exec_fair@[email protected]

* igt@gem_softpin@evict-snoop:
- shard-tglb: NOTRUN -> [SKIP][61] ([fdo#109312])
[61]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/shard-tglb2/igt@[email protected]

* igt@gen9_exec_parse@batch-without-end:
- shard-tglb: NOTRUN -> [SKIP][62] ([i915#2527] / [i915#2856])
[62]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/shard-tglb2/igt@[email protected]

* igt@i915_pm_rpm@modeset-non-lpsp-stress-no-wait:
- shard-tglb: NOTRUN -> [SKIP][63] ([fdo#111644] / [i915#1397])
[63]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/shard-tglb2/igt@[email protected]

* igt@i915_pm_rps@engine-order:
- shard-apl: [PASS][64] -> [FAIL][65] ([i915#6537])
[64]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-apl3/igt@[email protected]
[65]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/shard-apl7/igt@[email protected]

* igt@i915_pm_sseu@full-enable:
- shard-tglb: NOTRUN -> [SKIP][66] ([i915#4387])
[66]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/shard-tglb2/igt@[email protected]

* igt@kms_big_fb@4-tiled-32bpp-rotate-270:
- shard-tglb: NOTRUN -> [SKIP][67] ([i915#5286])
[67]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/shard-tglb2/igt@[email protected]

* igt@kms_big_fb@4-tiled-8bpp-rotate-180:
- shard-apl: NOTRUN -> [SKIP][68] ([fdo#109271]) +2 similar issues
[68]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/shard-apl2/igt@[email protected]

* igt@kms_big_fb@x-tiled-32bpp-rotate-270:
- shard-tglb: NOTRUN -> [SKIP][69] ([fdo#111614])
[69]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/shard-tglb2/igt@[email protected]

* igt@kms_big_fb@y-tiled-max-hw-stride-32bpp-rotate-180-async-flip:
- shard-tglb: [PASS][70] -> [FAIL][71] ([i915#3743])
[70]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-tglb7/igt@kms_big_fb@y-tiled-max-hw-stride-32bpp-rotate-180-async-flip.html
[71]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/shard-tglb5/igt@kms_big_fb@y-tiled-max-hw-stride-32bpp-rotate-180-async-flip.html

* igt@kms_big_fb@yf-tiled-64bpp-rotate-180:
- shard-tglb: NOTRUN -> [SKIP][72] ([fdo#111615])
[72]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/shard-tglb2/igt@[email protected]

* igt@kms_ccs@pipe-a-bad-pixel-format-4_tiled_dg2_rc_ccs_cc:
- shard-tglb: NOTRUN -> [SKIP][73] ([i915#6095]) +1 similar issue
[73]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/shard-tglb2/igt@kms_ccs@pipe-a-bad-pixel-format-4_tiled_dg2_rc_ccs_cc.html

* igt@kms_ccs@pipe-c-ccs-on-another-bo-yf_tiled_ccs:
- shard-tglb: NOTRUN -> [SKIP][74] ([fdo#111615] / [i915#3689]) +2 similar issues
[74]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/shard-tglb2/igt@kms_ccs@pipe-c-ccs-on-another-bo-yf_tiled_ccs.html

* igt@kms_ccs@pipe-d-crc-primary-basic-4_tiled_dg2_mc_ccs:
- shard-tglb: NOTRUN -> [SKIP][75] ([i915#3689]) +2 similar issues
[75]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/shard-tglb2/igt@kms_ccs@pipe-d-crc-primary-basic-4_tiled_dg2_mc_ccs.html

* igt@kms_chamelium@hdmi-aspect-ratio:
- shard-snb: NOTRUN -> [SKIP][76] ([fdo#109271] / [fdo#111827]) +1 similar issue
[76]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/shard-snb2/igt@[email protected]

* igt@kms_chamelium@vga-frame-dump:
- shard-tglb: NOTRUN -> [SKIP][77] ([fdo#109284] / [fdo#111827]) +2 similar issues
[77]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/shard-tglb2/igt@[email protected]

* igt@kms_cursor_crc@cursor-offscreen-512x512:
- shard-tglb: NOTRUN -> [SKIP][78] ([i915#3359])
[78]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/shard-tglb2/igt@[email protected]

* igt@kms_cursor_crc@cursor-rapid-movement-32x32:
- shard-tglb: NOTRUN -> [SKIP][79] ([i915#3555])
[79]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/shard-tglb2/igt@[email protected]

* igt@kms_cursor_legacy@2x-long-cursor-vs-flip-legacy:
- shard-tglb: NOTRUN -> [SKIP][80] ([fdo#109274] / [fdo#111825])
[80]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/shard-tglb2/igt@[email protected]

* igt@kms_flip@2x-flip-vs-panning:
- shard-tglb: NOTRUN -> [SKIP][81] ([fdo#109274] / [fdo#111825] / [i915#3637]) +1 similar issue
[81]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/shard-tglb2/igt@[email protected]

* igt@kms_flip_scaled_crc@flip-32bpp-yftile-to-64bpp-yftile-downscaling@pipe-a-valid-mode:
- shard-tglb: NOTRUN -> [SKIP][82] ([i915#2587] / [i915#2672])
[82]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/shard-tglb2/igt@kms_flip_scaled_crc@flip-32bpp-yftile-to-64bpp-yftile-downscaling@pipe-a-valid-mode.html

* igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-spr-indfb-onoff:
- shard-tglb: NOTRUN -> [SKIP][83] ([fdo#109280] / [fdo#111825]) +9 similar issues
[83]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/shard-tglb2/igt@[email protected]

* igt@kms_frontbuffer_tracking@fbcpsr-rgb101010-draw-pwrite:
- shard-tglb: NOTRUN -> [SKIP][84] ([i915#6497]) +2 similar issues
[84]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/shard-tglb2/igt@[email protected]

* igt@kms_plane_scaling@planes-upscale-20x20-downscale-factor-0-25@pipe-c-edp-1:
- shard-tglb: NOTRUN -> [SKIP][85] ([i915#5235]) +3 similar issues
[85]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/shard-tglb2/igt@kms_plane_scaling@[email protected]

* igt@kms_psr@psr2_primary_mmap_gtt:
- shard-tglb: NOTRUN -> [FAIL][86] ([i915#132] / [i915#3467])
[86]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/shard-tglb2/igt@kms_psr@psr2_primary_mmap_gtt.html

* igt@kms_rotation_crc@bad-pixel-format:
- shard-snb: NOTRUN -> [SKIP][87] ([fdo#109271]) +75 similar issues
[87]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/shard-snb2/igt@[email protected]

* igt@kms_rotation_crc@primary-yf-tiled-reflect-x-90:
- shard-tglb: NOTRUN -> [SKIP][88] ([fdo#111615] / [i915#5289])
[88]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/shard-tglb2/igt@[email protected]

* igt@kms_scaling_modes@scaling-mode-none@edp-1-pipe-d:
- shard-tglb: NOTRUN -> [SKIP][89] ([i915#5030]) +3 similar issues
[89]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/shard-tglb2/igt@kms_scaling_modes@[email protected]

* igt@kms_vblank@pipe-a-ts-continuation-dpms-suspend:
- shard-snb: NOTRUN -> [FAIL][90] ([fdo#103375]) +1 similar issue
[90]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/shard-snb2/igt@[email protected]

* igt@kms_writeback@writeback-invalid-parameters:
- shard-tglb: NOTRUN -> [SKIP][91] ([i915#2437])
[91]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/shard-tglb2/igt@[email protected]

* igt@sysfs_clients@fair-7:
- shard-tglb: NOTRUN -> [SKIP][92] ([i915#2994])
[92]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/shard-tglb2/igt@[email protected]

#### Possible fixes ####

* igt@i915_selftest@mock@requests:
- shard-tglb: [INCOMPLETE][93] ([i915#7226]) -> [PASS][94]
[93]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-tglb5/igt@i915_selftest@[email protected]
[94]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/shard-tglb2/igt@i915_selftest@[email protected]

* igt@kms_big_fb@y-tiled-max-hw-stride-32bpp-rotate-0-hflip-async-flip:
- shard-tglb: [FAIL][95] ([i915#3743]) -> [PASS][96]
[95]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-tglb1/igt@kms_big_fb@y-tiled-max-hw-stride-32bpp-rotate-0-hflip-async-flip.html
[96]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/shard-tglb7/igt@kms_big_fb@y-tiled-max-hw-stride-32bpp-rotate-0-hflip-async-flip.html

* igt@kms_frontbuffer_tracking@fbc-rgb101010-draw-pwrite:
- shard-snb: [SKIP][97] ([fdo#109271]) -> [PASS][98]
[97]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-snb2/igt@[email protected]
[98]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/shard-snb7/igt@[email protected]

#### Warnings ####

* igt@i915_selftest@mock@requests:
- shard-snb: [DMESG-FAIL][99] -> [INCOMPLETE][100] ([i915#7226])
[99]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12251/shard-snb4/igt@i915_selftest@[email protected]
[100]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_109762v1/shard-snb5/igt@i915_selftest@[email protected]

[fdo#103375]: https://bugs.freedesktop.org/show_bug.cgi?id=103375
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109274]: https://bugs.freedesktop.org/show_bug.cgi?id=109274
[fdo#109280]: https://bugs.freedesktop.org/show_bug.cgi?id=109280
[fdo#109284]: https://bugs.freedesktop.org/show_bug.cgi?id=109284
[fdo#109312]: https://bugs.freedesktop.org/show_bug.cgi?id=109312
[fdo#111614]: https://bugs.freedesktop.org/show_bug.cgi?id=111614
[fdo#111615]: https://bugs.freedesktop.org/show_bug.cgi?id=111615
[fdo#111644]: https://bugs.freedesktop.org/show_bug.cgi?id=111644
[fdo#111825]: https://bugs.freedesktop.org/show_bug.cgi?id=111825
[fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
[i915#132]: https://gitlab.freedesktop.org/drm/intel/issues/132
[i915#1397]: https://gitlab.freedesktop.org/drm/intel/issues/1397
[i915#2437]: https://gitlab.freedesktop.org/drm/intel/issues/2437
[i915#2527]: https://gitlab.freedesktop.org/drm/intel/issues/2527
[i915#2587]: https://gitlab.freedesktop.org/drm/intel/issues/2587
[i915#2672]: https://gitlab.freedesktop.org/drm/intel/issues/2672
[i915#280]: https://gitlab.freedesktop.org/drm/intel/issues/280
[i915#2842]: https://gitlab.freedesktop.org/drm/intel/issues/2842
[i915#2856]: https://gitlab.freedesktop.org/drm/intel/issues/2856
[i915#2994]: https://gitlab.freedesktop.org/drm/intel/issues/2994
[i915#3359]: https://gitlab.freedesktop.org/drm/intel/issues/3359
[i915#3467]: https://gitlab.freedesktop.org/drm/intel/issues/3467
[i915#3555]: https://gitlab.freedesktop.org/drm/intel/issues/3555
[i915#3637]: https://gitlab.freedesktop.org/drm/intel/issues/3637
[i915#3689]: https://gitlab.freedesktop.org/drm/intel/issues/3689
[i915#3743]: https://gitlab.freedesktop.org/drm/intel/issues/3743
[i915#4338]: https://gitlab.freedesktop.org/drm/intel/issues/4338
[i915#4387]: https://gitlab.freedesktop.org/drm/intel/issues/4387
[i915#5030]: https://gitlab.freedesktop.org/drm/intel/issues/5030
[i915#5235]: https://gitlab.freedesktop.org/drm/intel/issues/5235
[i915#5286]: https://gitlab.freedesktop.org/drm/intel/issues/5286
[i915#5289]: https://gitlab.freedesktop.org/drm/intel/issues/5289
[i915#6095]: https://gitlab.freedesktop.org/drm/intel/issues/6095
[i915#6335]: https://gitlab.freedesktop.org/drm/intel/issues/6335
[i915#6497]: https://gitlab.freedesktop.org/drm/intel/issues/6497
[i915#6537]: https://gitlab.freedesktop.org/drm/intel/issues/6537
[i915#7112]: https://gitlab.freedesktop.org/drm/intel/issues/7112
[i915#7226]: https://gitlab.freedesktop.org/drm/intel/issues/7226

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

* Linux: CI_DRM_12251 -> Patchwork_109762v1

CI-20190529: 20190529
CI_DRM_12251: ff61e79b01712f5d31a4c4f23c6971bbaa71cecb @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_7016: 642f4bf44e2b42791b4d1684936a1bfbe2d099ee @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_109762v1: ff61e79b01712f5d31a4c4f23c6971bbaa71cecb @ 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_109762v1/index.html

#27 lore raw
In reply to Zhao Liu
Quoted 4 lines · On lunedì 17 ottobre 2022 11:37:16 CEST Zhao Liu wrote:

From: Zhao Liu <[email protected]>

The use of kmap_atomic() is being deprecated in favor of kmap_local_page()[1].

Some words to explain why kmap_atomic was deprecated won't hurt. Many maintainers and reviewers, and also casual readers might not yet be aware of the reasons behind that deprecation.

Quoted 3 lines

In the following patches, we can convert the calls of kmap_atomic() / kunmap_atomic() to kmap_local_page() / kunmap_local(), which can instead do the mapping / unmapping regardless of the context.

Readers are probably much more interested in what you did in the following patches and why you did it, instead of being informed about what "we can" do.

I would suggest something like "The following patches convert the calls to kmap_atomic() to kmap_local_page() [the rest looks OK]".

This could also be the place to say something about why we prefer kmap_local_page() to kmap_atomic().

Are you sure that the reasons that motivates your conversions are merely summarized to kmap_local_page() being able to do mappings regardless of context? I think you are missing the real reasons why.

What about avoiding the often unwanted side effect of unnecessary page faults disables?

Quoted 3 lines

With kmap_local_page(), the mapping is per thread, CPU local and not globally visible.

No news here. kmap_atomic() is "per thread, CPU local and not glocally visible". I cannot see any difference here between kmap_atomic() and kmap_local_page().

Quoted 14 lines

[1]: https://lore.kernel.org/all/[email protected]
---
Zhao Liu (9):
drm/i915: Use kmap_local_page() in gem/i915_gem_object.c drm/i915: Use kmap_local_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

Quoted 10 lines
 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             |  8 ++++----
 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, 30 insertions(+), 37 deletions(-)

Thanks for helping with kmap_atomic() conversions to kmap_local_page().

Fabio

author
#28 lore raw
Quoted 4 lines · Fabio M. De Francesco

Date: Sat, 29 Oct 2022 09:12:27 +0200
From: "Fabio M. De Francesco" <[email protected]>
Subject: Re: [PATCH 0/9] drm/i915: Replace kmap_atomic() with
kmap_local_page()

Hi Fabio, thanks for your review!! (I'm sorry I missed the previous mails).

Quoted 21 lines · On luned? 17 ottobre 2022 11:37:16 CEST Zhao Liu wrote:
Quoted 4 lines

From: Zhao Liu <[email protected]>

The use of kmap_atomic() is being deprecated in favor of kmap_local_page()[1].

Some words to explain why kmap_atomic was deprecated won't hurt. Many maintainers and reviewers, and also casual readers might not yet be aware of the reasons behind that deprecation.

Quoted 3 lines

In the following patches, we can convert the calls of kmap_atomic() / kunmap_atomic() to kmap_local_page() / kunmap_local(), which can instead do the mapping / unmapping regardless of the context.

Readers are probably much more interested in what you did in the following patches and why you did it, instead of being informed about what "we can" do.

I would suggest something like "The following patches convert the calls to kmap_atomic() to kmap_local_page() [the rest looks OK]".

Quoted 6 lines

This could also be the place to say something about why we prefer kmap_local_page() to kmap_atomic().

Are you sure that the reasons that motivates your conversions are merely summarized to kmap_local_page() being able to do mappings regardless of context? I think you are missing the real reasons why.

Thanks for your reminder, I'll emphasize the motivation here.

Quoted 2 lines

What about avoiding the often unwanted side effect of unnecessary page faults disables?

Good suggestion! I'll add this into this cover message.

What I think is that we have two reasons to do the replacement work:
1. (main motication) Avoid unnessary pagefaulta and preemption disabling to gain performance benefits.
2. We are trying to deprecate the old kmap/kmap_atomic interface. Some maintainer said it's also a good reason especially for the case that the performance is not critical [1].

In addition, also from [1], I find in some case people chooses kmap_atomic() for the consideration that they want the atomic context. So, the explaination about why the atomic context is not needed is also a reasion? I understand that I need to make special explaination in each commit depending on the situation (In this case, it is not suitable to describe in the cover?).

[1]: https://lore.kernel.org/lkml/YzRVaJA0EyfcVisW@liuwe-devbox-debian-v2/#t

Quoted 8 lines
Quoted 4 lines

With kmap_local_page(), the mapping is per thread, CPU local and not globally visible.

No news here. kmap_atomic() is "per thread, CPU local and not glocally visible". I cannot see any difference here between kmap_atomic() and kmap_local_page().

What about the below description which refers to your doc? "kmap_atomic() in the kernel creates a non-preemptible section and disable pagefaults. This could be a source of unwanted latency. And kmap_local_page effectively overcomes this issue because it doesn't disable pagefault and preemption."

Thanks,
Zhao

#29 lore raw
In reply to Zhao Liu
Quoted 4 lines · Zhao Liu

From: Zhao Liu <[email protected]>

The use of kmap_atomic() is being deprecated in favor of kmap_local_page()[1].

Zhao,

Was there ever a v2 of this series? I'm not finding it on Lore.

Thanks,
Ira

Quoted 35 lines

In the following patches, we can convert the calls of kmap_atomic() / kunmap_atomic() to kmap_local_page() / kunmap_local(), which can instead do the mapping / unmapping regardless of the context.

With kmap_local_page(), the mapping is per thread, CPU local and not globally visible.

[1]: https://lore.kernel.org/all/[email protected]
---
Zhao Liu (9):
drm/i915: Use kmap_local_page() in gem/i915_gem_object.c drm/i915: Use kmap_local_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             |  8 ++++----
 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, 30 insertions(+), 37 deletions(-)
Signature · 1 line
2.34.1
author
#30 lore raw
Quoted 6 lines · Ira Weiny

Date: Tue, 14 Feb 2023 20:25:08 -0800
From: Ira Weiny <[email protected]>
Subject: Re: [PATCH 0/9] drm/i915: Replace kmap_atomic() with
kmap_local_page()

Zhao Liu wrote:

Quoted 8 lines
Quoted 4 lines

From: Zhao Liu <[email protected]>

The use of kmap_atomic() is being deprecated in favor of kmap_local_page()[1].

Zhao,

Was there ever a v2 of this series? I'm not finding it on Lore.

Sorry Ira, my delay is too long, I was busy with other patch work, I will refresh v2 soon, and push this forward!

Best Regards,
Zhao

Quoted 41 lines

Thanks,
Ira

Quoted 35 lines

In the following patches, we can convert the calls of kmap_atomic() / kunmap_atomic() to kmap_local_page() / kunmap_local(), which can instead do the mapping / unmapping regardless of the context.

With kmap_local_page(), the mapping is per thread, CPU local and not globally visible.

[1]: https://lore.kernel.org/all/[email protected]
---
Zhao Liu (9):
drm/i915: Use kmap_local_page() in gem/i915_gem_object.c drm/i915: Use kmap_local_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             |  8 ++++----
 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, 30 insertions(+), 37 deletions(-)
Signature · 1 line
2.34.1
#31 lore raw
Quoted 12 lines · Zhao Liu
Quoted 11 lines · Ira Weiny

Date: Tue, 14 Feb 2023 20:25:08 -0800
From: Ira Weiny <[email protected]>
Subject: Re: [PATCH 0/9] drm/i915: Replace kmap_atomic() with
kmap_local_page()

Quoted 4 lines · Zhao Liu

From: Zhao Liu <[email protected]>

The use of kmap_atomic() is being deprecated in favor of kmap_local_page()[1].

Quoted 6 lines
Quoted 3 lines

Zhao,

Was there ever a v2 of this series? I'm not finding it on Lore.

Sorry Ira, my delay is too long, I was busy with other patch work, I will refresh v2 soon, and push this forward!

Awesome! Thanks!
Ira

Quoted 3 lines

Best Regards,
Zhao