linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* 2.5 page cache improvement idea
@ 2001-02-26 23:46 Ben LaHaise
  2001-02-27  0:41 ` Christoph Hellwig
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Ben LaHaise @ 2001-02-26 23:46 UTC (permalink / raw)
  To: linux-mm

Hey folks,

Here's an idea I just bounced off of Rik that seems like it would be
pretty useful.  Currently the page cache hash is system wide.  For 2.5,
I'm suggesting that we make the page cache hash a per-inode structure and
possibly move the page index and mapping into the structure's information.
Also, for dealing with hash collisions (which are going to happen under
certain well known circumstances), we could move to a b*tree structure
hanging off of the hashes.  So we'd have a data structure that looks like
the following:


inode
	-> hash table
		-> struct page, index, mapping
		-> head of b*tree for overflow

page
	-> pointer back to hash bucket/b*tree entry

These changes would replace ~20 bytes in struct page with one pointer.
Now, continuing along with making struct page smaller, we can blast away
the wait queue and replace it with either a tiny-waitqueue (4 bytes) or
make use of hashed wait queues (0 bytes per page).  That would save
another 8-12 bytes.  Now, add in a couple of additional space savers like
making the zone pointer an index, and eliminating the virtual pointer, and
we have a struct page that's less than 32 bytes (we could even leave the
index/mapping in that way).

Tiny waitqueues are an idea based on the fact that we never have more than
~65536 waiters in the system (typically much less -> ~# of tasks).  They
replace the whole spinlock/next/prev structure with a single long that
contains the index of the wait structure in a table in the high and low
words.  By making use of cmpxchg on x86, one doesn't need spinlocks to
update this structure.

These are just a couple of quick ideas that I'll try to implement at some
point...  Let me know of any thoughts on the matter.

		-ben

--
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.eu.org/Linux-MM/

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2001-02-27 13:42 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-02-26 23:46 2.5 page cache improvement idea Ben LaHaise
2001-02-27  0:41 ` Christoph Hellwig
2001-02-27  2:42 ` Chuck Lever
2001-02-27  2:49   ` Ben LaHaise
2001-02-27  3:26     ` Gerrit Huizenga
2001-02-27  5:47       ` Kanoj Sarcar
2001-02-27  9:05         ` Gerrit Huizenga
2001-02-27  9:21           ` Kanoj Sarcar
2001-02-27 13:42       ` Andrea Arcangeli
2001-02-27 11:52 ` Stephen C. Tweedie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox