Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752117AbbEGPwU (ORCPT ); Thu, 7 May 2015 11:52:20 -0400 Received: from mail-wg0-f47.google.com ([74.125.82.47]:35064 "EHLO mail-wg0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751342AbbEGPwQ (ORCPT ); Thu, 7 May 2015 11:52:16 -0400 MIME-Version: 1.0 In-Reply-To: <20150507144225.GA20491@gmail.com> References: <20150506200219.40425.74411.stgit@dwillia2-desk3.amr.corp.intel.com> <20150507090217.GA4467@gmail.com> <20150507144225.GA20491@gmail.com> Date: Thu, 7 May 2015 08:52:15 -0700 Message-ID: Subject: Re: [PATCH v2 00/10] evacuate struct page from the block layer, introduce __pfn_t From: Dan Williams To: Ingo Molnar Cc: Linus Torvalds , Linux Kernel Mailing List , Boaz Harrosh , Jan Kara , Mike Snitzer , Neil Brown , Benjamin Herrenschmidt , Dave Hansen , Heiko Carstens , Chris Mason , Paul Mackerras , "H. Peter Anvin" , Christoph Hellwig , Alasdair Kergon , "linux-nvdimm@lists.01.org" , Mel Gorman , Matthew Wilcox , Ross Zwisler , Rik van Riel , Martin Schwidefsky , Jens Axboe , "Theodore Ts'o" , "Martin K. Petersen" , Julia Lawall , Tejun Heo , linux-fsdevel , Andrew Morton Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2526 Lines: 60 On Thu, May 7, 2015 at 7:42 AM, Ingo Molnar wrote: > > * Ingo Molnar wrote: > >> [...] >> >> For anything more complex, that maps any of this storage to >> user-space, or exposes it to higher level struct page based APIs, >> etc., where references matter and it's more of a cache with >> potentially multiple users, not an IO space, the natural API is >> struct page. > > Let me walk back on this: > >> I'd say that this particular series mostly addresses the 'pfn as >> sector_t' side of the equation, where persistent memory is IO space, >> not memory space, and as such it is the more natural and thus also >> the cheaper/faster approach. > > ... but that does not appear to be the case: this series replaces a > 'struct page' interface with a pure pfn interface for the express > purpose of being able to DMA to/from 'memory areas' that are not > struct page backed. > >> Linus probably disagrees? :-) > > [ and he'd disagree rightfully ;-) ] > > So what this patch set tries to achieve is (sector_t -> sector_t) IO > between storage devices (i.e. a rare and somewhat weird usecase), and > does it by squeezing one device's storage address into our formerly > struct page backed descriptor, via a pfn. > > That looks like a layering violation and a mistake to me. If we want > to do direct (sector_t -> sector_t) IO, with no serialization worries, > it should have its own (simple) API - which things like hierarchical > RAID or RDMA APIs could use. I'm wrapped around the idea that __pfn_t *is* that simple api for the tiered storage driver use case. For RDMA I think we need struct page because I assume that would be coordinated through a filesystem an truncate() is back in play. What does an alternative API look like? > If what we want to do is to support say an mmap() of a file on > persistent storage, and then read() into that file from another device > via DMA, then I think we should have allocated struct page backing at > mmap() time already, and all regular syscall APIs would 'just work' > from that point on - far above what page-less, pfn-based APIs can do. > > The temporary struct page backing can then be freed at munmap() time. Yes, passing around mmap()'d (DAX) persistent memory will need more than a __pfn_t. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/