From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qg0-f49.google.com (mail-qg0-f49.google.com [209.85.192.49]) by kanga.kvack.org (Postfix) with ESMTP id CF9DC6B0254 for ; Thu, 10 Dec 2015 15:32:56 -0500 (EST) Received: by qgeb1 with SMTP id b1so161968417qge.1 for ; Thu, 10 Dec 2015 12:32:56 -0800 (PST) Received: from mail-qg0-x22d.google.com (mail-qg0-x22d.google.com. [2607:f8b0:400d:c04::22d]) by mx.google.com with ESMTPS id b25si16502846qkb.118.2015.12.10.12.32.55 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 10 Dec 2015 12:32:55 -0800 (PST) Received: by qgcc31 with SMTP id c31so162371547qgc.3 for ; Thu, 10 Dec 2015 12:32:55 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <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> <20151210202438.GA6590@linux.intel.com> Date: Thu, 10 Dec 2015 12:31:53 -0800 Message-ID: Subject: Re: [PATCH v3 3/7] mm: add find_get_entries_tag() From: Dan Williams Content-Type: text/plain; charset=UTF-8 Sender: owner-linux-mm@kvack.org List-ID: 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 Developers , Alexander Viro , Thomas Gleixner , Theodore Ts'o , Jan Kara , linux-fsdevel , Andrew Morton , Matthew Wilcox On Thu, Dec 10, 2015 at 12:24 PM, Ross Zwisler wrote: > 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. Ok, sounds good to me. -- 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