From: Wu Fengguang <wfg@mail.ustc.edu.cn>
To: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: linux-kernel@vger.kernel.org
Subject: Re: vm-kswapd-incmin.patch problem
Date: Wed, 23 Nov 2005 12:06:19 +0800 [thread overview]
Message-ID: <20051123040619.GA4386@mail.ustc.edu.cn> (raw)
In-Reply-To: <20051122074818.GA3801@mail.ustc.edu.cn>
Hi Nick,
On Tue, Nov 22, 2005 at 03:48:18PM +0800, Wu Fengguang wrote:
> Hi, your vm-kswapd-incmin.patch looks nice, and I'd like to base my age
> balancing patch upon it. But while trying it, I ran into a problem.
>
> $ cp bigfile /dev/null
> $ free -m
> total used free shared buffers cached
> Mem: 501 495 6 0 2 321
> -/+ buffers/cache: 171 330
> Swap: 127 2 125
> $ sleep 10
> $ free -m
> total used free shared buffers cached
> Mem: 501 244 257 0 4 66
> -/+ buffers/cache: 173 328
> Swap: 127 2 125
>
> In a short time, the bigfile was totally evicted from page cache?
>
> Before/after the huge free pages:
>
> $ cat /proc/sys/fs/dentry-state
> 3393 28 45 0 0 0
> $ cat /proc/sys/fs/dentry-state
> 3626 260 45 0 0 0
>
>
> linux-2.6.15-rc1-mm2 without the patch seems ok.
> Any suggestions? Thanks.
Maybe I found the answer to it :)
I listed the dentry-state in several other normal machines, they all have
more than 10k unused dentries:
54215 42155 45 0 0 0
91704 81376 45 0 0 0
96304 88832 45 0 0 0
30057 26999 45 0 0 0
Then I disabled the shrinker by:
echo 0 > /proc/sys/vm/vfs_cache_pressure
That increased the number from
3393 28 45 0 0 0
to
6247 2672 45 0 0 0
And there is no sudden huge increases of free pages any more.
Maybe your patch is shrinking the slabs much more, though I cannot confirm this
from the source code. But one thing I'm sure is that there should be a lower
bound for the unused dentries, either absolutely or relatively, something like
this:
--- linux-2.6.15-rc1-mm2.orig/fs/dcache.c
+++ linux-2.6.15-rc1-mm2/fs/dcache.c
@@ -860,7 +860,7 @@ static int shrink_dcache_memory(int nr,
return -1;
prune_dcache(nr);
}
- return (dentry_stat.nr_unused / 100) * sysctl_vfs_cache_pressure;
+ return (dentry_stat.nr_unused / 1000) * 10 * sysctl_vfs_cache_pressure;
}
/**
The original 100 is way too small. It should be much more than the SHRINK_BATCH(128).
Thanks,
Wu
next parent reply other threads:[~2005-11-23 4:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20051122074818.GA3801@mail.ustc.edu.cn>
2005-11-23 4:06 ` Wu Fengguang [this message]
2005-11-23 8:01 ` 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=20051123040619.GA4386@mail.ustc.edu.cn \
--to=wfg@mail.ustc.edu.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=nickpiggin@yahoo.com.au \
/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®