From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Biggers Date: Fri, 9 Oct 2020 14:34:34 -0700 Subject: [Intel-wired-lan] [PATCH RFC PKS/PMEM 22/58] fs/f2fs: Utilize new kmap_thread() In-Reply-To: <20201009195033.3208459-23-ira.weiny@intel.com> References: <20201009195033.3208459-1-ira.weiny@intel.com> <20201009195033.3208459-23-ira.weiny@intel.com> Message-ID: <20201009213434.GA839@sol.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: intel-wired-lan@osuosl.org List-ID: On Fri, Oct 09, 2020 at 12:49:57PM -0700, ira.weiny at intel.com wrote: > From: Ira Weiny > > The kmap() calls in this FS are localized to a single thread. To avoid > the over head of global PKRS updates use the new kmap_thread() call. > > Cc: Jaegeuk Kim > Cc: Chao Yu > Signed-off-by: Ira Weiny > --- > fs/f2fs/f2fs.h | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h > index d9e52a7f3702..ff72a45a577e 100644 > --- a/fs/f2fs/f2fs.h > +++ b/fs/f2fs/f2fs.h > @@ -2410,12 +2410,12 @@ static inline struct page *f2fs_pagecache_get_page( > > static inline void f2fs_copy_page(struct page *src, struct page *dst) > { > - char *src_kaddr = kmap(src); > - char *dst_kaddr = kmap(dst); > + char *src_kaddr = kmap_thread(src); > + char *dst_kaddr = kmap_thread(dst); > > memcpy(dst_kaddr, src_kaddr, PAGE_SIZE); > - kunmap(dst); > - kunmap(src); > + kunmap_thread(dst); > + kunmap_thread(src); > } Wouldn't it make more sense to switch cases like this to kmap_atomic()? The pages are only mapped to do a memcpy(), then they're immediately unmapped. - Eric