Re: [PATCH] hfsplus: Convert kmap() to kmap_local_page() in bitmap.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On lunedì 25 luglio 2022 19:17:13 CEST Viacheslav Dubeyko wrote:
> 
> > On Jul 24, 2022, at 1:50 PM, Fabio M. De Francesco 
<fmdefrancesco@xxxxxxxxx> wrote:
> > 
> > kmap() is being deprecated in favor of kmap_local_page().
> > 
> > There are two main problems with kmap(): (1) It comes with an overhead 
as
> > mapping space is restricted and protected by a global lock for
> > synchronization and (2) it also requires global TLB invalidation when 
the
> > kmap’s pool wraps and it might block when the mapping space is fully
> > utilized until a slot becomes available.
> > 
> > With kmap_local_page() the mappings are per thread, CPU local, can take
> > page faults, and can be called from any context (including interrupts).
> > It is faster than kmap() in kernels with HIGHMEM enabled. Furthermore,
> > the tasks can be preempted and, when they are scheduled to run again, 
the
> > kernel virtual addresses are restored and are still valid.
> > 
> > Since its use in bitmap.c is safe everywhere, it should be preferred.
> > 
> > Therefore, replace kmap() with kmap_local_page() in bnode.c.
> > 
> 
> Looks good. Maybe, it makes sense to combine all kmap() related 
modifications in HFS+ into
> one patchset?
> 
> Reviewed by: Viacheslav Dubeyko <slava@xxxxxxxxxxx> 

Thanks for your reviews of this and of the other patch to bnode.c.

Actually, I started with the first file I met (bnode.c) because I noticed 
that maintainers don't need to care about any special ordering for applying 
the patches, since each of them is self-contained.

This is why I haven't thought of making a series of them.

Currently only one file is still left with some kmap() call sites. I'll 
work on that within the next days.

Again thanks,

Fabio 

> Thanks,
> Slava.
> 
> > Suggested-by: Ira Weiny <ira.weiny@xxxxxxxxx>
> > Signed-off-by: Fabio M. De Francesco <fmdefrancesco@xxxxxxxxx>
> > ---
> > fs/hfsplus/bitmap.c | 18 +++++++++---------
> > 1 file changed, 9 insertions(+), 9 deletions(-)

[snip]






[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux