Bug 145246 - [ufs] dirhash in 7.3 gratuitously frees hashes when it shouldn't [regression]
Summary: [ufs] dirhash in 7.3 gratuitously frees hashes when it shouldn't [regression]
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: Unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-31 18:40 UTC by Martin Birgmeier
Modified: 2017-12-31 22:35 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Birgmeier 2010-03-31 18:40:00 UTC
The new dirhash function ufsdirhash_lowmem() is called in low-memory
situations. I have a KDE repository mirror on a machine with 1.25 GiB of
memory, with 2 directories of each more than 10e6 entries.

Due to memory pressure, the hashes are now freed multiple times even
during a single subversion command, such that subversion exhibits extremely
long waiting times and is nearly unusable. This is also due to bug
http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/117954 , which is still
unsolved and leads to several tens of seconds of complete freezes of the
machine whenever the dirhash is (re-) computed.

Fix: 

Probably go back to the old dirhash behavior (7.2), or free dirhashes
only as last resort in low-mem situations. Note: I never had memory
problems in 7.2 with the old dirhash behavior, so clearly there was still
enough memory (to be gotten from somewhere else, probably).

Can I revert the dirhash changes by just reverting ufs_dirhash.c?
How-To-Repeat: Mirror the SVN repo (rsync://rsync.kde.org/svnmirror/) on a FreeBSD 7.3
machine with 1.25 GiB of memory. Note: This does not succeed any more
because the rsync server (on rsync.kde.org) times out before the local
dirhash can be created for the two directories in question.
Comment 1 Martin Birgmeier 2010-03-31 19:18:02 UTC
I reverted to SVN revision 195783, and it's working o.k. again (except 
for the old issue 
http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/117954, of course).
Comment 2 Mark Linimon freebsd_committer freebsd_triage 2010-04-01 02:19:41 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-fs

Over to maintainer(s).
Comment 3 John Baldwin freebsd_committer freebsd_triage 2010-04-01 13:56:03 UTC
I suspect the fix here is to provide a tunable/sysctl that can be used to 
disable the dirhash lowmem handler for workloads where it does more harm than 
good.

-- 
John Baldwin
Comment 4 Martin Birgmeier 2010-04-01 15:54:13 UTC
I believe that there should be some notion of "value" given to resources 
which may potentially be destroyed and recreated - computing the dirhash 
takes a lot of time (see 
http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/117954 ), and this work 
should not be thrown away lightly. (This is why dirhash exists in the 
first place.)

Maybe the lowmem handler could be modified to only use the dirhash 
lowmem handler as a last resort. In my case, the kernel did not really 
seem to be that short on memory, as it has now been running with 
moderate to high load for 24 hours with the reversion to SVN rev 195783 
for ufs_dirhash.c and dirhash.h.

I have configured vfs.ufs.dirhash_maxmem=33554432 (32M) by the way. 
Compared to 1.25G, this is only 2.5%, so I believe not really something 
that's eating lots of memory.

Regards,

Martin
Comment 5 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 07:59:11 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped