From: Andrew Morton <akpm@zip.com.au>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: lkml <linux-kernel@vger.kernel.org>
Subject: [patch 19/19] Reduce the radix tree nodes to 64 slots
Date: Sun, 16 Jun 2002 23:53:56 -0700 [thread overview]
Message-ID: <3D0D8784.F8DE33E4@zip.com.au> (raw)
Reduce the radix tree nodes from 128 slots to 64.
- The main reason for this is that on 64-bit/4k page machines, the
slab allocator has decided that radix tree nodes will require an
order-1 allocation. Shrinking the nodes to 64 slots pulls that back
to an order-0 allocation.
- On x86 we get fifteen 64-slot nodes per page rather than seven
129-slot nodes, for a modest memory saving.
- Halving the node size will approximately halve the memory use in
the worrisome really-large, really-sparse file case.
Of course, the downside is longer tree walks. Each level of the tree
covers six bits of pagecache index rather than seven. As ever, I am
guided by Anton's profiling on the 12- and 32-way PPC boxes.
radix_tree_lookup() is currently down in the noise floor.
Now, there is one special case: one file which is really big and which
is accessed in a random manner and which is accessed very heavily: the
blockdev mapping. We _are_ showing some locking cost in
__find_get_block (used to be __get_hash_table) and in its call to
find_get_page(). I have a bunch of patches which introduce a generic
per-cpu buffer LRU, and which remove ext2's private bitmap buffer LRUs.
I expect these patches to wipe the blockdev mapping lookup lock contention
off the map, but I'm awaiting test results from Anton before deciding
whether those patches are worth submitting.
--- 2.5.22/lib/radix-tree.c~ratshrink Sun Jun 16 23:12:54 2002
+++ 2.5.22-akpm/lib/radix-tree.c Sun Jun 16 23:12:54 2002
@@ -29,7 +29,7 @@
/*
* Radix tree node definition.
*/
-#define RADIX_TREE_MAP_SHIFT 7
+#define RADIX_TREE_MAP_SHIFT 6
#define RADIX_TREE_MAP_SIZE (1UL << RADIX_TREE_MAP_SHIFT)
#define RADIX_TREE_MAP_MASK (RADIX_TREE_MAP_SIZE-1)
-
reply other threads:[~2002-06-17 7:10 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=3D0D8784.F8DE33E4@zip.com.au \
--to=akpm@zip.com.au \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
/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