From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: [PATCH v5 13/17] dax: dax_iomap_fault() needs to call iomap_end() Date: Mon, 10 Oct 2016 17:50:04 +0200 Message-ID: <20161010155004.GD19343@lst.de> References: <1475874544-24842-1-git-send-email-ross.zwisler@linux.intel.com> <1475874544-24842-14-git-send-email-ross.zwisler@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-kernel@vger.kernel.org, Theodore Ts'o , Alexander Viro , Andreas Dilger , Andrew Morton , Christoph Hellwig , Dan Williams , Dave Chinner , Jan Kara , Matthew Wilcox , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@lists.01.org, linux-xfs@vger.kernel.org To: Ross Zwisler Return-path: Content-Disposition: inline In-Reply-To: <1475874544-24842-14-git-send-email-ross.zwisler@linux.intel.com> Sender: owner-linux-mm@kvack.org List-Id: linux-ext4.vger.kernel.org On Fri, Oct 07, 2016 at 03:09:00PM -0600, Ross Zwisler wrote: > Currently iomap_end() doesn't do anything for DAX page faults for both ext2 > and XFS. ext2_iomap_end() just checks for a write underrun, and > xfs_file_iomap_end() checks to see if it needs to finish a delayed > allocation. However, in the future iomap_end() calls might be needed to > make sure we have balanced allocations, locks, etc. So, add calls to > iomap_end() with appropriate error handling to dax_iomap_fault(). Is there a way to just have a single call to iomap_end at the end of the function, after which we just return a previosuly setup return value? e.g. out: if (ops->iomap_end) { error = ops->iomap_end(inode, pos, PAGE_SIZE, PAGE_SIZE, flags, &iomap); } if (error == -ENOMEM) return VM_FAULT_OOM | major; if (error < 0 && error != -EBUSY) return VM_FAULT_SIGBUS | major; return ret; -- 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: 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 70E6D1A1E3D for ; Mon, 10 Oct 2016 08:50:06 -0700 (PDT) Date: Mon, 10 Oct 2016 17:50:04 +0200 From: Christoph Hellwig Subject: Re: [PATCH v5 13/17] dax: dax_iomap_fault() needs to call iomap_end() Message-ID: <20161010155004.GD19343@lst.de> References: <1475874544-24842-1-git-send-email-ross.zwisler@linux.intel.com> <1475874544-24842-14-git-send-email-ross.zwisler@linux.intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1475874544-24842-14-git-send-email-ross.zwisler@linux.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: Ross Zwisler Cc: Theodore Ts'o , Matthew Wilcox , Dave Chinner , linux-nvdimm@lists.01.org, linux-kernel@vger.kernel.org, linux-xfs@vger.kernel.org, linux-mm@kvack.org, Andreas Dilger , Alexander Viro , Jan Kara , linux-fsdevel@vger.kernel.org, Andrew Morton , linux-ext4@vger.kernel.org, Christoph Hellwig List-ID: On Fri, Oct 07, 2016 at 03:09:00PM -0600, Ross Zwisler wrote: > Currently iomap_end() doesn't do anything for DAX page faults for both ext2 > and XFS. ext2_iomap_end() just checks for a write underrun, and > xfs_file_iomap_end() checks to see if it needs to finish a delayed > allocation. However, in the future iomap_end() calls might be needed to > make sure we have balanced allocations, locks, etc. So, add calls to > iomap_end() with appropriate error handling to dax_iomap_fault(). Is there a way to just have a single call to iomap_end at the end of the function, after which we just return a previosuly setup return value? e.g. out: if (ops->iomap_end) { error = ops->iomap_end(inode, pos, PAGE_SIZE, PAGE_SIZE, flags, &iomap); } if (error == -ENOMEM) return VM_FAULT_OOM | major; if (error < 0 && error != -EBUSY) return VM_FAULT_SIGBUS | major; return ret; _______________________________________________ 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 Return-Path: Received: from verein.lst.de ([213.95.11.211]:59009 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752306AbcJJPuX (ORCPT ); Mon, 10 Oct 2016 11:50:23 -0400 Date: Mon, 10 Oct 2016 17:50:04 +0200 From: Christoph Hellwig Subject: Re: [PATCH v5 13/17] dax: dax_iomap_fault() needs to call iomap_end() Message-ID: <20161010155004.GD19343@lst.de> References: <1475874544-24842-1-git-send-email-ross.zwisler@linux.intel.com> <1475874544-24842-14-git-send-email-ross.zwisler@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1475874544-24842-14-git-send-email-ross.zwisler@linux.intel.com> Sender: linux-xfs-owner@vger.kernel.org List-ID: List-Id: xfs To: Ross Zwisler Cc: linux-kernel@vger.kernel.org, Theodore Ts'o , Alexander Viro , Andreas Dilger , Andrew Morton , Christoph Hellwig , Dan Williams , Dave Chinner , Jan Kara , Matthew Wilcox , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@lists.01.org, linux-xfs@vger.kernel.org On Fri, Oct 07, 2016 at 03:09:00PM -0600, Ross Zwisler wrote: > Currently iomap_end() doesn't do anything for DAX page faults for both ext2 > and XFS. ext2_iomap_end() just checks for a write underrun, and > xfs_file_iomap_end() checks to see if it needs to finish a delayed > allocation. However, in the future iomap_end() calls might be needed to > make sure we have balanced allocations, locks, etc. So, add calls to > iomap_end() with appropriate error handling to dax_iomap_fault(). Is there a way to just have a single call to iomap_end at the end of the function, after which we just return a previosuly setup return value? e.g. out: if (ops->iomap_end) { error = ops->iomap_end(inode, pos, PAGE_SIZE, PAGE_SIZE, flags, &iomap); } if (error == -ENOMEM) return VM_FAULT_OOM | major; if (error < 0 && error != -EBUSY) return VM_FAULT_SIGBUS | major; return ret; From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752986AbcJJPuZ (ORCPT ); Mon, 10 Oct 2016 11:50:25 -0400 Received: from verein.lst.de ([213.95.11.211]:59009 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752306AbcJJPuX (ORCPT ); Mon, 10 Oct 2016 11:50:23 -0400 Date: Mon, 10 Oct 2016 17:50:04 +0200 From: Christoph Hellwig To: Ross Zwisler Cc: linux-kernel@vger.kernel.org, "Theodore Ts'o" , Alexander Viro , Andreas Dilger , Andrew Morton , Christoph Hellwig , Dan Williams , Dave Chinner , Jan Kara , Matthew Wilcox , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nvdimm@ml01.01.org, linux-xfs@vger.kernel.org Subject: Re: [PATCH v5 13/17] dax: dax_iomap_fault() needs to call iomap_end() Message-ID: <20161010155004.GD19343@lst.de> References: <1475874544-24842-1-git-send-email-ross.zwisler@linux.intel.com> <1475874544-24842-14-git-send-email-ross.zwisler@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1475874544-24842-14-git-send-email-ross.zwisler@linux.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 On Fri, Oct 07, 2016 at 03:09:00PM -0600, Ross Zwisler wrote: > Currently iomap_end() doesn't do anything for DAX page faults for both ext2 > and XFS. ext2_iomap_end() just checks for a write underrun, and > xfs_file_iomap_end() checks to see if it needs to finish a delayed > allocation. However, in the future iomap_end() calls might be needed to > make sure we have balanced allocations, locks, etc. So, add calls to > iomap_end() with appropriate error handling to dax_iomap_fault(). Is there a way to just have a single call to iomap_end at the end of the function, after which we just return a previosuly setup return value? e.g. out: if (ops->iomap_end) { error = ops->iomap_end(inode, pos, PAGE_SIZE, PAGE_SIZE, flags, &iomap); } if (error == -ENOMEM) return VM_FAULT_OOM | major; if (error < 0 && error != -EBUSY) return VM_FAULT_SIGBUS | major; return ret;