From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 57B9CC43457 for ; Tue, 13 Oct 2020 20:45:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1E0D120BED for ; Tue, 13 Oct 2020 20:45:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726493AbgJMUpm (ORCPT ); Tue, 13 Oct 2020 16:45:42 -0400 Received: from mga06.intel.com ([134.134.136.31]:25495 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726186AbgJMUpl (ORCPT ); Tue, 13 Oct 2020 16:45:41 -0400 IronPort-SDR: mZwOtv67dqEBiGSFiQA1HH+52lu+XaatUyCHIwsEsQTVZco3BYJgpnR1BKZGjgtQ13OuzxqNuP qfsJLET/T3+g== X-IronPort-AV: E=McAfee;i="6000,8403,9773"; a="227623788" X-IronPort-AV: E=Sophos;i="5.77,371,1596524400"; d="scan'208";a="227623788" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Oct 2020 13:45:38 -0700 IronPort-SDR: 9cNNwyFW01V43IRpBEA5F+eU6gGnvdaUqvIfWWDJoXczsQwSY988pJwnA1f05GwG/v1vkNjadd aJS/wzoBibsg== X-IronPort-AV: E=Sophos;i="5.77,371,1596524400"; d="scan'208";a="530558193" Received: from iweiny-desk2.sc.intel.com (HELO localhost) ([10.3.52.147]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Oct 2020 13:45:37 -0700 Date: Tue, 13 Oct 2020 13:45:37 -0700 From: Ira Weiny To: Matthew Wilcox Cc: Dan Williams , Andrew Morton , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Andy Lutomirski , Peter Zijlstra , Nicolas Pitre , X86 ML , Dave Hansen , Fenghua Yu , Linux Doc Mailing List , Linux Kernel Mailing List , linux-nvdimm , linux-fsdevel , Linux MM , linux-kselftest@vger.kernel.org, linuxppc-dev , KVM list , Netdev , bpf@vger.kernel.org, Kexec Mailing List , linux-bcache@vger.kernel.org, linux-mtd@lists.infradead.org, devel@driverdev.osuosl.org, linux-efi , linux-mmc@vger.kernel.org, linux-scsi , target-devel@vger.kernel.org, linux-nfs@vger.kernel.org, ceph-devel@vger.kernel.org, linux-ext4 , linux-aio@kvack.org, io-uring@vger.kernel.org, linux-erofs@lists.ozlabs.org, linux-um@lists.infradead.org, linux-ntfs-dev@lists.sourceforge.net, reiserfs-devel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-nilfs@vger.kernel.org, cluster-devel@redhat.com, ecryptfs@vger.kernel.org, linux-cifs@vger.kernel.org, linux-btrfs , linux-afs@lists.infradead.org, linux-rdma , amd-gfx list , Maling list - DRI developers , intel-gfx@lists.freedesktop.org, drbd-dev@lists.linbit.com, linux-block@vger.kernel.org, xen-devel , linux-cachefs@redhat.com, samba-technical@lists.samba.org, intel-wired-lan@lists.osuosl.org Subject: Re: [PATCH RFC PKS/PMEM 33/58] fs/cramfs: Utilize new kmap_thread() Message-ID: <20201013204537.GH2046448@iweiny-DESK2.sc.intel.com> References: <20201009195033.3208459-1-ira.weiny@intel.com> <20201009195033.3208459-34-ira.weiny@intel.com> <20201013193643.GK20115@casper.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201013193643.GK20115@casper.infradead.org> User-Agent: Mutt/1.11.1 (2018-12-01) Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org On Tue, Oct 13, 2020 at 08:36:43PM +0100, Matthew Wilcox wrote: > On Tue, Oct 13, 2020 at 11:44:29AM -0700, Dan Williams wrote: > > On Fri, Oct 9, 2020 at 12:52 PM 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: Nicolas Pitre > > > Signed-off-by: Ira Weiny > > > --- > > > fs/cramfs/inode.c | 10 +++++----- > > > 1 file changed, 5 insertions(+), 5 deletions(-) > > > > > > diff --git a/fs/cramfs/inode.c b/fs/cramfs/inode.c > > > index 912308600d39..003c014a42ed 100644 > > > --- a/fs/cramfs/inode.c > > > +++ b/fs/cramfs/inode.c > > > @@ -247,8 +247,8 @@ static void *cramfs_blkdev_read(struct super_block *sb, unsigned int offset, > > > struct page *page = pages[i]; > > > > > > if (page) { > > > - memcpy(data, kmap(page), PAGE_SIZE); > > > - kunmap(page); > > > + memcpy(data, kmap_thread(page), PAGE_SIZE); > > > + kunmap_thread(page); > > > > Why does this need a sleepable kmap? This looks like a textbook > > kmap_atomic() use case. > > There's a lot of code of this form. Could we perhaps have: > > static inline void copy_to_highpage(struct page *to, void *vfrom, unsigned int size) > { > char *vto = kmap_atomic(to); > > memcpy(vto, vfrom, size); > kunmap_atomic(vto); > } > > in linux/highmem.h ? Christoph had the same idea. I'll work on it. Ira