Frank Filz has uploaded this change for review.

View Change

MDCACHE: Replace chunk accounting with dirent accounting

Things may not go well if there are lots of dirents cached without
corresponding cached handles and attributes.

One solution would have been to change the default for chunks_hwmark to
entries_hwmark / avl_chunk, but that would be 750, which seems awfully
small if there are lots of small directories.

So instead of having two config params, we just count dirents and limit
them to entries_hwmark.

If we are trying to get a new chunk, we try and reserve avl_chunk number
of entries from dirents_used. If that goes over entries_hwmark, then we
keep reaping chunks until we are in limit. That may overreap if we are
in fact filling a small chunk, but that shouldn't be too much of an
issue.

When we add detached dirents, we try and reap a detached dirent from the
same directory first, and only if there are none do we reap a chunk to
free up dirents.

When adding dirents to chunks for FSALs that support that, and we aren't
goint to split the chunk and we go over, we again reap a chunk.

Change-Id: I94f4666a903f8246705745160b8186b6cc10c2d2
Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
---
M src/FSAL/Stackable_FSALs/FSAL_MDCACHE/mdcache_ext.h
M src/FSAL/Stackable_FSALs/FSAL_MDCACHE/mdcache_helpers.c
M src/FSAL/Stackable_FSALs/FSAL_MDCACHE/mdcache_lru.c
M src/FSAL/Stackable_FSALs/FSAL_MDCACHE/mdcache_lru.h
M src/FSAL/Stackable_FSALs/FSAL_MDCACHE/mdcache_read_conf.c
5 files changed, 149 insertions(+), 38 deletions(-)

git pull ssh://review.gerrithub.io:29418/ffilz/nfs-ganesha refs/changes/89/414889/1

To view, visit change 414889. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: ffilz/nfs-ganesha
Gerrit-Branch: next
Gerrit-MessageType: newchange
Gerrit-Change-Id: I94f4666a903f8246705745160b8186b6cc10c2d2
Gerrit-Change-Number: 414889
Gerrit-PatchSet: 1
Gerrit-Owner: Frank Filz <ffilzlnx@mindspring.com>