xfs
[Top] [All Lists]

Re: [PATCH v3 3/7] mm: add find_get_entries_tag()

To: Ross Zwisler <ross.zwisler@xxxxxxxxxxxxxxx>, Dan Williams <dan.j.williams@xxxxxxxxx>, Linux Kernel Mailing List <linux-kernel@xxxxxxxxxxxxxxx>, Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>, Dave Chinner <david@xxxxxxxxxxxxx>, "J. Bruce Fields" <bfields@xxxxxxxxxxxx>, linux-mm <linux-mm@xxxxxxxxx>, Andreas Dilger <adilger.kernel@xxxxxxxxx>, "H. Peter Anvin" <hpa@xxxxxxxxx>, Jeff Layton <jlayton@xxxxxxxxxxxxxxx>, "linux-nvdimm@xxxxxxxxxxxx" <linux-nvdimm@xxxxxxxxxxxx>, "the arch/x86 maintainers" <x86@xxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>, ext4 hackers <linux-ext4@xxxxxxxxxxxxxxx>, XFS Developers <xfs@xxxxxxxxxxx>, Alexander Viro <viro@xxxxxxxxxxxxxxxxxx>, Thomas Gleixner <tglx@xxxxxxxxxxxxx>, "Theodore Ts'o" <tytso@xxxxxxx>, Jan Kara <jack@xxxxxxxx>, linux-fsdevel <linux-fsdevel@xxxxxxxxxxxxxxx>, Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>, Matthew Wilcox <matthew.r.wilcox@xxxxxxxxx>
Subject: Re: [PATCH v3 3/7] mm: add find_get_entries_tag()
From: Dan Williams <dan.j.williams@xxxxxxxxx>
Date: Thu, 10 Dec 2015 12:31:53 -0800
Delivered-to: xfs@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=de//Xqw5slnn0odREjBY+oGB6/QrVdjV/ij+03ffmAU=; b=k8P2h3CJ+LjoOd2S2J+ZpgpMa0Gk+WWl/8EmwkADKEp4o3EmDnSxpeSsmSwGnmIaS9 UemEXClp4jJGKs1DIJmuNCDw4mPfSDSDOjtE8LRzWoHXjm0e2TghRXNE31nWHZ4zRIRD qTDIcxJN+lhV0R6YBj1elzuh9KsMhKPWHvtoVBdveCLQ/Nj8cuk/nKuvVARZRQ3oJbJp Lz7XrKZHPTjvjOxDTPn/VVgn+k+geZr0g7JIL3bRd+O+Jv3Rg56GNKCUz4+x7s9A7WVe f1jfrJLu8THNZcuM6Mq7xGGXFUFKw3fn7JpUIABtgXlNKb433m+O9qNBY/+HnkmZronk 2zuw==
In-reply-to: <20151210202438.GA6590@xxxxxxxxxxxxxxx>
References: <1449602325-20572-1-git-send-email-ross.zwisler@xxxxxxxxxxxxxxx> <1449602325-20572-4-git-send-email-ross.zwisler@xxxxxxxxxxxxxxx> <CAA9_cmeVYinm4mMiDU4oz8fW4HQ3n1RqEbPHBW7A3OGmi9eXtw@xxxxxxxxxxxxxx> <20151210202438.GA6590@xxxxxxxxxxxxxxx>
On Thu, Dec 10, 2015 at 12:24 PM, Ross Zwisler
<ross.zwisler@xxxxxxxxxxxxxxx> 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
>> <ross.zwisler@xxxxxxxxxxxxxxx> 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 <ross.zwisler@xxxxxxxxxxxxxxx>
> <>
>> 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.

<Prev in Thread] Current Thread [Next in Thread>