Linux RAID subsystem development
 help / color / mirror / Atom feed
From: Ira Weiny <ira.weiny@intel.com>
To: David Reaver <me@davidreaver.com>, Song Liu <song@kernel.org>,
	Yu Kuai <yukuai3@huawei.com>
Cc: David Reaver <me@davidreaver.com>, <linux-raid@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>,
	Krister Johansen <kjlx@templeofstupid.com>,
	Ira Weiny <ira.weiny@intel.com>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH] md: Replace deprecated kmap_atomic() with kmap_local_page()
Date: Fri, 10 Jan 2025 09:08:34 -0600	[thread overview]
Message-ID: <678137f2106fd_167faf29436@iweiny-mobl.notmuch> (raw)
In-Reply-To: <20250108192131.46843-1-me@davidreaver.com>

David Reaver wrote:
> kmap_atomic() is deprecated and should be replaced with kmap_local_page()
> [1][2]. kmap_local_page() is faster in kernels with HIGHMEM enabled, can
> take page faults, and allows preemption.
> 
> According to [2], this is safe as long as the code between kmap_atomic()
> and kunmap_atomic() does not implicitly depend on disabling page faults or
> preemption. It appears to me that none of the call sites in this patch
> depend on disabling page faults or preemption; they are all mapping a page
> to simply extract some information from it or print some debug info.
> 
> [1] https://lwn.net/Articles/836144/
> [2] https://docs.kernel.org/mm/highmem.html#temporary-virtual-mappings
> 
> Signed-off-by: David Reaver <me@davidreaver.com>
> ---
> 

[snip]

> @@ -1387,9 +1387,9 @@ static int md_bitmap_init_from_disk(struct bitmap *bitmap, sector_t start)
>  			 * If the bitmap is out of date, dirty the whole page
>  			 * and write it out
>  			 */
> -			paddr = kmap_atomic(page);
> +			paddr = kmap_local_page(page);
>  			memset(paddr + offset, 0xff, PAGE_SIZE - offset);
> -			kunmap_atomic(paddr);
> +			kunmap_local(paddr);

For these we defined memset_page()

With that change:

Reviewed-by: Ira Weiny <ira.weiny@intel.com>

[snip]

      parent reply	other threads:[~2025-01-10 15:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-08 19:21 [PATCH] md: Replace deprecated kmap_atomic() with kmap_local_page() David Reaver
2025-01-08 21:43 ` Song Liu
2025-01-10 15:08 ` Ira Weiny [this message]

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=678137f2106fd_167faf29436@iweiny-mobl.notmuch \
    --to=ira.weiny@intel.com \
    --cc=kjlx@templeofstupid.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=me@davidreaver.com \
    --cc=song@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=yukuai3@huawei.com \
    /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