From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ira Weiny Date: Tue, 13 Oct 2020 20:50:12 +0000 Subject: Re: [PATCH RFC PKS/PMEM 33/58] fs/cramfs: Utilize new kmap_thread() Message-Id: <20201013205012.GI2046448@iweiny-DESK2.sc.intel.com> List-Id: References: <20201009195033.3208459-1-ira.weiny@intel.com> <20201009195033.3208459-34-ira.weiny@intel.com> <20201013193643.GK20115@casper.infradead.org> <20201013200149.GI3576660@ZenIV.linux.org.uk> In-Reply-To: <20201013200149.GI3576660@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Al Viro Cc: linux-aio@kvack.org, linux-efi , KVM list , Linux Doc Mailing List , Peter Zijlstra , linux-mmc@vger.kernel.org, Dave Hansen , Maling list - DRI developers , Linux MM , target-devel@vger.kernel.org, linux-mtd@lists.infradead.org, amd-gfx list , linux-kselftest@vger.kernel.org, samba-technical@lists.samba.org, Thomas Gleixner , drbd-dev@lists.linbit.com, devel@driverdev.osuosl.org, linux-cifs@vger.kernel.org, linux-nilfs@vger.kernel.org, linux-scsi , linux-nvdimm , linux-rdma , X86 ML , ceph-devel@vger.kernel.org, Matthew Wilcox , io-uring@vger.kernel.org, cluster-devel@redhat.com, Ingo Molnar , intel-wired-lan@lists.osuosl.org, xen-devel , linux-ext4 , Fenghua Yu , linux-afs@lists.infradead.org, linux-um@lists.infradead.org, intel-gfx@lists.freedesktop.org, ecryptfs@vger.kernel.org, linux-erofs@lists.ozlabs.org, reiserfs-devel@vger.kernel.org, linux-block@vger.kernel.org, linux-bcache@vger.kernel.org, Borislav Petkov , Andy Lutomirski , Dan Williams , bpf@vger.kernel.org, linux-cachefs@redhat.com, linux-nfs@vger.kernel.org, Nicolas Pitre , linux-ntfs-dev@lists.sourceforge.net, Netdev , Kexec Mailing List , Linux Kernel Mailing List , linux-f2fs-devel@lists.sourceforge.net, linux-fsdevel , Andrew Morton , linuxppc-dev , linux-btrfs On Tue, Oct 13, 2020 at 09:01:49PM +0100, Al Viro wrote: > On Tue, Oct 13, 2020 at 08:36:43PM +0100, Matthew Wilcox wrote: > > > 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 ? > > You mean, like > static void memcpy_from_page(char *to, struct page *page, size_t offset, size_t len) > { > char *from = kmap_atomic(page); > memcpy(to, from + offset, len); > kunmap_atomic(from); > } > > static void memcpy_to_page(struct page *page, size_t offset, const char *from, size_t len) > { > char *to = kmap_atomic(page); > memcpy(to + offset, from, len); > kunmap_atomic(to); > } > > static void memzero_page(struct page *page, size_t offset, size_t len) > { > char *addr = kmap_atomic(page); > memset(addr + offset, 0, len); > kunmap_atomic(addr); > } > > in lib/iov_iter.c? FWIW, I don't like that "highpage" in the name and > highmem.h as location - these make perfect sense regardless of highmem; > they are normal memory operations with page + offset used instead of > a pointer... I was thinking along those lines as well especially because of the direction this patch set takes kmap(). Thanks for pointing these out to me. How about I lift them to a common header? But if not highmem.h where? Ira