On Tue, 22 Feb 2011 07:31:12 -0600 Rob Landley <rlandley@xxxxxxxxxxxxx> wrote: > In net/sunrpc/cache.c line 416 or so (function cache_clean()) there's > this bit: > > else { > current_index = 0; > current_detail->nextcheck = seconds_since_boot()+30*60; > } > > The other uses of seconds_since_boot() add CACHE_NEW_EXPIRY (which is > 120). This is A) more than ten times that, B) a magic inline constant. > > Is there a reason for this? (Some subtle cache lifetime balancing thing?) Apples and oranges are both fruit, but don't taste the same... 'nextcheck' is when to next clean old data out of the cache. There is no rush to remove this data, it is just about freeing up memory. So every half hour is fine. Sometimes an immediate flush is called if there is a pressing need to remove stuff, but by default, occasional is enough. CACHE_NEW_EXPIRY is the expiry time for cache entries that are incomplete and have not yet been filled-in by a down-call. When user-space fills in a cache entry it gets an expiry time, typically half and hour I think, though that is up to user-space. If no down-call arrive for 120 seconds we forget about it. I don't recall the exact point of this - maybe it is to encourage a new up-call.. But I agree that the 30*60 should be a #defined constant. Patches welcome :-) NeilBrown -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html