linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Ira Weiny <ira.weiny@intel.com>
To: "Fabio M. De Francesco"
	<fabio.maria.de.francesco@linux.intel.com>,
	Andrew Morton <akpm@linux-foundation.org>, <linux-mm@kvack.org>,
	<linux-kernel@vger.kernel.org>
Cc: "Fabio M. De Francesco"
	<fabio.maria.de.francesco@linux.intel.com>,
	"Ira Weiny" <ira.weiny@intel.com>
Subject: Re: [PATCH] mm/memory: Replace kmap() with kmap_local_page()
Date: Sun, 17 Dec 2023 19:34:13 -0800	[thread overview]
Message-ID: <657fbdb5db945_126a129483@iweiny-mobl.notmuch> (raw)
In-Reply-To: <20231215084417.2002370-1-fabio.maria.de.francesco@linux.intel.com>

Fabio M. De Francesco wrote:

[snip]

> 
> Cc: Ira Weiny <ira.weiny@intel.com>
> Signed-off-by: Fabio M. De Francesco <fabio.maria.de.francesco@linux.intel.com>
> ---
>  mm/memory.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/mm/memory.c b/mm/memory.c
> index 7d9f6b685032..88377a107fbe 100644
> --- a/mm/memory.c
> +++ b/mm/memory.c
> @@ -5852,7 +5852,7 @@ static int __access_remote_vm(struct mm_struct *mm, unsigned long addr,
>  			if (bytes > PAGE_SIZE-offset)
>  				bytes = PAGE_SIZE-offset;
>  
> -			maddr = kmap(page);
> +			maddr = kmap_local_page(page);
>  			if (write) {
>  				copy_to_user_page(vma, page, addr,
>  						  maddr + offset, buf, bytes);
> @@ -5861,8 +5861,7 @@ static int __access_remote_vm(struct mm_struct *mm, unsigned long addr,
>  				copy_from_user_page(vma, page, addr,
>  						    buf, maddr + offset, bytes);
>  			}
> -			kunmap(page);
> -			put_page(page);
> +			unmap_and_put_page(page, maddr);

Does this really have the same functionality?

Ira


  reply	other threads:[~2023-12-18  3:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-15  8:43 Fabio M. De Francesco
2023-12-18  3:34 ` Ira Weiny [this message]
2023-12-18  7:43   ` Fabio M. De Francesco
2023-12-20 19:53     ` Ira Weiny
2023-12-20 19:59       ` Matthew Wilcox
  -- strict thread matches above, loose matches on Subject: below --
2023-12-14  8:10 Fabio M. De Francesco
2023-12-14 19:47 ` Andrew Morton
2023-12-15  8:40   ` Fabio M. De Francesco
2023-12-15 16:17     ` Fabio M. De Francesco

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=657fbdb5db945_126a129483@iweiny-mobl.notmuch \
    --to=ira.weiny@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=fabio.maria.de.francesco@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.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