Strange dcache memory pressure when highmem enabled

From: Neil Brown
Date: Tue Oct 14 2003 - 23:34:28 EST




Greetings all.

I have a fairly busy NFS server which has been having performance
problems lately. I have managed to work around the problems, but
would really like to get the root problem fixed.

The symptom is sluggish performance.
A more useful symptom is that the number of entries in dentry_cache
(as reported by /proc/slabinfo) is hanging around 1000, whereas on
other fileservers it is typically more like 200,000. (I can
understand how this would correlate directly with the perceived
sluggishness)

The key difference between the problematic fileserver and the happy
fileservers seems to be that the problematic one has HIGHMEM. It has
4Gig or RAM where as the others have 512M or 1G.
When I boot the problematic server with mem=900M the symptom goes
away (there are plenty of entries in the dentry_cache).

I noticed this in 2.4.18, and confirmed that it still happens with
2.4.22.

So my question is:
Why does 3Gig of highmem impose excessive memory pressure on
dentry_cache (and inode_cache I think).


I tried having a look and found "shrink_caches" in mm/vmscan.c, and
"try_to_free_pages_zone" which calls it.
I noticed that shrink_caches calls shrink_dcache_memory independant
of the classzone that is being shrunk. So if we are trying to
shrink ZONE_HIGHMEM, the dentry_cache is shrunk, even though the
dentry_cache doesn't live in highmem. However I'm not sure if I have
understood the classzones well enough for that observation even to
make sense.

Help appreciated.

NeilBrown


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/