From: Luis Chamberlain <mcgrof@kernel.org>
To: "Fabio M. De Francesco" <fmdefrancesco@gmail.com>
Cc: Trond Myklebust <trond.myklebust@hammerspace.com>,
Anna Schumaker <anna@kernel.org>, Jens Axboe <axboe@kernel.dk>,
Chaitanya Kulkarni <kch@nvidia.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
Bart Van Assche <bvanassche@acm.org>,
Olga Kornievskaia <olga.kornievskaia@gmail.com>,
Russ Weight <russell.h.weight@intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Kees Cook <keescook@chromium.org>,
linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org,
Ira Weiny <ira.weiny@intel.com>
Subject: Re: [PATCH] fs/nfs: Replace kmap_atomic() with kmap_local_page() in dir.c
Date: Sun, 29 Jan 2023 16:45:50 -0800 [thread overview]
Message-ID: <Y9cTPu4PAbtjaeaR@bombadil.infradead.org> (raw)
In-Reply-To: <20230127215452.6399-1-fmdefrancesco@gmail.com>
On Fri, Jan 27, 2023 at 10:54:52PM +0100, Fabio M. De Francesco wrote:
> kmap_atomic() is deprecated in favor of kmap_local_page().
>
> With kmap_local_page() the mappings are per thread, CPU local, can take
> page-faults, and can be called from any context (including interrupts).
> Furthermore, the tasks can be preempted and, when they are scheduled to
> run again, the kernel virtual addresses are restored and still valid.
>
> kmap_atomic() is implemented like a kmap_local_page() which also disables
> page-faults and preemption (the latter only for !PREEMPT_RT kernels,
> otherwise it only disables migration).
>
> The code within the mappings/un-mappings in the functions of dir.c don't
> depend on the above-mentioned side effects of kmap_atomic(), so that mere
> replacements of the old API with the new one is all that is required
> (i.e., there is no need to explicitly add calls to pagefault_disable()
> and/or preempt_disable()).
>
> Therefore, replace kmap_atomic() with kmap_local_page() in fs/nfs/dir.c.
>
> Tested in a QEMU/KVM x86_32 VM, 6GB RAM, booting a kernel with
> HIGHMEM64GB enabled.
>
> Suggested-by: Ira Weiny <ira.weiny@intel.com>
> Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>
Luis
prev parent reply other threads:[~2023-01-30 0:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-27 21:54 Fabio M. De Francesco
2023-01-30 0:45 ` Luis Chamberlain [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=Y9cTPu4PAbtjaeaR@bombadil.infradead.org \
--to=mcgrof@kernel.org \
--cc=anna@kernel.org \
--cc=axboe@kernel.dk \
--cc=bvanassche@acm.org \
--cc=fmdefrancesco@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=ira.weiny@intel.com \
--cc=kch@nvidia.com \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=olga.kornievskaia@gmail.com \
--cc=russell.h.weight@intel.com \
--cc=trond.myklebust@hammerspace.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
all inboxes | Powered by JetHome®