Hugh Dickins wrote: > It's clearly superior to what David and I had, in branching > less (other than in your BUG_ONs), and I do believe your > "if (end - ceiling - 1 < P*_SIZE - 1)" is correct and efficient. > Well the BUG_ONs were more to just satisfy me that my assumptions were correct. Not to mention only contained in the top level, so they shouldn't hurt performance. But they could go. > But I still find it harder to understand than ours; and don't > understand at all your comment "end can't have approached ceiling > from above...." - but I think you're bravely trying to explain the case > I sidestepped with a lordly unexplained "end can't go down to 0 there". > Yes, say ceiling is 0 - something less than P*_SIZE, you might get the feeling that end may be able to come within our limit of it if it were a very small number. This can't happen because 0 is actually the top of address space, and end can't be *greater* than ceiling before any rounding. If it is not 0, then it must be at least 1, in which case it will always be rounded up to the next P*_SIZE boundary. So no problem. This may have been obvious to you from the start, in which case my extra rambling may have confused you... actually on re-reading it, it would have confused you no matter what. See if the next version is better. > Let others decide. > > One thing I believe is outright wrong, at least with out-of-tree > patches: your change from "if (addr > end - 1)" to "if (addr >= end)", > after you've just rounded up end (perhaps to 0). > Oh yes, good catch. I don't know why I did that :( > (And let me astonish you by asking for the blank lines back before > pmd_offset and pud_offset!) > Hugh? What have you done with Hugh?