linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Nick Piggin <nickpiggin@yahoo.com.au>
To: Matt Mackall <mpm@selenic.com>
Cc: Linux Kernel Mailing List <Linux-Kernel@Vger.Kernel.ORG>,
	Linux Memory Management <linux-mm@kvack.org>
Subject: Re: [rfc][patch] radix-tree: small data structure
Date: Mon, 24 Apr 2006 01:46:24 +1000	[thread overview]
Message-ID: <444BA150.7040907@yahoo.com.au> (raw)
In-Reply-To: <444BA0A9.3080901@yahoo.com.au>

[-- Attachment #1: Type: text/plain, Size: 373 bytes --]

Nick Piggin wrote:
> With the previous patch, the radix_tree_node budget on my 64-bit
> desktop is cut from 20MB to 10MB. This patch should cut it again
> by nearly a factor of 4 (haven't verified, but 98ish % of files
> are under 64K).
> 
> I wonder if this would be of any interest for those who enable
> CONFIG_BASE_SMALL?

Bah, wrong patch.

-- 
SUSE Labs, Novell Inc.

[-- Attachment #2: radix-small.patch --]
[-- Type: text/plain, Size: 651 bytes --]

This patch reduces radix tree node memory usage by about a factor of 4
on many small files (< 64K) scenarios, and results in perfect packing of
the index range into 32 and 64 bits. There are pointer traversal and
memory usage costs for large files with dense pagecache.

Index: linux-2.6/lib/radix-tree.c
===================================================================
--- linux-2.6.orig/lib/radix-tree.c
+++ linux-2.6/lib/radix-tree.c
@@ -33,7 +33,7 @@
 
 
 #ifdef __KERNEL__
-#define RADIX_TREE_MAP_SHIFT	6
+#define RADIX_TREE_MAP_SHIFT	(CONFIG_BASE_SMALL ? 4 : 6)
 #else
 #define RADIX_TREE_MAP_SHIFT	3	/* For more stressful testing */
 #endif

  reply	other threads:[~2006-04-23 15:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-23 15:43 [rfc][patch] radix-tree: small data structure Nick Piggin
2006-04-23 15:46 ` Nick Piggin [this message]
2006-04-23 21:12   ` Matt Mackall

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=444BA150.7040907@yahoo.com.au \
    --to=nickpiggin@yahoo.com.au \
    --cc=Linux-Kernel@Vger.Kernel.ORG \
    --cc=linux-mm@kvack.org \
    --cc=mpm@selenic.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;
as well as URLs for NNTP newsgroup(s).