From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id A49B1202E60E7 for ; Mon, 23 Oct 2017 03:40:55 -0700 (PDT) Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v9NAiRwo006716 for ; Mon, 23 Oct 2017 06:44:38 -0400 Received: from e06smtp13.uk.ibm.com (e06smtp13.uk.ibm.com [195.75.94.109]) by mx0a-001b2d01.pphosted.com with ESMTP id 2dsc8eqfcp-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 23 Oct 2017 06:44:37 -0400 Received: from localhost by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 23 Oct 2017 11:44:34 +0100 Date: Mon, 23 Oct 2017 12:44:27 +0200 From: Martin Schwidefsky Subject: Re: [PATCH v3 02/13] dax: require 'struct page' for filesystem dax In-Reply-To: References: <150846713528.24336.4459262264611579791.stgit@dwillia2-desk3.amr.corp.intel.com> <150846714747.24336.14704246566580871364.stgit@dwillia2-desk3.amr.corp.intel.com> <20171020075735.GA14378@lst.de> <20171020162933.GA26320@lst.de> <20171023071835.67ee5210@mschwideX1> MIME-Version: 1.0 Message-Id: <20171023124427.10d15ee3@mschwideX1> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" To: Dan Williams Cc: Jan Kara , "linux-nvdimm@lists.01.org" , Benjamin Herrenschmidt , Heiko Carstens , "linux-kernel@vger.kernel.org" , linux-xfs@vger.kernel.org, Linux MM , Paul Mackerras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Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751409AbdJWKoj convert rfc822-to-8bit (ORCPT ); Mon, 23 Oct 2017 06:44:39 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:48368 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751327AbdJWKoi (ORCPT ); Mon, 23 Oct 2017 06:44:38 -0400 Date: Mon, 23 Oct 2017 12:44:27 +0200 From: Martin Schwidefsky To: Dan Williams Cc: Christoph Hellwig , Andrew Morton , Jan Kara , "linux-nvdimm@lists.01.org" , Benjamin Herrenschmidt , Heiko Carstens , "linux-kernel@vger.kernel.org" , linux-xfs@vger.kernel.org, Linux MM , Jeff Moyer , Paul Mackerras , Michael Ellerman , linux-fsdevel , Ross Zwisler , Gerald Schaefer Subject: Re: [PATCH v3 02/13] dax: require 'struct page' for filesystem dax In-Reply-To: References: <150846713528.24336.4459262264611579791.stgit@dwillia2-desk3.amr.corp.intel.com> <150846714747.24336.14704246566580871364.stgit@dwillia2-desk3.amr.corp.intel.com> <20171020075735.GA14378@lst.de> <20171020162933.GA26320@lst.de> <20171023071835.67ee5210@mschwideX1> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-TM-AS-GCONF: 00 x-cbid: 17102310-0012-0000-0000-00000584DF7E X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17102310-0013-0000-0000-000018FF4EC7 Message-Id: <20171023124427.10d15ee3@mschwideX1> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-10-23_03:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1710230155 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 23 Oct 2017 01:55:20 -0700 Dan Williams wrote: > On Sun, Oct 22, 2017 at 10:18 PM, Martin Schwidefsky > wrote: > > On Fri, 20 Oct 2017 18:29:33 +0200 > > Christoph Hellwig wrote: > > > >> On Fri, Oct 20, 2017 at 08:23:02AM -0700, Dan Williams wrote: > >> > Yes, however it seems these drivers / platforms have been living with > >> > the lack of struct page for a long time. So they either don't use DAX, > >> > or they have a constrained use case that never triggers > >> > get_user_pages(). If it is the latter then they could introduce a new > >> > configuration option that bypasses the pfn_t_devmap() check in > >> > bdev_dax_supported() and fix up the get_user_pages() paths to fail. > >> > So, I'd like to understand how these drivers have been using DAX > >> > support without struct page to see if we need a workaround or we can > >> > go ahead delete this support. If the usage is limited to > >> > execute-in-place perhaps we can do a constrained ->direct_access() for > >> > just that case. > >> > >> For axonram I doubt anyone is using it any more - it was a very for > >> the IBM Cell blades, which were produceѕ in a rather limited number. > >> And Cell basically seems to be dead as far as I can tell. > >> > >> For S/390 Martin might be able to help out what the status of xpram > >> in general and DAX support in particular is. > > > > The goes back to the time where DAX was called XIP. The initial design > > point has been *not* to have struct pages for a large read-only memory > > area. There is a block device driver for z/VM that maps a DCSS segment > > somewhere in memore (no struct page!) with e.g. the complete /usr > > filesystem. The xpram driver is a different beast and has nothing to > > do with XIP/DAX. > > > > Now, if any there are very few users of the dcssblk driver out there. > > The idea to save a few megabyte for /usr never really took of. > > > > We have to look at our get_user_pages() implementation to see how hard > > it would be to make it fail if the target address is for an area without > > struct pages. > > For read-only memory I think we can enable a subset of DAX, and > explicitly turn off the paths that require get_user_pages(). However, > I wonder if anyone has tested DAX with dcssblk because fork() requires > get_user_pages()? I did not test it recently, someone else might have. Gerald? Looking at the code I see this in the s390 version of gup_pte_range: mask = (write ? _PAGE_PROTECT : 0) | _PAGE_INVALID | _PAGE_SPECIAL; ... if ((pte_val(pte) & mask) != 0) return 0; ... The XIP code used the pte_mkspecial mechanics to make it work. As far as I can see the pfn_t_devmap returns true for the DAX mappins, yes? Then I would say that dcssblk and DAX currently do not work together. -- blue skies, Martin. "Reality continues to ruin my life." - Calvin. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Mon, 23 Oct 2017 12:44:27 +0200 From: Martin Schwidefsky To: Dan Williams Cc: Christoph Hellwig , Andrew Morton , Jan Kara , "linux-nvdimm@lists.01.org" , Benjamin Herrenschmidt , Heiko Carstens , "linux-kernel@vger.kernel.org" , linux-xfs@vger.kernel.org, Linux MM , Jeff Moyer , Paul Mackerras , Michael Ellerman , linux-fsdevel , Ross Zwisler , Gerald Schaefer Subject: Re: [PATCH v3 02/13] dax: require 'struct page' for filesystem dax In-Reply-To: References: <150846713528.24336.4459262264611579791.stgit@dwillia2-desk3.amr.corp.intel.com> <150846714747.24336.14704246566580871364.stgit@dwillia2-desk3.amr.corp.intel.com> <20171020075735.GA14378@lst.de> <20171020162933.GA26320@lst.de> <20171023071835.67ee5210@mschwideX1> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Message-Id: <20171023124427.10d15ee3@mschwideX1> Sender: owner-linux-mm@kvack.org List-ID: On Mon, 23 Oct 2017 01:55:20 -0700 Dan Williams wrote: > On Sun, Oct 22, 2017 at 10:18 PM, Martin Schwidefsky > wrote: > > On Fri, 20 Oct 2017 18:29:33 +0200 > > Christoph Hellwig wrote: > > =20 > >> On Fri, Oct 20, 2017 at 08:23:02AM -0700, Dan Williams wrote: =20 > >> > Yes, however it seems these drivers / platforms have been living with > >> > the lack of struct page for a long time. So they either don't use DA= X, > >> > or they have a constrained use case that never triggers > >> > get_user_pages(). If it is the latter then they could introduce a new > >> > configuration option that bypasses the pfn_t_devmap() check in > >> > bdev_dax_supported() and fix up the get_user_pages() paths to fail. > >> > So, I'd like to understand how these drivers have been using DAX > >> > support without struct page to see if we need a workaround or we can > >> > go ahead delete this support. If the usage is limited to > >> > execute-in-place perhaps we can do a constrained ->direct_access() f= or > >> > just that case. =20 > >> > >> For axonram I doubt anyone is using it any more - it was a very for > >> the IBM Cell blades, which were produce=D1=95 in a rather limited numb= er. > >> And Cell basically seems to be dead as far as I can tell. > >> > >> For S/390 Martin might be able to help out what the status of xpram > >> in general and DAX support in particular is. =20 > > > > The goes back to the time where DAX was called XIP. The initial design > > point has been *not* to have struct pages for a large read-only memory > > area. There is a block device driver for z/VM that maps a DCSS segment > > somewhere in memore (no struct page!) with e.g. the complete /usr > > filesystem. The xpram driver is a different beast and has nothing to > > do with XIP/DAX. > > > > Now, if any there are very few users of the dcssblk driver out there. > > The idea to save a few megabyte for /usr never really took of. > > > > We have to look at our get_user_pages() implementation to see how hard > > it would be to make it fail if the target address is for an area without > > struct pages. =20 >=20 > For read-only memory I think we can enable a subset of DAX, and > explicitly turn off the paths that require get_user_pages(). However, > I wonder if anyone has tested DAX with dcssblk because fork() requires > get_user_pages()? =20 I did not test it recently, someone else might have. Gerald? Looking at the code I see this in the s390 version of gup_pte_range: mask =3D (write ? _PAGE_PROTECT : 0) | _PAGE_INVALID | _PAGE_SPECIA= L; ... if ((pte_val(pte) & mask) !=3D 0) return 0; ... The XIP code used the pte_mkspecial mechanics to make it work. As far as I can see the pfn_t_devmap returns true for the DAX mappins, yes? Then I would say that dcssblk and DAX currently do not work together. --=20 blue skies, Martin. "Reality continues to ruin my life." - Calvin. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org