Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!usc!cs.utexas.edu!uwm.edu!bionet!agate!darkstar!ucsd.edu From: cjp%megatek.UUCP@ucsd.edu (Chris Pikus) Newsgroups: comp.os.research Subject: Cache theory question (UNIX) Message-ID: <1456@darkstar.ucsc.edu> Date: 24 Feb 90 02:59:38 GMT Sender: usenet@darkstar.ucsc.edu Organization: Megatek Corporation, San Diego, Ca. Lines: 29 Approved: comp-os-research@jupiter.ucsc.edu The Unix disk buffer cashe is organized as a combination of both a hash table and a linked list. that is there several linked lists and which one to use is determined by a hashing function. To wit, when one wishes to access/add a particular block in the buffer cache, the kernel performs a hashing function on BLKNO (usually a mod( 17) i beleive) and then walks down the that list to find said BLKNO. My question is thus: WHY mod 17??? I know the answer is fairly obvious, since 17 is a prime number, there would more likely to be an even distribution amongst the lists. If something like a filesystem started to have certain things regularly spaced, they might have a tendency to "resonate" adn fill up one list if one used a number like 16. To be more precise, is there any reason they picked 17, and if so, is there any supporting documentation/articles/mathematical_treatises? Could they have picked any prime (like 29, or 53, or 2011)? I know this is a pretty esoteric question but I was curious and I know there is a lot of UNIX historians on the net. Thank you very much, Christopher J. Pikus