> These calculations strike me as weird. Also, I think there's a bug. > nback should always be the -1 value, right? Oh, wait, it was like > that. Even stranger.
I think the nback = 8 nforw = 7 was a bug, to begin with, but this diff attempts to first reach a status quo, for 4KB page size platforms. Changing this to nback = 7 nforw = 8 (assuming this is indeed the right thing to do) would be a second step. > The following would be much more clear to me. The point is to fault in > a constant amount of data in bytes, no? Make that explicit. > > uvmadvice[NORMAL].nforw = 16384 / PAGESIZE; > uvmadvice[NORMAL].nback = 12288 / PAGESIZE; > uvmadvice[SEQ].nforw = 32768 / PAGESIZE; > uvmadvice[SEQ].nback = 28672 / PAGESIZE; > > That replicates the existing code, more or less. Except that 1. this is ugly unless you express the values in hex, as noone can spot these are multiples of 4096 in decimal, and 2. I think it is more important to make clear that nback == nforw - 1 (or + 1 in the SEQ case), regardless of the page size (unless page sizes are so huge both values are zero).