linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Sergey Senozhatsky <senozhatsky@chromium.org>
To: Pintu Kumar <quic_pintu@quicinc.com>
Cc: minchan@kernel.org, senozhatsky@chromium.org,
	akpm@linux-foundation.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org, joe@perches.com,
	skhan@linuxfoundation.org, pintu.ping@gmail.com
Subject: Re: [PATCH 3/3] zsmalloc: replace kmap_atomic with kmap_local_page
Date: Wed, 2 Oct 2024 12:18:50 +0900	[thread overview]
Message-ID: <20241002031850.GJ11458@google.com> (raw)
In-Reply-To: <20241001175358.12970-1-quic_pintu@quicinc.com>

On (24/10/01 23:23), Pintu Kumar wrote:
> The use of kmap_atomic/kunmap_atomic is deprecated.
> Replace it will kmap_local_page/kunmap_local all over the place.
> Also fix SPDX missing license header.
> 
> WARNING: Missing or malformed SPDX-License-Identifier tag in line 1
> 
> WARNING: Deprecated use of 'kmap_atomic', prefer 'kmap_local_page' instead
> +               vaddr = kmap_atomic(page);
> 

Can you also update the comments (that mention kmap/kunmap atomic)?

---

diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
index d3ff10160a5f..5c3bb8a737b0 100644
--- a/mm/zsmalloc.c
+++ b/mm/zsmalloc.c
@@ -263,7 +263,7 @@ struct zspage {
 struct mapping_area {
 	local_lock_t lock;
 	char *vm_buf; /* copy buffer for objects that span pages */
-	char *vm_addr; /* address of kmap_atomic()'ed pages */
+	char *vm_addr; /* address of kmap_local() pages */
 	enum zs_mapmode vm_mm; /* mapping mode */
 };
 
@@ -1050,7 +1050,7 @@ static void *__zs_map_object(struct mapping_area *area,
 	void *addr;
 	char *buf = area->vm_buf;
 
-	/* disable page faults to match kmap_atomic() return conditions */
+	/* disable page faults to match kmap_local_page() return conditions */
 	pagefault_disable();
 
 	/* no read fastpath */
@@ -1099,7 +1099,7 @@ static void __zs_unmap_object(struct mapping_area *area,
 	kunmap_local(addr);
 
 out:
-	/* enable page faults to match kunmap_atomic() return conditions */
+	/* enable page faults to match kunmap_local() return conditions */
 	pagefault_enable();
 }
 
@@ -1510,13 +1510,6 @@ 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
-		 * Documentation/mm/highmem.rst.
-		 */
 		if (s_off >= PAGE_SIZE) {
 			kunmap_local(d_addr);
 			kunmap_local(s_addr);


  reply	other threads:[~2024-10-02  3:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-01 17:53 Pintu Kumar
2024-10-02  3:18 ` Sergey Senozhatsky [this message]
2024-10-03 16:55   ` Pintu Agarwal
2024-10-02  3:38 ` Matthew Wilcox
2024-10-03 18:07   ` Pintu Agarwal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241002031850.GJ11458@google.com \
    --to=senozhatsky@chromium.org \
    --cc=akpm@linux-foundation.org \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=minchan@kernel.org \
    --cc=pintu.ping@gmail.com \
    --cc=quic_pintu@quicinc.com \
    --cc=skhan@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox