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=-9.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 7505BC43467 for ; Tue, 13 Oct 2020 19:41:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2515A21582 for ; Tue, 13 Oct 2020 19:41:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=intel-com.20150623.gappssmtp.com header.i=@intel-com.20150623.gappssmtp.com header.b="kTjS5KS3" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729216AbgJMTlz (ORCPT ); Tue, 13 Oct 2020 15:41:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729209AbgJMTly (ORCPT ); Tue, 13 Oct 2020 15:41:54 -0400 Received: from mail-ej1-x641.google.com (mail-ej1-x641.google.com [IPv6:2a00:1450:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD909C0613E0 for ; Tue, 13 Oct 2020 12:41:53 -0700 (PDT) Received: by mail-ej1-x641.google.com with SMTP id md26so1414044ejb.10 for ; Tue, 13 Oct 2020 12:41:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=jlOzF1QhqikCoQxsvfJV6M6Hjgbrow9dB9uNs1AoGLE=; b=kTjS5KS3nYcf/wrvTsuRt1BvzGw557kJOoPvyzYoBgiqb4b8bKtbI2/mMLiZYyRjFR J9ydTuu0x47x+MEvbUBFhFH3/2QgRWgMVRtg9k6OLuYDe131Mp/cuPa30fJMGhSFjepr cqBBXWNROTwzHkSN49lY/psarWhxU27El5EYWXEJaiWvhTqo66L6QK98x3Y0Yvi2nF9y UTW/CUag9LBP+VfPW+1mn8JfLpPCSXoAzeg5FBjWoJMu0+7UEW9Ka5T8iigFwOd+JDvR rrctnvxFOZW164mxjZq4IMmZGZxG4l2jAUbsCf6skOMzcKIRAwJ8OakZ/jL0rfexuXSd 7ngQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=jlOzF1QhqikCoQxsvfJV6M6Hjgbrow9dB9uNs1AoGLE=; b=aBxj0XdtT+SiPu2nltcAv+35SK6ZDubqGcXLqPyx5nI6ocBamKL9yXZgUBjElcDu41 a7YDGs40dzEzRffKuwGxpVwULHt6Y2wVw/qraY3RwfEeGwYWZbB9eekRc2Lrgis2s9At eUxBiLvUvEgIf4BGrYUq+bMSUh+YajkxQtqB4tyzABDYPfegb+fIaszRi3ML1pEFLzle XcnUtvZYjKjFnaXT6GqSYsXUa9rJWPJqa3D9FHR0Yqs3yeAjYidOtr8PDzZY094q3+1J NeamJuF2O1K9PxuVPEyBsgeykJOwLyAeFC++dZfUFghGhfanOWzJ8diZfkF4JJU7MrJN NA3A== X-Gm-Message-State: AOAM5315fJLTYkoIfn9zObhlz+8GA4/U//eeNFrkpidY2vRDMWJ8NBhb eKzcuI/E86naUVFjB7UkziCAEPyKIJWyocRlAUy2Ug== X-Google-Smtp-Source: ABdhPJxGxhMZ7o2BYtIDXOupUr3pSHVXck0tIwC9HMZ0nIbp0pU6AQKRljKqMwVkoxmX0BYp74elTVEnpYvo3LWFH24= X-Received: by 2002:a17:906:7e47:: with SMTP id z7mr1390518ejr.418.1602618108255; Tue, 13 Oct 2020 12:41:48 -0700 (PDT) MIME-Version: 1.0 References: <20201009195033.3208459-1-ira.weiny@intel.com> <20201009195033.3208459-34-ira.weiny@intel.com> <20201013193643.GK20115@casper.infradead.org> In-Reply-To: <20201013193643.GK20115@casper.infradead.org> From: Dan Williams Date: Tue, 13 Oct 2020 12:41:36 -0700 Message-ID: Subject: Re: [PATCH RFC PKS/PMEM 33/58] fs/cramfs: Utilize new kmap_thread() To: Matthew Wilcox Cc: "Weiny, Ira" , 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 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org On Tue, Oct 13, 2020 at 12:37 PM 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 ? Nice, yes, that could also replace the local ones in lib/iov_iter.c (memcpy_{to,from}_page())