From: Dave Chinner <david@fromorbit.com>
To: Hugh Dickins <hughd@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Jan Kara <jack@suse.cz>, Mel Gorman <mgorman@suse.de>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH] radix_tree: expand comment on optimization
Date: Thu, 22 Dec 2011 11:17:07 +1100 [thread overview]
Message-ID: <20111222001707.GI23662@dastard> (raw)
In-Reply-To: <alpine.LSU.2.00.1112211555430.25868@eggly.anvils>
On Wed, Dec 21, 2011 at 03:57:16PM -0800, Hugh Dickins wrote:
> Expand comment on optimization in radix_tree_range_tag_if_tagged(),
> along the lines proposed by Dave Chinner.
>
> Signed-off-by: Hugh Dickins <hughd@google.com>
> ---
> And with -p2, this patch will also apply to the rtth tree.
>
> lib/radix-tree.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> --- mmotm/lib/radix-tree.c 2011-12-16 20:40:26.152758485 -0800
> +++ linux/lib/radix-tree.c 2011-12-21 14:57:20.073657540 -0800
> @@ -703,7 +703,13 @@ unsigned long radix_tree_range_tag_if_ta
> node = node->parent;
> }
>
> - /* optimization: no need to walk up from this node again */
> + /*
> + * Small optimization: now clear that node pointer.
> + * Since all of this slot's ancestors now have the tag set
> + * from setting it above, we have no further need to walk
> + * back up the tree setting tags, until we update slot to
> + * point to another radix_tree_node.
> + */
> node = NULL;
Looks good. I might remember why it was done now ;)
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2011-12-22 0:17 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-19 6:41 [PATCH] radix_tree: take radix_tree_path off stack Hugh Dickins
2011-12-19 8:20 ` nai.xia
2011-12-19 9:37 ` Nai Xia
2011-12-19 20:13 ` Hugh Dickins
2011-12-21 5:07 ` Dave Chinner
2011-12-21 6:53 ` Hugh Dickins
2011-12-21 22:15 ` Dave Chinner
2011-12-21 23:55 ` Hugh Dickins
2011-12-21 23:57 ` [PATCH] radix_tree: expand comment on optimization Hugh Dickins
2011-12-22 0:17 ` Dave Chinner [this message]
2011-12-22 3:15 ` [PATCH] radix_tree: delete orphaned macro radix_tree_indirect_to_ptr nai.xia
2011-12-22 3:29 ` Li Zefan
2011-12-22 3:36 ` Nai Xia
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20111222001707.GI23662@dastard \
--to=david@fromorbit.com \
--cc=akpm@linux-foundation.org \
--cc=hughd@google.com \
--cc=jack@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).