From: Hugh Dickins <hughd@google.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Dave Chinner <david@fromorbit.com>, Jan Kara <jack@suse.cz>,
Mel Gorman <mgorman@suse.de>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: [PATCH] radix_tree: expand comment on optimization
Date: Wed, 21 Dec 2011 15:57:16 -0800 (PST) [thread overview]
Message-ID: <alpine.LSU.2.00.1112211555430.25868@eggly.anvils> (raw)
In-Reply-To: <20111221221527.GE23662@dastard>
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;
next:
--
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-21 23:57 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 ` Hugh Dickins [this message]
2011-12-22 0:17 ` [PATCH] radix_tree: expand comment on optimization Dave Chinner
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=alpine.LSU.2.00.1112211555430.25868@eggly.anvils \
--to=hughd@google.com \
--cc=akpm@linux-foundation.org \
--cc=david@fromorbit.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