From: Andrew Morton <akpm@linux-foundation.org>
To: Mike Galbraith <efault@gmx.de>
Cc: Ingo Molnar <mingo@elte.hu>,
Frank Kingswood <frank@kingswood-consulting.co.uk>,
Andi Kleen <andi@firstfloor.org>,
Nick Piggin <nickpiggin@yahoo.com.au>,
Ray Lee <ray-lk@madrabbit.org>,
Jesper Juhl <jesper.juhl@gmail.com>, ck list <ck@vds.kolivas.org>,
Paul Jackson <pj@sgi.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: RFT: updatedb "morning after" problem [was: Re: -mm merge plans for 2.6.23]
Date: Fri, 27 Jul 2007 01:47:49 -0700 [thread overview]
Message-ID: <20070727014749.85370e77.akpm@linux-foundation.org> (raw)
In-Reply-To: <1185521021.6295.50.camel@Homer.simpson.net>
On Fri, 27 Jul 2007 09:23:41 +0200 Mike Galbraith <efault@gmx.de> wrote:
> On Fri, 2007-07-27 at 07:13 +0200, Mike Galbraith wrote:
> > On Thu, 2007-07-26 at 11:05 -0700, Andrew Morton wrote:
> > > > drops caches prior to both updatedb runs.
> > >
> > > I think that was the wrong thing to do. That will leave gobs of free
> > > memory for updatedb to populate with dentries and inodes.
> > >
> > > Instead, fill all of memory up with pagecache, then do the updatedb. See
> > > how much pagecache is left behind and see how large the vfs caches end up.
>
> I didn't _fill_ memory, but loaded it up a bit with some real workload
> data...
>
> I tried time sh -c 'git diff v2.6.11 HEAD > /dev/null' to populate the
> cache, and tried different values for vfs_cache_pressure. Nothing
> prevented git's data from being trashed by updatedb. Turning the knob
> downward rapidly became very unpleasant due to swap, (with 0 not
> surprisingly being a true horror) but turning it up didn't help git one
> bit. The amount of data that had to be re-read with stock 100 or 10000
> was the same, or at least so close that you couldn't see a difference in
> vmstat and wall-clock. Cache sizes varied, but the bottom line didn't.
> (wasn't surprised, seems quite reasonable that git's data looks old and
> useless to the reclaim logic when updatedb runs in between git runs)
>
Did a bit of playing with this with 128MB of memory.
- drop caches
- read a 1MB file
- run slocate.cron
With vfs_cache_pressure=100:
MemTotal: 116316 kB
MemFree: 3196 kB
Buffers: 54408 kB
Cached: 5128 kB
SwapCached: 0 kB
Active: 41728 kB
Inactive: 27540 kB
HighTotal: 0 kB
HighFree: 0 kB
LowTotal: 116316 kB
LowFree: 3196 kB
SwapTotal: 1020116 kB
SwapFree: 1019496 kB
Dirty: 0 kB
Writeback: 0 kB
AnonPages: 9760 kB
Mapped: 3808 kB
Slab: 40468 kB
SReclaimable: 34824 kB
SUnreclaim: 5644 kB
PageTables: 720 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
CommitLimit: 1078272 kB
Committed_AS: 25988 kB
VmallocTotal: 901112 kB
VmallocUsed: 656 kB
VmallocChunk: 900412 kB
HugePages_Total: 0
HugePages_Free: 0
HugePages_Rsvd: 0
Hugepagesize: 4096 kB
WIth vfs_cache_pressure=10000:
MemTotal: 116316 kB
MemFree: 3060 kB
Buffers: 80792 kB
Cached: 5052 kB
SwapCached: 0 kB
Active: 59432 kB
Inactive: 36140 kB
HighTotal: 0 kB
HighFree: 0 kB
LowTotal: 116316 kB
LowFree: 3060 kB
SwapTotal: 1020116 kB
SwapFree: 1019512 kB
Dirty: 0 kB
Writeback: 0 kB
AnonPages: 9756 kB
Mapped: 3832 kB
Slab: 14304 kB
SReclaimable: 7992 kB
SUnreclaim: 6312 kB
PageTables: 732 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
CommitLimit: 1078272 kB
Committed_AS: 26000 kB
VmallocTotal: 901112 kB
VmallocUsed: 656 kB
VmallocChunk: 900412 kB
HugePages_Total: 0
HugePages_Free: 0
HugePages_Rsvd: 0
Hugepagesize: 4096 kB
so we reaped quite a lot more slab with the higher vfs_cache_pressure.
What I think is killing us here is the blockdev pagecache: the pagecache
which backs those directory entries and inodes. These pages get read
multiple times because they hold multiple directory entries and multiple
inodes. These multiple touches will put those pages onto the active list
so they stick around for a long time and everything else gets evicted.
I've never been very sure about this policy for the metadata pagecache. We
read the filesystem objects into the dcache and icache and then we won't
read from that page again for a long time (I expect). But the page will
still hang around for a long time.
It could be that we should leave those pages inactive.
<tries it>
diff -puN include/linux/buffer_head.h~a include/linux/buffer_head.h
--- a/include/linux/buffer_head.h~a
+++ a/include/linux/buffer_head.h
@@ -130,7 +130,7 @@ BUFFER_FNS(Eopnotsupp, eopnotsupp)
BUFFER_FNS(Unwritten, unwritten)
#define bh_offset(bh) ((unsigned long)(bh)->b_data & ~PAGE_MASK)
-#define touch_buffer(bh) mark_page_accessed(bh->b_page)
+#define touch_buffer(bh) do { } while(0)
/* If we *know* page->private refers to buffer_heads */
#define page_buffers(page) \
_
vfs_cache_pressure=100:
vmm:/home/akpm# cat /proc/meminfo
MemTotal: 116524 kB
MemFree: 2692 kB
Buffers: 51044 kB
Cached: 5440 kB
SwapCached: 0 kB
Active: 19248 kB
Inactive: 46996 kB
HighTotal: 0 kB
HighFree: 0 kB
LowTotal: 116524 kB
LowFree: 2692 kB
SwapTotal: 1020116 kB
SwapFree: 1019492 kB
Dirty: 2008 kB
Writeback: 0 kB
AnonPages: 9772 kB
Mapped: 3812 kB
Slab: 44336 kB
SReclaimable: 38792 kB
SUnreclaim: 5544 kB
PageTables: 720 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
CommitLimit: 1078376 kB
Committed_AS: 26108 kB
VmallocTotal: 901112 kB
VmallocUsed: 648 kB
VmallocChunk: 900412 kB
HugePages_Total: 0
HugePages_Free: 0
HugePages_Rsvd: 0
Hugepagesize: 4096 kB
vfs_cache_pressure=10000
vmm:/home/akpm# cat /proc/meminfo
MemTotal: 116524 kB
MemFree: 3720 kB
Buffers: 79832 kB
Cached: 6260 kB
SwapCached: 0 kB
Active: 18276 kB
Inactive: 77584 kB
HighTotal: 0 kB
HighFree: 0 kB
LowTotal: 116524 kB
LowFree: 3720 kB
SwapTotal: 1020116 kB
SwapFree: 1019500 kB
Dirty: 2228 kB
Writeback: 0 kB
AnonPages: 9788 kB
Mapped: 3828 kB
Slab: 13680 kB
SReclaimable: 7676 kB
SUnreclaim: 6004 kB
PageTables: 736 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
CommitLimit: 1078376 kB
Committed_AS: 26112 kB
VmallocTotal: 901112 kB
VmallocUsed: 648 kB
VmallocChunk: 900412 kB
HugePages_Total: 0
HugePages_Free: 0
HugePages_Rsvd: 0
Hugepagesize: 4096 kB
So again, slab was trimmed a lot more, but all our pagecache still got
evicted.
ah, but I started that pagecache out on the inactive list. Try again.
This time, instead of reading a 1GB file once, let's read an 80MB file four
times.
<no difference>
OK, I saw what happened then. The inode for my 80MB file got reclaimed
from icache and that instantly reclaimed all 80MB of pagecache.
A single large file probably isn't a good testcase, but the same will
happen with multiple files. Higher vfs_cache_pressure will worsen this
effect. But it won't happen with mapped files because their inodes aren't
reclaimable. More sophisticated testing is needed - there's something in
ext3-tools which will mmap, page in and hold a file for you.
Anyway, blockdev pagecache is a problem, I expect. It's worth playing with
that patch.
Another problem is atime updates. You really do want to mount noatime.
Because with atimes enabled, each touch of a file will touch its inode and
will keep its backing blockdev pagecache page in core.
--
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-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2007-07-27 8:47 UTC|newest]
Thread overview: 227+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20070710013152.ef2cd200.akpm@linux-foundation.org>
2007-07-10 10:15 ` -mm merge plans for 2.6.23 Con Kolivas
2007-07-11 1:02 ` Matthew Hawkins
2007-07-11 1:14 ` [ck] " Andrew Morton
2007-07-11 1:52 ` André Goddard Rosa
2007-07-11 4:25 ` [ck] " André Goddard Rosa
2007-07-11 2:21 ` Ira Snyder
2007-07-11 3:37 ` timotheus
2007-07-11 2:54 ` Matthew Hawkins
2007-07-11 5:18 ` Nick Piggin
2007-07-11 5:47 ` Ray Lee
2007-07-11 5:54 ` Nick Piggin
2007-07-11 6:04 ` Ray Lee
2007-07-11 6:24 ` Nick Piggin
2007-07-11 7:50 ` swap prefetch (Re: -mm merge plans for 2.6.23) Ingo Molnar
2007-07-11 6:00 ` [ck] Re: -mm merge plans for 2.6.23 Nick Piggin
2007-07-11 3:59 ` Grzegorz Kulewski
2007-07-11 12:26 ` Kevin Winchester
2007-07-11 12:36 ` Jesper Juhl
2007-07-12 12:06 ` Kacper Wysocki
2007-07-12 12:35 ` Avuton Olrich
2007-07-22 23:11 ` Con Kolivas
2007-07-23 23:08 ` Jesper Juhl
2007-07-24 3:22 ` Nick Piggin
2007-07-24 4:53 ` Ray Lee
2007-07-24 5:10 ` Jeremy Fitzhardinge
2007-07-24 5:18 ` Ray Lee
2007-07-24 5:16 ` Nick Piggin
2007-07-24 16:11 ` -mm merge plans for 2.6.23 - Completely Fair Swap Prefetch Frank Kingswood
2007-07-25 0:59 ` [ck] " Matthew Hawkins
2007-07-24 16:15 ` -mm merge plans for 2.6.23 Ray Lee
2007-07-25 4:06 ` Nick Piggin
2007-07-25 4:55 ` Rene Herman
2007-07-25 5:00 ` Nick Piggin
2007-07-25 5:12 ` david
2007-07-25 5:30 ` Rene Herman
2007-07-25 5:51 ` david
2007-07-25 7:14 ` Valdis.Kletnieks
2007-07-25 8:18 ` Rene Herman
2007-07-25 8:28 ` Ingo Molnar
2007-07-25 8:43 ` Rene Herman
2007-07-25 10:53 ` [ck] " Jos Poortvliet
2007-07-25 11:06 ` Nick Piggin
2007-07-25 12:39 ` Jos Poortvliet
2007-07-25 13:30 ` Rene Herman
2007-07-25 13:50 ` Ingo Molnar
2007-07-25 17:33 ` Satyam Sharma
2007-07-25 20:35 ` Ingo Molnar
2007-07-26 2:32 ` Bartlomiej Zolnierkiewicz
2007-07-26 4:13 ` Jeff Garzik
2007-07-26 10:22 ` Bartlomiej Zolnierkiewicz
2007-07-25 11:34 ` Ingo Molnar
2007-07-25 11:40 ` Rene Herman
2007-07-25 11:50 ` Ingo Molnar
2007-07-25 16:08 ` Valdis.Kletnieks
2007-07-25 22:05 ` Paul Jackson
2007-07-25 22:22 ` Zan Lynx
2007-07-25 22:27 ` Jesper Juhl
2007-07-25 22:28 ` [ck] " Michael Chang
2007-07-25 23:45 ` André Goddard Rosa
2007-07-25 16:02 ` Ray Lee
2007-07-25 20:55 ` Zan Lynx
2007-07-25 21:28 ` Ray Lee
2007-07-26 1:15 ` [ck] " Matthew Hawkins
2007-07-26 1:32 ` Ray Lee
2007-07-26 3:16 ` Matthew Hawkins
2007-07-26 22:30 ` Michael Chang
2007-07-25 5:30 ` Eric St-Laurent
2007-07-25 5:37 ` Nick Piggin
2007-07-25 5:53 ` david
2007-07-25 6:04 ` Nick Piggin
2007-07-25 6:23 ` david
2007-07-25 7:25 ` Nick Piggin
2007-07-25 7:49 ` Ingo Molnar
2007-07-25 7:58 ` Nick Piggin
2007-07-25 8:15 ` Ingo Molnar
2007-07-25 10:41 ` Jesper Juhl
2007-07-25 6:19 ` [ck] " Matthew Hawkins
2007-07-25 6:30 ` Nick Piggin
2007-07-25 6:47 ` Mike Galbraith
2007-07-25 7:19 ` Eric St-Laurent
2007-07-25 6:44 ` Eric St-Laurent
2007-07-25 16:09 ` Ray Lee
2007-07-26 4:57 ` Andrew Morton
2007-07-26 5:53 ` Nick Piggin
2007-07-26 6:06 ` Andrew Morton
2007-07-26 6:17 ` Nick Piggin
2007-07-26 6:33 ` Ray Lee
2007-07-26 6:50 ` Andrew Morton
2007-07-26 7:43 ` Ray Lee
2007-07-26 7:59 ` Nick Piggin
2007-07-28 0:24 ` Matt Mackall
2007-07-26 14:19 ` [ck] " Michael Chang
2007-07-26 18:13 ` Andrew Morton
2007-07-26 22:04 ` Dirk Schoebel
2007-07-26 22:33 ` Dirk Schoebel
2007-07-26 23:27 ` Jeff Garzik
2007-07-26 23:29 ` david
2007-07-26 23:39 ` Jeff Garzik
2007-07-27 0:12 ` david
2007-07-28 0:12 ` Matt Mackall
2007-07-28 3:42 ` Daniel Cheng
2007-07-28 9:35 ` Stefan Richter
2007-07-25 17:55 ` Frank A. Kingswood
2007-07-25 6:09 ` [ck] " Matthew Hawkins
2007-07-25 6:18 ` Nick Piggin
2007-07-25 16:19 ` Ray Lee
2007-07-25 20:46 ` Andi Kleen
2007-07-26 8:38 ` Frank Kingswood
2007-07-26 9:20 ` Ingo Molnar
2007-07-26 9:34 ` Andrew Morton
2007-07-26 9:40 ` RFT: updatedb "morning after" problem [was: Re: -mm merge plans for 2.6.23] Ingo Molnar
2007-07-26 10:09 ` Andrew Morton
2007-07-26 10:24 ` Ingo Molnar
2007-07-27 0:33 ` [ck] " Matthew Hawkins
2007-07-30 9:33 ` Helge Hafting
2007-07-26 10:27 ` Ingo Molnar
2007-07-26 10:38 ` Andrew Morton
2007-07-26 12:46 ` Mike Galbraith
2007-07-26 18:05 ` Andrew Morton
2007-07-27 5:12 ` Mike Galbraith
2007-07-27 7:23 ` Mike Galbraith
2007-07-27 8:47 ` Andrew Morton [this message]
2007-07-27 8:54 ` Al Viro
2007-07-27 9:02 ` Andrew Morton
2007-07-27 9:40 ` Mike Galbraith
2007-07-27 10:00 ` Andrew Morton
2007-07-27 10:25 ` Mike Galbraith
2007-07-27 17:45 ` Daniel Hazelton
2007-07-27 18:16 ` Rene Herman
2007-07-27 19:43 ` david
2007-07-28 7:19 ` Rene Herman
2007-07-28 8:55 ` david
2007-07-28 10:11 ` Rene Herman
2007-07-28 11:21 ` Alan Cox
2007-07-28 16:29 ` Ray Lee
2007-07-28 21:03 ` david
2007-07-29 8:11 ` Rene Herman
2007-07-29 13:12 ` Alan Cox
2007-07-29 14:07 ` Rene Herman
2007-07-29 14:58 ` Ray Lee
2007-07-29 14:59 ` Rene Herman
2007-07-29 15:20 ` Ray Lee
2007-07-29 15:36 ` Rene Herman
2007-07-29 16:04 ` Ray Lee
2007-07-29 16:59 ` Rene Herman
2007-07-29 17:19 ` Ray Lee
2007-07-29 17:33 ` Rene Herman
2007-07-29 17:52 ` Ray Lee
2007-07-29 19:05 ` Rene Herman
2007-07-29 17:53 ` Alan Cox
2007-07-29 19:33 ` Paul Jackson
2007-07-29 20:00 ` Ray Lee
2007-07-29 20:18 ` Paul Jackson
2007-07-29 20:23 ` Ray Lee
2007-07-29 21:06 ` Daniel Hazelton
2007-07-28 21:00 ` david
2007-07-29 10:09 ` Rene Herman
2007-07-29 11:41 ` david
2007-07-29 14:01 ` Rene Herman
2007-07-29 21:19 ` david
2007-08-06 2:14 ` Nick Piggin
2007-08-06 2:22 ` david
2007-08-06 9:21 ` Nick Piggin
2007-08-06 9:55 ` Paolo Ciarrocchi
2007-07-28 15:56 ` Daniel Hazelton
2007-07-28 21:06 ` david
2007-07-28 21:48 ` Daniel Hazelton
2007-07-27 20:28 ` Daniel Hazelton
2007-07-28 5:19 ` Rene Herman
2007-07-27 23:15 ` Björn Steinbrink
2007-07-27 23:29 ` Andi Kleen
2007-07-28 0:08 ` Björn Steinbrink
2007-07-28 1:10 ` Daniel Hazelton
2007-07-29 12:53 ` Paul Jackson
2007-07-28 7:35 ` Rene Herman
2007-07-28 8:51 ` Rene Herman
2007-07-27 22:08 ` Mike Galbraith
2007-07-27 22:51 ` Daniel Hazelton
2007-07-28 7:48 ` Mike Galbraith
2007-07-28 15:36 ` Daniel Hazelton
2007-07-29 1:33 ` Rik van Riel
2007-07-29 3:39 ` Andrew Morton
2007-07-26 10:20 ` Al Viro
2007-07-26 12:23 ` Andi Kleen
2007-07-26 14:59 ` Al Viro
2007-07-11 20:41 ` Pavel Machek
2007-07-27 19:19 ` Paul Jackson
2007-07-26 13:05 ` Fredrik Klasson
2007-07-31 16:37 ` [ck] Re: -mm merge plans for 2.6.23 Matthew Hawkins
2007-08-06 2:11 ` Nick Piggin
2007-07-25 4:46 ` david
2007-07-25 8:00 ` Rene Herman
2007-07-25 8:07 ` david
2007-07-25 8:29 ` Rene Herman
2007-07-25 8:31 ` david
2007-07-25 8:33 ` david
2007-07-25 10:58 ` Rene Herman
2007-07-25 15:55 ` Ray Lee
2007-07-25 20:16 ` Al Boldi
2007-07-27 0:28 ` Magnus Naeslund
2007-07-24 5:18 ` Andrew Morton
2007-07-24 6:01 ` Ray Lee
2007-07-24 6:10 ` Andrew Morton
2007-07-24 9:38 ` Tilman Schmidt
2007-07-25 1:26 ` [ck] " Matthew Hawkins
2007-07-25 1:35 ` David Miller, Matthew Hawkins
2007-07-24 0:08 ` Con Kolivas
2007-07-11 11:39 ` buffered write patches, " Christoph Hellwig
2007-07-11 17:23 ` Andrew Morton
2007-07-11 12:23 ` lguest, " Christoph Hellwig
2007-07-11 15:45 ` Randy Dunlap
2007-07-11 18:04 ` Andrew Morton
2007-07-12 1:21 ` Rusty Russell
2007-07-12 2:28 ` David Miller, Rusty Russell
2007-07-12 2:48 ` Rusty Russell
2007-07-12 2:51 ` David Miller, Rusty Russell
2007-07-12 3:15 ` Rusty Russell
2007-07-12 3:35 ` David Miller, Rusty Russell
2007-07-12 4:24 ` Andrew Morton
2007-07-12 4:52 ` Rusty Russell
2007-07-12 11:10 ` Avi Kivity
2007-07-19 17:27 ` Christoph Hellwig
2007-07-20 3:27 ` Rusty Russell
2007-07-20 7:15 ` Christoph Hellwig
2007-07-12 0:54 ` fault vs invalidate race (Re: -mm merge plans for 2.6.23) Nick Piggin
2007-07-12 2:31 ` block_page_mkwrite? (Re: fault vs invalidate race (Re: -mm merge plans for 2.6.23)) David Chinner
2007-07-12 2:42 ` Nick Piggin
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=20070727014749.85370e77.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=andi@firstfloor.org \
--cc=ck@vds.kolivas.org \
--cc=efault@gmx.de \
--cc=frank@kingswood-consulting.co.uk \
--cc=jesper.juhl@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mingo@elte.hu \
--cc=nickpiggin@yahoo.com.au \
--cc=pj@sgi.com \
--cc=ray-lk@madrabbit.org \
/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