From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from newverein.lst.de (verein.lst.de [213.95.11.211]) (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 96C842034C0A1 for ; Fri, 20 Oct 2017 00:44:12 -0700 (PDT) Date: Fri, 20 Oct 2017 09:47:50 +0200 From: Christoph Hellwig Subject: Re: [PATCH v3 00/13] dax: fix dma vs truncate and remove 'page-less' support Message-ID: <20171020074750.GA13568@lst.de> References: <150846713528.24336.4459262264611579791.stgit@dwillia2-desk3.amr.corp.intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <150846713528.24336.4459262264611579791.stgit@dwillia2-desk3.amr.corp.intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" To: Dan Williams Cc: Michal Hocko , Jan Kara , Benjamin Herrenschmidt , Dave Hansen , Heiko Carstens , "J. Bruce Fields" , linux-mm@kvack.org, Paul Mackerras , Jeff Layton , hch@lst.de, Matthew Wilcox , linux-rdma@vger.kernel.org, Michael Ellerman , Jason Gunthorpe , Doug Ledford , Hal Rosenstock , Sean Hefty , Dave Chinner , linux-fsdevel@vger.kernel.org, Alexander Viro , Gerald Schaefer , linux-nvdimm@lists.01.org, linux-kernel@vger.kernel.org, linux-xfs@vger.kernel.org, Martin Schwidefsky , akpm@linux-foundation.org, "Darrick J. Wong" , "Kirill A. Shutemov" List-ID: > The solution presented is not pretty. It creates a stream of leases, one > for each get_user_pages() invocation, and polls page reference counts > until DMA stops. We're missing a reliable way to not only trap the > DMA-idle event, but also block new references being taken on pages while > truncate is allowed to progress. "[PATCH v3 12/13] dax: handle truncate of > dma-busy pages" presents other options considered, and notes that this > solution can only be viewed as a stop-gap. I'd like to brainstorm how we can do something better. How about: If we hit a page with an elevated refcount in truncate / hole puch etc for a DAX file system we do not free the blocks in the file system, but add it to the extent busy list. We mark the page as delayed free (e.g. page flag?) so that when it finally hits refcount zero we call back into the file system to remove it from the busy list. _______________________________________________ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: [PATCH v3 00/13] dax: fix dma vs truncate and remove 'page-less' support Date: Fri, 20 Oct 2017 09:47:50 +0200 Message-ID: <20171020074750.GA13568@lst.de> References: <150846713528.24336.4459262264611579791.stgit@dwillia2-desk3.amr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <150846713528.24336.4459262264611579791.stgit@dwillia2-desk3.amr.corp.intel.com> Sender: owner-linux-mm@kvack.org To: Dan Williams Cc: akpm@linux-foundation.org, Michal Hocko , Jan Kara , Benjamin Herrenschmidt , Dave Hansen , Dave Chinner , "J. Bruce Fields" , linux-mm@kvack.org, Paul Mackerras , Sean Hefty , Jeff Layton , Matthew Wilcox , linux-rdma@vger.kernel.org, Michael Ellerman , Jeff Moyer , hch@lst.de, Jason Gunthorpe , Doug Ledford , Ross Zwisler , Hal Rosenstock , Heiko Carstens , linux-nvdimm@lists.01.org, Alexander Viro , Gerald Schaefer , Darri List-Id: linux-rdma@vger.kernel.org > The solution presented is not pretty. It creates a stream of leases, one > for each get_user_pages() invocation, and polls page reference counts > until DMA stops. We're missing a reliable way to not only trap the > DMA-idle event, but also block new references being taken on pages while > truncate is allowed to progress. "[PATCH v3 12/13] dax: handle truncate of > dma-busy pages" presents other options considered, and notes that this > solution can only be viewed as a stop-gap. I'd like to brainstorm how we can do something better. How about: If we hit a page with an elevated refcount in truncate / hole puch etc for a DAX file system we do not free the blocks in the file system, but add it to the extent busy list. We mark the page as delayed free (e.g. page flag?) so that when it finally hits refcount zero we call back into the file system to remove it from the busy list. -- 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752086AbdJTHry (ORCPT ); Fri, 20 Oct 2017 03:47:54 -0400 Received: from verein.lst.de ([213.95.11.211]:47290 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751927AbdJTHrw (ORCPT ); Fri, 20 Oct 2017 03:47:52 -0400 Date: Fri, 20 Oct 2017 09:47:50 +0200 From: Christoph Hellwig To: Dan Williams Cc: akpm@linux-foundation.org, Michal Hocko , Jan Kara , Benjamin Herrenschmidt , Dave Hansen , Dave Chinner , "J. Bruce Fields" , linux-mm@kvack.org, Paul Mackerras , Sean Hefty , Jeff Layton , Matthew Wilcox , linux-rdma@vger.kernel.org, Michael Ellerman , Jeff Moyer , hch@lst.de, Jason Gunthorpe , Doug Ledford , Ross Zwisler , Hal Rosenstock , Heiko Carstens , linux-nvdimm@lists.01.org, Alexander Viro , Gerald Schaefer , "Darrick J. Wong" , linux-kernel@vger.kernel.org, linux-xfs@vger.kernel.org, Martin Schwidefsky , linux-fsdevel@vger.kernel.org, "Kirill A. Shutemov" Subject: Re: [PATCH v3 00/13] dax: fix dma vs truncate and remove 'page-less' support Message-ID: <20171020074750.GA13568@lst.de> References: <150846713528.24336.4459262264611579791.stgit@dwillia2-desk3.amr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <150846713528.24336.4459262264611579791.stgit@dwillia2-desk3.amr.corp.intel.com> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > The solution presented is not pretty. It creates a stream of leases, one > for each get_user_pages() invocation, and polls page reference counts > until DMA stops. We're missing a reliable way to not only trap the > DMA-idle event, but also block new references being taken on pages while > truncate is allowed to progress. "[PATCH v3 12/13] dax: handle truncate of > dma-busy pages" presents other options considered, and notes that this > solution can only be viewed as a stop-gap. I'd like to brainstorm how we can do something better. How about: If we hit a page with an elevated refcount in truncate / hole puch etc for a DAX file system we do not free the blocks in the file system, but add it to the extent busy list. We mark the page as delayed free (e.g. page flag?) so that when it finally hits refcount zero we call back into the file system to remove it from the busy list. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Fri, 20 Oct 2017 09:47:50 +0200 From: Christoph Hellwig To: Dan Williams Cc: akpm@linux-foundation.org, Michal Hocko , Jan Kara , Benjamin Herrenschmidt , Dave Hansen , Dave Chinner , "J. Bruce Fields" , linux-mm@kvack.org, Paul Mackerras , Sean Hefty , Jeff Layton , Matthew Wilcox , linux-rdma@vger.kernel.org, Michael Ellerman , Jeff Moyer , hch@lst.de, Jason Gunthorpe , Doug Ledford , Ross Zwisler , Hal Rosenstock , Heiko Carstens , linux-nvdimm@lists.01.org, Alexander Viro , Gerald Schaefer , "Darrick J. Wong" , linux-kernel@vger.kernel.org, linux-xfs@vger.kernel.org, Martin Schwidefsky , linux-fsdevel@vger.kernel.org, "Kirill A. Shutemov" Subject: Re: [PATCH v3 00/13] dax: fix dma vs truncate and remove 'page-less' support Message-ID: <20171020074750.GA13568@lst.de> References: <150846713528.24336.4459262264611579791.stgit@dwillia2-desk3.amr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <150846713528.24336.4459262264611579791.stgit@dwillia2-desk3.amr.corp.intel.com> Sender: owner-linux-mm@kvack.org List-ID: > The solution presented is not pretty. It creates a stream of leases, one > for each get_user_pages() invocation, and polls page reference counts > until DMA stops. We're missing a reliable way to not only trap the > DMA-idle event, but also block new references being taken on pages while > truncate is allowed to progress. "[PATCH v3 12/13] dax: handle truncate of > dma-busy pages" presents other options considered, and notes that this > solution can only be viewed as a stop-gap. I'd like to brainstorm how we can do something better. How about: If we hit a page with an elevated refcount in truncate / hole puch etc for a DAX file system we do not free the blocks in the file system, but add it to the extent busy list. We mark the page as delayed free (e.g. page flag?) so that when it finally hits refcount zero we call back into the file system to remove it from the busy list. -- 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