linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Ira Weiny <ira.weiny@intel.com>
To: "Sumitra Sharma" <sumitraartsy@gmail.com>,
	"Jérôme Glisse" <jglisse@redhat.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Cc: Ira Weiny <ira.weiny@intel.com>, Fabio <fmdefrancesco@gmail.com>,
	"Deepak R Varma" <drv@mailo.com>
Subject: Re: [PATCH v2] lib: Replace kmap() with kmap_local_page()
Date: Tue, 13 Jun 2023 14:08:47 -0700	[thread overview]
Message-ID: <6488dadf965f5_1afb9929434@iweiny-mobl.notmuch> (raw)
In-Reply-To: <20230610175712.GA348514@sumitra.com>

Sumitra Sharma wrote:
> kmap() has been deprecated in favor of the kmap_local_page()
> due to high cost, restricted mapping space, the overhead of
> a global lock for synchronization, and making the process
> sleep in the absence of free slots.
> 
> kmap_local_page() is faster than kmap() and offers thread-local
> and CPU-local mappings, take pagefaults in a local kmap region
> and preserves preemption by saving the mappings of outgoing
> tasks and restoring those of the incoming one during a context
> switch.
> 
> The mappings are kept thread local in the functions
> “dmirror_do_read” and “dmirror_do_write” in test_hmm.c
> 
> Therefore, replace kmap() with kmap_local_page() and use
> mempcy_from/to_page() to avoid open coding kmap_local_page()
> + memcpy() + kunmap_local().
> 
> Remove the unused variable “tmp”.
> 
> 
> Suggested-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
> 
> Signed-off-by: Sumitra Sharma <sumitraartsy@gmail.com>

LGTM

Reviewed-by: Ira Weiny <ira.weiny@intel.com>


  reply	other threads:[~2023-06-13 21:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-10 17:57 Sumitra Sharma
2023-06-13 21:08 ` Ira Weiny [this message]
2023-06-18  4:50 ` Fabio M. De Francesco
2023-06-19 16:40   ` Sumitra Sharma

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=6488dadf965f5_1afb9929434@iweiny-mobl.notmuch \
    --to=ira.weiny@intel.com \
    --cc=drv@mailo.com \
    --cc=fmdefrancesco@gmail.com \
    --cc=jglisse@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=sumitraartsy@gmail.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