So in working on my dirent cache chunking, I've hit one thing that needs
some work.

We can continue to cache LOOKUPs by caching those dirents, but leaving them
out of chunks. If a readdir overlaps, the dirent will be put into the
appropriate chunk. We should do something to manage the quantity, one option
is to have a single chunk that is operated as an LRU list instead of
directory order. If that chunk is full and a new LOOKUP comes in, the oldest
entry would be dropped. The chunk size for this could of course be a
different size.

CREATE is like LOOKUP except we KNOW the entry didn't exist in the directory
before.

UNLINK is simple, just remove the dirent from its chunk. The chunk now is a
small chunk, but that doesn't really break anything. It might be handy to
keep it in the chunk as a "deleted" item so if it's cookie is used, we don't
have to bypass the cache.

RENAME is tricky. A rename while a client READDIR is in progress can result
in a variety of situations:

The entry is completely skipped because the entry's new cookie and ordered
position is before the current position in the client's readdir scan, but
the old position was after.

The entry could be duplicated because the old position was before the scan
and the new position after.

There could be no excitement because both positions are either after or
before the current position.

A rename out of the directory of course is the same as an UNLINK.

A rename into the directory might or might not be before or after the
current position.

A complication arises when the new ordered position (and this goes for
LOOKUP also) would place the entry in the middle of a chunk already cached.
In this case, we COULD completely fail to list an entry that was part of a
rename.

We probably should invalidate the dirent cache for any mutation other than
an UNLINK (including RENAME out of the directory).

Thoughts?

Frank


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus


------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
Nfs-ganesha-devel mailing list
Nfs-ganesha-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs-ganesha-devel

Reply via email to