[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Y9cTPu4PAbtjaeaR@bombadil.infradead.org>
Date: Sun, 29 Jan 2023 16:45:50 -0800
From: Luis Chamberlain <mcgrof@...nel.org>
To: "Fabio M. De Francesco" <fmdefrancesco@...il.com>
Cc: Trond Myklebust <trond.myklebust@...merspace.com>,
Anna Schumaker <anna@...nel.org>, Jens Axboe <axboe@...nel.dk>,
Chaitanya Kulkarni <kch@...dia.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
Bart Van Assche <bvanassche@....org>,
Olga Kornievskaia <olga.kornievskaia@...il.com>,
Russ Weight <russell.h.weight@...el.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Kees Cook <keescook@...omium.org>, linux-nfs@...r.kernel.org,
linux-kernel@...r.kernel.org, Ira Weiny <ira.weiny@...el.com>
Subject: Re: [PATCH] fs/nfs: Replace kmap_atomic() with kmap_local_page() in
dir.c
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@...el.com>
> Signed-off-by: Fabio M. De Francesco <fmdefrancesco@...il.com>
Reviewed-by: Luis Chamberlain <mcgrof@...nel.org>
Luis
Powered by blists - more mailing lists