lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6488dadf965f5_1afb9929434@iweiny-mobl.notmuch>
Date:   Tue, 13 Jun 2023 14:08:47 -0700
From:   Ira Weiny <ira.weiny@...el.com>
To:     Sumitra Sharma <sumitraartsy@...il.com>,
        Jérôme Glisse <jglisse@...hat.com>,
        <linux-mm@...ck.org>, <linux-kernel@...r.kernel.org>
CC:     Ira Weiny <ira.weiny@...el.com>, Fabio <fmdefrancesco@...il.com>,
        "Deepak R Varma" <drv@...lo.com>
Subject: Re: [PATCH v2] lib: Replace kmap() with kmap_local_page()

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@...il.com>
> 
> Signed-off-by: Sumitra Sharma <sumitraartsy@...il.com>

LGTM

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ