From: Andreas Dilger <adilger@turbolabs.com>
To: Josh MacDonald <jmacd@CS.Berkeley.EDU>
Cc: Alexander Viro <viro@math.psu.edu>,
Hans Reiser <reiser@namesys.com>,
Daniel Phillips <phillips@bonn-fries.net>,
Linus Torvalds <torvalds@transmeta.com>,
linux-kernel@vger.kernel.org, reiserfs-list@namesys.com,
reiserfs-dev@namesys.com
Subject: Re: [reiserfs-list] Re: [reiserfs-dev] Re: Note describing poor dcache utilization under high memory pressure
Date: Tue, 29 Jan 2002 11:44:15 -0700 [thread overview]
Message-ID: <20020129114415.S763@lynx.adilger.int> (raw)
In-Reply-To: <3C55E9E3.50207@namesys.com> <Pine.GSO.4.21.0201281927320.6592-100000@weyl.math.psu.edu> <20020129092858.D8740@helen.CS.Berkeley.EDU>
In-Reply-To: <20020129092858.D8740@helen.CS.Berkeley.EDU>; from jmacd@CS.Berkeley.EDU on Tue, Jan 29, 2002 at 09:28:58AM -0800
On Jan 29, 2002 09:28 -0800, Josh MacDonald wrote:
> Quoting Alexander Viro (viro@math.psu.edu):
> > On Tue, 29 Jan 2002, Hans Reiser wrote:
> > > This fails to recover an object (e.g. dcache entry) which is used once,
> > > and then spends a year in cache on the same page as an object which is
> > > hot all the time. This means that the hot set of objects becomes
> > > diffused over an order of magnitude more pages than if garbage
> > > collection squeezes them all together. That makes for very poor caching.
> >
> > Any GC that is going to move active dentries around is out of question.
> > It would need a locking of such strength that you would be the first
> > to cry bloody murder - about 5 seconds after you look at the scalability
> > benchmarks.
>
> We're not talking about actively referenced entries, we're talking about
> entries on the d_lru list with zero references. Relocating those objects
> should not require any more locking than currently required to remove and
> re-insert the dcache entry. Right?
But if it is unused and not recently referenced, there is little benefit
in keeping it around, is there? I suppose there might be some benefit in
moving hot negative dentries to be on the same page as other hot dentries,
and that should be possible. Negative dentries are a special case, though,
in that they are not actually in use, but their presence is a performance
improvement (i.e. not having to look up /usr/bin/ls, /usr/sbin/ls, etc).
Being able to move active entries between slabs is just too hard in
most cases, and the overhead (locking, back references, etc) in doing so
would probably outweigh the benefits of more tightly packed slab caches.
This could be up to the per-page (or per-slab) "try_to_free_page"
callback function to handle though.
I do agree with the assertion that you shouldn't judge the utility of
all objects on the page in which it lives by just the page use, otherwise
you will never free any other entries on a hot page. There should still
be per-item reference bits that give hints on which entries in the slab
should be freed.
For example we can use the following simple algorithm to free pages/entries:
1) Walk slab pages (maybe page LRU order), and if all entries in the page
can be freed, free them and then remove the page from the slab.
This gives the VM a free page to work with, and any entries that
are later reloaded will go to another page.
As a special case for dcache (which would be handled in the dcache
try_to_free_page callback) we could potentially move referenced
negative dentries to another free entry in that slab page in order to
free a page but not take the hit to go out to disk again to recreate
the negative dentry.
2) For slab pages with in-use entries, free some fraction of entries based
on whether the entries have been referenced. There is no point in
freeing all but one of the entries on a page if we can't free the page
in the end, and having a 10% cache page utilization does nobody any good.
Freeing some of the entries gives us free space to add new entries, but
does not discard too many entries when we can't free the pages anyways.
Cheers, Andreas
--
Andreas Dilger
http://sourceforge.net/projects/ext2resize/
http://www-mddsp.enel.ucalgary.ca/People/adilger/
next prev parent reply other threads:[~2002-01-29 18:46 UTC|newest]
Thread overview: 85+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-01-28 17:13 Josh MacDonald
2002-01-28 17:39 ` Linus Torvalds
2002-01-28 18:01 ` Rik van Riel
2002-01-28 18:21 ` Linus Torvalds
2002-01-28 18:37 ` Rik van Riel
2002-01-28 19:28 ` William Lee Irwin III
2002-01-28 20:01 ` Daniel Phillips
2002-01-28 21:33 ` Rick Stevens
2002-01-28 21:43 ` Rik van Riel
2002-01-28 22:00 ` Rick Stevens
2002-01-28 22:43 ` Daniel Phillips
2002-01-28 23:06 ` Rick Stevens
2002-01-28 23:51 ` [OT] " jepler
2002-01-29 2:30 ` IPmonger
2002-01-29 12:02 ` Karl & Betty Schendel
2002-01-28 22:26 ` Daniel Phillips
2002-01-28 22:34 ` Brian Gerst
2002-01-28 23:08 ` Daniel Phillips
2002-01-28 22:39 ` Daniel Phillips
2002-01-28 23:12 ` Rick Stevens
2002-01-28 23:27 ` Daniel Phillips
2002-01-28 22:01 ` Momchil Velikov
2002-01-28 22:19 ` Daniel Phillips
2002-01-29 1:29 ` Oliver Xymoron
2002-01-29 1:37 ` [reiserfs-list] " Valdis.Kletnieks
2002-01-29 1:45 ` Daniel Phillips
2002-01-29 8:39 ` Momchil Velikov
2002-01-29 8:55 ` Daniel Phillips
2002-01-29 9:20 ` William Lee Irwin III
2002-01-29 9:55 ` Daniel Phillips
2002-01-29 10:18 ` Momchil Velikov
2002-01-29 19:55 ` William Lee Irwin III
2002-01-29 20:08 ` Linus Torvalds
2002-01-29 20:39 ` William Lee Irwin III
2002-01-29 20:49 ` Linus Torvalds
2002-01-29 21:01 ` William Lee Irwin III
2002-01-29 9:20 ` Momchil Velikov
2002-01-29 10:27 ` Daniel Phillips
2002-01-29 11:54 ` Helge Hafting
2002-01-29 12:33 ` Daniel Phillips
2002-01-30 9:07 ` Horst von Brand
2002-01-30 10:55 ` Daniel Phillips
2002-01-30 14:46 ` Rik van Riel
2002-01-30 14:59 ` Daniel Phillips
2002-01-30 15:54 ` Rik van Riel
2002-01-30 16:34 ` Daniel Phillips
2002-01-29 10:59 ` Rik van Riel
2002-01-29 11:28 ` Daniel Phillips
2002-01-29 11:38 ` Rik van Riel
2002-01-29 12:01 ` Daniel Phillips
2002-01-29 16:57 ` Oliver Xymoron
2002-01-29 17:25 ` Rik van Riel
2002-01-29 20:48 ` Daniel Phillips
2002-01-29 21:00 ` Oliver Xymoron
2002-01-29 21:08 ` Linus Torvalds
2002-01-29 21:13 ` Oliver Xymoron
2002-01-29 21:50 ` Linus Torvalds
2002-01-29 22:02 ` Oliver Xymoron
2002-01-29 22:10 ` Linus Torvalds
2002-01-29 22:53 ` Daniel Phillips
2002-01-29 22:53 ` Daniel Phillips
2002-01-29 23:02 ` Oliver Xymoron
2002-01-29 23:21 ` Daniel Phillips
2002-01-28 19:25 ` [reiserfs-dev] " Hans Reiser
2002-01-28 23:52 ` Daniel Phillips
2002-01-29 0:16 ` Hans Reiser
2002-01-29 0:30 ` Alexander Viro
2002-01-29 10:46 ` Hans Reiser
2002-01-29 14:50 ` Chris Mason
2002-01-29 21:10 ` Hans Reiser
2002-01-30 7:11 ` Oliver Xymoron
2002-01-30 9:57 ` Hans Reiser
2002-01-29 17:28 ` Josh MacDonald
2002-01-29 18:44 ` Andreas Dilger [this message]
2002-01-29 19:55 ` [reiserfs-list] " Andrew Morton
2002-01-30 7:17 ` Oliver Xymoron
2002-01-30 7:32 ` [reiserfs-list] Re: [reiserfs-dev] Re: Note describing poordcache " Andrew Morton
2002-01-30 7:52 ` Oliver Xymoron
2002-01-30 10:03 ` Hans Reiser
2002-01-30 10:07 ` [reiserfs-dev] Re: Note describing poor dcache " Horst von Brand
2002-01-29 18:29 ` Horst von Brand
2002-01-29 0:51 ` Daniel Phillips
2002-01-29 1:32 ` Daniel Phillips
2002-01-28 22:46 ` Alex Bligh - linux-kernel
2002-01-29 17:27 ` Josh MacDonald
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=20020129114415.S763@lynx.adilger.int \
--to=adilger@turbolabs.com \
--cc=jmacd@CS.Berkeley.EDU \
--cc=linux-kernel@vger.kernel.org \
--cc=phillips@bonn-fries.net \
--cc=reiser@namesys.com \
--cc=reiserfs-dev@namesys.com \
--cc=reiserfs-list@namesys.com \
--cc=torvalds@transmeta.com \
--cc=viro@math.psu.edu \
/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
all inboxes | Powered by JetHome®