All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Fabio M. De Francesco" <fmdefrancesco@gmail.com>
To: Viacheslav Dubeyko <slava@dubeyko.com>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	Ira Weiny <ira.weiny@intel.com>
Subject: Re: [PATCH] hfsplus: Convert kmap() to kmap_local_page() in bitmap.c
Date: Tue, 26 Jul 2022 14:04:00 +0200	[thread overview]
Message-ID: <2050755.bB369e8A3T@opensuse> (raw)
In-Reply-To: <A2FB0201-8342-481B-A60C-32A2B0494D33@dubeyko.com>

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@gmail.com> 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@dubeyko.com> 

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@intel.com>
> > Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
> > ---
> > fs/hfsplus/bitmap.c | 18 +++++++++---------
> > 1 file changed, 9 insertions(+), 9 deletions(-)

[snip]



      parent reply	other threads:[~2022-07-26 12:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-24 20:50 [PATCH] hfsplus: Convert kmap() to kmap_local_page() in bitmap.c Fabio M. De Francesco
2022-07-25 17:17 ` Viacheslav Dubeyko
2022-07-25 17:54   ` Matthew Wilcox
2022-07-26 18:40     ` Viacheslav Dubeyko
2022-08-01 12:56       ` Fabio M. De Francesco
2022-07-26 19:11     ` Ira Weiny
2022-07-26 20:38       ` Matthew Wilcox
2022-07-26 12:04   ` Fabio M. De Francesco [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=2050755.bB369e8A3T@opensuse \
    --to=fmdefrancesco@gmail.com \
    --cc=ira.weiny@intel.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=slava@dubeyko.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.