lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Date:	Tue, 14 Apr 2009 17:54:45 +0200
From:	Christian Thaeter <ct@...apo.org>
To:	linux-kernel@...r.kernel.org
Subject: [BUG?] vfs_cache_pressure=0 does not free inode caches

Some time ago I found out that setting vfs_cache_pressure to 0 gives a
decent performance boost on my laptop (4200prm 1.8" disk). In most cases
metadata intensive/seeking applications (git, make, ..) wont even need
to spin up the disk (ls -R / takes 4 seconds from cache). Thats great
and I am using that since some time now. My first observation (looking
at 'top') was that caches get still freed when memory is demanded otherwise.

But now I hit the wall with really huge directory traversals on a
smaller server. Some testing revealed that the inode caches (tested with
ext4 and xfs) of the file system are not freed at all. The server is
going to die a slow death, all user space memory is swapped out, then
all processes are OOM killed until it dies from complete memory exhaustion.

Looking at the source (fs/inode.c):

static int shrink_icache_memory(int nr, gfp_t gfp_mask)
{
  ...
  return (inodes_stat.nr_unused / 100) * sysctl_vfs_cache_pressure;
}

makes me no wonder, I didn't investigated this further. Just trying with
 vfs_cache_pressure=1 gives the desired result and the inode caches are
freed on demand, case settled.

But still this has some bad taste, a cache is supposed to be a cache and
not a memory hog. The documentation doesn't cover this case. It is
argueable if this now can be considered as bug or as feature. I think
the formula for cache shrinking should be fixed to free memory even in
this extreme cases, others may argue that turning this cache off is a
feature, but then it should be documented at least.


	Christian

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ