[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5d621db9-23d4-e140-45eb-d7fca2093d2b@intel.com>
Date: Mon, 12 Oct 2020 09:28:29 -0700
From: Dave Hansen <dave.hansen@...el.com>
To: Eric Biggers <ebiggers@...nel.org>, Ira Weiny <ira.weiny@...el.com>
Cc: Matthew Wilcox <willy@...radead.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Andy Lutomirski <luto@...nel.org>,
Peter Zijlstra <peterz@...radead.org>, linux-aio@...ck.org,
linux-efi@...r.kernel.org, kvm@...r.kernel.org,
linux-doc@...r.kernel.org, linux-mmc@...r.kernel.org,
Dave Hansen <dave.hansen@...ux.intel.com>,
dri-devel@...ts.freedesktop.org, linux-mm@...ck.org,
target-devel@...r.kernel.org, linux-mtd@...ts.infradead.org,
linux-kselftest@...r.kernel.org, samba-technical@...ts.samba.org,
ceph-devel@...r.kernel.org, drbd-dev@...ts.linbit.com,
devel@...verdev.osuosl.org, linux-cifs@...r.kernel.org,
linux-nilfs@...r.kernel.org, linux-scsi@...r.kernel.org,
linux-nvdimm@...ts.01.org, linux-rdma@...r.kernel.org,
x86@...nel.org, amd-gfx@...ts.freedesktop.org,
linux-afs@...ts.infradead.org, cluster-devel@...hat.com,
linux-cachefs@...hat.com, intel-wired-lan@...ts.osuosl.org,
xen-devel@...ts.xenproject.org, linux-ext4@...r.kernel.org,
Fenghua Yu <fenghua.yu@...el.com>, ecryptfs@...r.kernel.org,
linux-um@...ts.infradead.org, intel-gfx@...ts.freedesktop.org,
linux-erofs@...ts.ozlabs.org, reiserfs-devel@...r.kernel.org,
linux-block@...r.kernel.org, linux-bcache@...r.kernel.org,
Jaegeuk Kim <jaegeuk@...nel.org>,
Dan Williams <dan.j.williams@...el.com>,
io-uring@...r.kernel.org, linux-nfs@...r.kernel.org,
linux-ntfs-dev@...ts.sourceforge.net, netdev@...r.kernel.org,
kexec@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-f2fs-devel@...ts.sourceforge.net,
linux-fsdevel@...r.kernel.org, bpf@...r.kernel.org,
linuxppc-dev@...ts.ozlabs.org, linux-btrfs@...r.kernel.org
Subject: Re: [PATCH RFC PKS/PMEM 22/58] fs/f2fs: Utilize new kmap_thread()
On 10/12/20 9:19 AM, Eric Biggers wrote:
> On Sun, Oct 11, 2020 at 11:56:35PM -0700, Ira Weiny wrote:
>>> And I still don't really understand. After this patchset, there is still code
>>> nearly identical to the above (doing a temporary mapping just for a memcpy) that
>>> would still be using kmap_atomic().
>> I don't understand. You mean there would be other call sites calling:
>>
>> kmap_atomic()
>> memcpy()
>> kunmap_atomic()
> Yes, there are tons of places that do this. Try 'git grep -A6 kmap_atomic'
> and look for memcpy().
>
> Hence why I'm asking what will be the "recommended" way to do this...
> kunmap_thread() or kmap_atomic()?
kmap_atomic() is always preferred over kmap()/kmap_thread().
kmap_atomic() is _much_ more lightweight since its TLB invalidation is
always CPU-local and never broadcast.
So, basically, unless you *must* sleep while the mapping is in place,
kmap_atomic() is preferred.
Powered by blists - more mailing lists