DragonFly commits List (threaded) for 2010-03
git: HAMMER VFS - frontload kmalloc()'s when rebalancing
Author: Matthew Dillon <firstname.lastname@example.org>
Date: Sat Mar 20 13:01:38 2010 -0700
HAMMER VFS - frontload kmalloc()'s when rebalancing
* The rebalancing code must allocate upwards of 16MB of memory to hold
copies of B-Tree nodes (~64*64*4K). This is enough to blow out the
emergency memory reserve used by the pageout daemon and deadlock the
system in low memory situations.
* Refactor the allocations. Allocate all the memory up-front so no
major allocations occur while nodes in the B-Tree are held locked.
* There are probably other cases where this may become a problem. With
UFS it wasn't an issue because flushing a file was fairly unsophisticated.
But with HAMMER certain aspects of the flush require B-Tree lookups and
can't be dumbed down to a simple raw disk write.
The rebalancing code was the most aggregious abuser of kernel memory
though and that should now be fixed.
Reported-by: Francois Tigeot <email@example.com>
Summary of changes:
sys/vfs/hammer/hammer.h | 12 +++-
sys/vfs/hammer/hammer_btree.c | 121 +++++++++++++++++++++++++++++++------
sys/vfs/hammer/hammer_rebalance.c | 15 +++--
sys/vfs/hammer/hammer_reblock.c | 4 +-
4 files changed, 124 insertions(+), 28 deletions(-)
DragonFly BSD source repository