[OpenAFS] cache performance
Phil.Moore@morganstanley.com
Phil.Moore@morganstanley.com
Fri, 25 Oct 2002 11:30:33 -0400
>>>>> "Nathan" == Neulinger, Nathan <nneul@umr.edu> writes:
Nathan> At one point, I was considering trying to merge the cache
Nathan> debugging tools with fs, to add a root-only "fs dumpcache"
Nathan> command.
Nathan> Not sure if this would be an ideal way to go about it.
OK, some more research and thoughts on this topic...
Looking at the cmdebug code, and in particular, the AFSDBCacheEntry
structure that is basically just pretty-prints (although, personally,
I would not call that output "pretty"), I don't see that the cache
manager maintains the last access data, or anything like it.
However, I wonder if the cbExpires (obviously the callback expiration)
couldn't be used to similar effect? If I have data in my cache that
hasn't been accessed in a while, one would assume that the callback
expiration should be pretty old, right?
Tactically, I should be able to use this to determine roughly when a
volume was most recently accessed, based on the assumption that
accessing the volume will refresh the callback. Fair enough?
The only issue I see is that cmdebug currently only prints the first
10000 cache entries, and I want them all:
for(i=0;i<10000;i++) {
code = RXAFSCB_GetCE(aconn, i, ¢ry);
if (code) {
if (code == 1) break;
printf("cmdebug: failed to get cache entry %d (%s)\n", i,
error_message(code));
return code;
}
Damn, I hate hardcoded limits like that... Isn't there a more elegant
way to determine when we've hit the end of the list of cache entries?
Loking at the RXAFSCB_GetCE, it seems to me that this will return 1
when there's nothing to get, so is there any good reason not to have
the cmdebug code loop until that condition is reached? That is:
while (1) {
code = RXAFSCB_GetCE(aconn, i, ¢ry);
if (code) {
if (code == 1) break;
Seems to me a reasonable replacement for the missing access times may
be readily available, if not entirely equiavalent.