From: Momchil Velikov <velco@fadata.bg>
To: <mingo@elte.hu>
Cc: <linux-kernel@vger.kernel.org>, "David S. Miller" <davem@redhat.com>
Subject: Re: [PATCH] Scalable page cache
Date: 26 Nov 2001 19:23:52 +0200 [thread overview]
Message-ID: <87vgfxqwd3.fsf@fadata.bg> (raw)
In-Reply-To: <Pine.LNX.4.33.0111261753480.10763-100000@localhost.localdomain>
In-Reply-To: <Pine.LNX.4.33.0111261753480.10763-100000@localhost.localdomain>
>>>>> "Ingo" == Ingo Molnar <mingo@elte.hu> writes:
Ingo> On 26 Nov 2001, Momchil Velikov wrote:
>> Hi,
>>
>> This patch:
>>
>> - replaces the global page cache hash table with a per mapping
>> splay tree;
>>
>> - eliminates the ``pagecache_lock'', instead ``i_shared_lock''
>> is used so serialize access during insertion/deletion
>> into/from the tree;
>>
>> The goals of the patch are to:
>>
>> - to improve scalability (via the elimination of the global
>> lock);
>>
>> - reduce the memory/cache footprint (via to the
>> ``page_hash_table'' elimination);
>>
>> The patch is against 2.4.16-pre1. Comments are welcome.
Ingo> are you aware of the following patch? (written by David Miller and me.)
Ingo> http://people.redhat.com/mingo/smp-pagecache-patches/pagecache-2.4.10-A3
Yep. Folks on #kernelnewbies told me about it, when there were only
changes to ``shrink_cache'' left. So, I decided to funish mine ;)
Ingo> it gets rid of the pagecache lock without introducing a tree.
Ingo> while reducing memory footprint is a goal we want to achieve, the
Ingo> pagecache hash is such a critical piece of data structure that we want
Ingo> O(1)-type search properties, not a tree. The pagetable hash takes up 0.2%
Ingo> of RAM currently. (but we could cut the size of the hash in half i think,
Ingo> it's a bit over-sized currently - it has as many entries.)
That's why I use splay tree and not red-black or AVL-balanced one - to
exploit the locality of reference, expecting to have O(1) on average.
Of course, I decided on tree because it is hard to choose the right
hash size.
Ingo> The problem with the tree is that if we have a big, eg. 16 GB pagecache,
Ingo> then even assuming a perfectly balanced tree, it takes more than 20
Ingo> iterations to find the page in the tree. (which also means 20 cachelines
Ingo> touched per tree node we pass.) Such an overhead (both algorithmic and
Ingo> cache-footprint overhead) is absolutely out of question - and it will only
Ingo> get worse with more RAM, which isnt a good property.
The tree is per mapping, not a single one. Now, with 16GB cached in a
single mapping, it'd perform poorly, indeed (though probably not 20).
Ingo> hashes on the other hand are simple and fast, and we can always balance
Ingo> performance against cache footprint and hash-table memory usage. This is
Ingo> one reason why we keept the pagetable hash in our patch.
Ingo> Ingo
next prev parent reply other threads:[~2001-11-26 17:27 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-11-26 12:31 [PATCH] Scalable page cache Momchil Velikov
2001-11-26 17:22 ` Ingo Molnar
2001-11-26 17:23 ` Momchil Velikov [this message]
2001-11-26 18:16 ` Benjamin LaHaise
2001-11-26 18:42 ` Rik van Riel
2001-11-26 20:29 ` Ingo Molnar
2001-11-26 18:33 ` David S. Miller
2001-11-26 19:29 ` Andrew Morton
2001-11-26 19:35 ` David S. Miller
2001-11-26 18:34 ` Benjamin LaHaise
2001-11-26 20:40 ` Ingo Molnar
2001-11-26 19:19 ` Benjamin LaHaise
2001-11-26 21:00 ` Ingo Molnar
2001-11-26 20:43 ` Daniel Phillips
2001-11-26 19:49 ` Ingo Molnar
2001-11-26 18:08 ` Christoph Hellwig
2001-11-26 20:13 ` Ingo Molnar
2001-11-26 21:09 ` Ingo Molnar
2001-11-26 19:18 ` David S. Miller
2001-11-26 19:45 ` Andrew Morton
2001-11-26 19:57 ` David S. Miller
2001-11-26 20:03 ` Andrew Morton
2001-11-26 20:37 ` Linus Torvalds
2001-11-26 21:02 ` Andrew Morton
2001-11-26 22:23 ` Linus Torvalds
2001-11-26 22:49 ` Jeff Garzik
2001-11-26 23:06 ` Linus Torvalds
2001-11-26 21:10 ` Ingo Molnar
2001-11-26 17:29 ` Linus Torvalds
2001-11-26 20:03 ` Ingo Molnar
2001-11-26 18:02 ` David S. Miller
2001-11-26 18:11 ` Rik van Riel
2001-11-27 8:07 ` benchmark results: " Anton Blanchard
2001-11-26 18:52 ` [PATCH] " Daniel Phillips
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=87vgfxqwd3.fsf@fadata.bg \
--to=velco@fadata.bg \
--cc=davem@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/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