From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ross Zwisler Subject: Re: [PATCH v3 3/7] mm: add find_get_entries_tag() Date: Thu, 10 Dec 2015 13:24:38 -0700 Message-ID: <20151210202438.GA6590@linux.intel.com> References: <1449602325-20572-1-git-send-email-ross.zwisler@linux.intel.com> <1449602325-20572-4-git-send-email-ross.zwisler@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Ross Zwisler , Linux Kernel Mailing List , Dave Hansen , Dave Chinner , "J. Bruce Fields" , linux-mm , Andreas Dilger , "H. Peter Anvin" , Jeff Layton , "linux-nvdimm@lists.01.org" , the arch/x86 maintainers , Ingo Molnar , ext4 hackers , xfs@oss.sgi.com, Alexander Viro , Thomas Gleixner , Theodore Ts'o , Jan Kara , linux-fsdevel , Andrew Morton , Matthew Wilcox To: Dan Williams Return-path: Content-Disposition: inline In-Reply-To: Sender: owner-linux-mm@kvack.org List-Id: linux-ext4.vger.kernel.org On Wed, Dec 09, 2015 at 11:44:16AM -0800, Dan Williams wrote: > On Tue, Dec 8, 2015 at 11:18 AM, Ross Zwisler > wrote: > > Add find_get_entries_tag() to the family of functions that include > > find_get_entries(), find_get_pages() and find_get_pages_tag(). This is > > needed for DAX dirty page handling because we need a list of both page > > offsets and radix tree entries ('indices' and 'entries' in this function) > > that are marked with the PAGECACHE_TAG_TOWRITE tag. > > > > Signed-off-by: Ross Zwisler <> > Why does this mostly duplicate find_get_entries()? > > Surely find_get_entries() can be implemented as a special case of > find_get_entries_tag(). I'm adding find_get_entries_tag() to the family of functions that already exist and include find_get_entries(), find_get_pages(), find_get_pages_contig() and find_get_pages_tag(). These functions all contain very similar code with small changes to the internal looping based on whether you're looking through all radix slots or only the ones that match a certain tag (radix_tree_for_each_slot() vs radix_tree_for_each_tagged()). We already have find_get_page() to get all pages in a range and find_get_pages_tag() to get all pages in the range with a certain tag. We have find_get_entries() to get all pages and indices for a given range, but we are currently missing find_get_entries_tag() to do that same search based on a tag, which is what I'm adding. I agree that we could probably figure out a way to combine the code for find_get_entries() with find_get_entries_tag(), as we could do for the existing functions find_get_pages() and find_get_pages_tag(). I think we should probably add find_get_entries_tag() per this patch, though, and then decide whether to do any combining later as a separate step. -- 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 relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id C52237F37 for ; Thu, 10 Dec 2015 14:24:59 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay1.corp.sgi.com (Postfix) with ESMTP id B36E88F8040 for ; Thu, 10 Dec 2015 12:24:56 -0800 (PST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by cuda.sgi.com with ESMTP id JafhtYyXFGgBDlQK for ; Thu, 10 Dec 2015 12:24:55 -0800 (PST) Date: Thu, 10 Dec 2015 13:24:38 -0700 From: Ross Zwisler Subject: Re: [PATCH v3 3/7] mm: add find_get_entries_tag() Message-ID: <20151210202438.GA6590@linux.intel.com> References: <1449602325-20572-1-git-send-email-ross.zwisler@linux.intel.com> <1449602325-20572-4-git-send-email-ross.zwisler@linux.intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: List-Id: XFS Filesystem from SGI List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: xfs-bounces@oss.sgi.com Sender: xfs-bounces@oss.sgi.com To: Dan Williams Cc: the arch/x86 maintainers , Thomas Gleixner , Andrew Morton , "linux-nvdimm@lists.01.org" , Dave Hansen , Linux Kernel Mailing List , xfs@oss.sgi.com, "J. Bruce Fields" , linux-mm , Ingo Molnar , Andreas Dilger , Alexander Viro , "H. Peter Anvin" , linux-fsdevel , Theodore Ts'o , Ross Zwisler , ext4 hackers , Jeff Layton , Jan Kara , Matthew Wilcox On Wed, Dec 09, 2015 at 11:44:16AM -0800, Dan Williams wrote: > On Tue, Dec 8, 2015 at 11:18 AM, Ross Zwisler > wrote: > > Add find_get_entries_tag() to the family of functions that include > > find_get_entries(), find_get_pages() and find_get_pages_tag(). This is > > needed for DAX dirty page handling because we need a list of both page > > offsets and radix tree entries ('indices' and 'entries' in this function) > > that are marked with the PAGECACHE_TAG_TOWRITE tag. > > > > Signed-off-by: Ross Zwisler <> > Why does this mostly duplicate find_get_entries()? > > Surely find_get_entries() can be implemented as a special case of > find_get_entries_tag(). I'm adding find_get_entries_tag() to the family of functions that already exist and include find_get_entries(), find_get_pages(), find_get_pages_contig() and find_get_pages_tag(). These functions all contain very similar code with small changes to the internal looping based on whether you're looking through all radix slots or only the ones that match a certain tag (radix_tree_for_each_slot() vs radix_tree_for_each_tagged()). We already have find_get_page() to get all pages in a range and find_get_pages_tag() to get all pages in the range with a certain tag. We have find_get_entries() to get all pages and indices for a given range, but we are currently missing find_get_entries_tag() to do that same search based on a tag, which is what I'm adding. I agree that we could probably figure out a way to combine the code for find_get_entries() with find_get_entries_tag(), as we could do for the existing functions find_get_pages() and find_get_pages_tag(). I think we should probably add find_get_entries_tag() per this patch, though, and then decide whether to do any combining later as a separate step. _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753916AbbLJUY6 (ORCPT ); Thu, 10 Dec 2015 15:24:58 -0500 Received: from mga02.intel.com ([134.134.136.20]:60609 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753412AbbLJUYz (ORCPT ); Thu, 10 Dec 2015 15:24:55 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,409,1444719600"; d="scan'208";a="616036324" Date: Thu, 10 Dec 2015 13:24:38 -0700 From: Ross Zwisler To: Dan Williams Cc: Ross Zwisler , Linux Kernel Mailing List , Dave Hansen , Dave Chinner , "J. Bruce Fields" , linux-mm , Andreas Dilger , "H. Peter Anvin" , Jeff Layton , "linux-nvdimm@lists.01.org" , the arch/x86 maintainers , Ingo Molnar , ext4 hackers , xfs@oss.sgi.com, Alexander Viro , Thomas Gleixner , "Theodore Ts'o" , Jan Kara , linux-fsdevel , Andrew Morton , Matthew Wilcox Subject: Re: [PATCH v3 3/7] mm: add find_get_entries_tag() Message-ID: <20151210202438.GA6590@linux.intel.com> Mail-Followup-To: Ross Zwisler , Dan Williams , Linux Kernel Mailing List , Dave Hansen , Dave Chinner , "J. Bruce Fields" , linux-mm , Andreas Dilger , "H. Peter Anvin" , Jeff Layton , "linux-nvdimm@lists.01.org" , the arch/x86 maintainers , Ingo Molnar , ext4 hackers , xfs@oss.sgi.com, Alexander Viro , Thomas Gleixner , Theodore Ts'o , Jan Kara , linux-fsdevel , Andrew Morton , Matthew Wilcox References: <1449602325-20572-1-git-send-email-ross.zwisler@linux.intel.com> <1449602325-20572-4-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: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 09, 2015 at 11:44:16AM -0800, Dan Williams wrote: > On Tue, Dec 8, 2015 at 11:18 AM, Ross Zwisler > wrote: > > Add find_get_entries_tag() to the family of functions that include > > find_get_entries(), find_get_pages() and find_get_pages_tag(). This is > > needed for DAX dirty page handling because we need a list of both page > > offsets and radix tree entries ('indices' and 'entries' in this function) > > that are marked with the PAGECACHE_TAG_TOWRITE tag. > > > > Signed-off-by: Ross Zwisler <> > Why does this mostly duplicate find_get_entries()? > > Surely find_get_entries() can be implemented as a special case of > find_get_entries_tag(). I'm adding find_get_entries_tag() to the family of functions that already exist and include find_get_entries(), find_get_pages(), find_get_pages_contig() and find_get_pages_tag(). These functions all contain very similar code with small changes to the internal looping based on whether you're looking through all radix slots or only the ones that match a certain tag (radix_tree_for_each_slot() vs radix_tree_for_each_tagged()). We already have find_get_page() to get all pages in a range and find_get_pages_tag() to get all pages in the range with a certain tag. We have find_get_entries() to get all pages and indices for a given range, but we are currently missing find_get_entries_tag() to do that same search based on a tag, which is what I'm adding. I agree that we could probably figure out a way to combine the code for find_get_entries() with find_get_entries_tag(), as we could do for the existing functions find_get_pages() and find_get_pages_tag(). I think we should probably add find_get_entries_tag() per this patch, though, and then decide whether to do any combining later as a separate step.