From: Julia Lawall <julia.lawall@inria.fr>
To: Alaa Mohamed <eng.alaamohamedsoliman.am@gmail.com>
Cc: outreachy@lists.linux.dev, boris.ostrovsky@oracle.com,
jgross@suse.com, sstabellini@kernel.org,
xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org,
ira.weiny@intel.com
Subject: Re: [PATCH] xen: gntalloc.c: Convert kmap() to kmap_local_page()
Date: Mon, 18 Apr 2022 09:11:27 +0200 (CEST) [thread overview]
Message-ID: <alpine.DEB.2.22.394.2204180910320.2860@hadrien> (raw)
In-Reply-To: <20220418061927.6833-1-eng.alaamohamedsoliman.am@gmail.com>
On Mon, 18 Apr 2022, Alaa Mohamed wrote:
> The use of kmap() is being deprecated in favor of kmap_local_page()
> where it is feasible.
>
> With kmap_local_page(), the mapping is per thread, CPU local and not
> globally visible. Therefore __del_gref() is a function
> where the use of kmap_local_page() in place of kmap() is correctly
> suited.
What is it about __del_gref() that makes this change the right choice?
julia
>
> Signed-off-by: Alaa Mohamed <eng.alaamohamedsoliman.am@gmail.com>
> ---
> drivers/xen/gntalloc.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/xen/gntalloc.c b/drivers/xen/gntalloc.c
> index 4849f94372a4..55acb32842a3 100644
> --- a/drivers/xen/gntalloc.c
> +++ b/drivers/xen/gntalloc.c
> @@ -178,9 +178,9 @@ static void __del_gref(struct gntalloc_gref *gref)
> unsigned long addr;
>
> if (gref->notify.flags & UNMAP_NOTIFY_CLEAR_BYTE) {
> - uint8_t *tmp = kmap(gref->page);
> + uint8_t *tmp = kmap_local_page(gref->page);
> tmp[gref->notify.pgoff] = 0;
> - kunmap(gref->page);
> + kunmap_local(tmp);
> }
> if (gref->notify.flags & UNMAP_NOTIFY_SEND_EVENT) {
> notify_remote_via_evtchn(gref->notify.event);
> --
> 2.35.2
>
>
>
next prev parent reply other threads:[~2022-04-18 7:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-18 6:19 Alaa Mohamed
2022-04-18 7:11 ` Julia Lawall [this message]
2022-04-19 9:16 ` Juergen Gross
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=alpine.DEB.2.22.394.2204180910320.2860@hadrien \
--to=julia.lawall@inria.fr \
--cc=boris.ostrovsky@oracle.com \
--cc=eng.alaamohamedsoliman.am@gmail.com \
--cc=ira.weiny@intel.com \
--cc=jgross@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=outreachy@lists.linux.dev \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.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
all inboxes | Powered by JetHome®