lkml.org 
[lkml]   [2022]   [Aug]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v1 1/2] zsmalloc: zs_object_copy: add clarifying comment
Date
It's not obvious why kunmap_atomic(d_addr) call is needed.

Signed-off-by: Alexey Romanov <avromanov@sberdevices.ru>
---
mm/zsmalloc.c | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
index 5d5fc04385b8..5efa8c592193 100644
--- a/mm/zsmalloc.c
+++ b/mm/zsmalloc.c
@@ -1564,6 +1564,12 @@ static void zs_object_copy(struct size_class *class, unsigned long dst,
d_off += size;
d_size -= size;

+ /* Calling kunmap_atomic(d_addr) is necessary. kunmap_atomic() calls
+ * must occurs in reverse order of calls to kmap_atomic().
+ * So, to call kunmap_atomic(s_addr) we should first call kunmap_atomic(d_addr).
+ * For more details see:
+ * https://lore.kernel.org/linux-mm/5512421D.4000603@samsung.com/
+ */
if (s_off >= PAGE_SIZE) {
kunmap_atomic(d_addr);
kunmap_atomic(s_addr);
--
2.30.1
\
 
 \ /
  Last update: 2022-08-11 17:44    [W:0.653 / U:0.588 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site