Re: [PATCH] x86: mm: accurate the comments for STEP_SIZE_SHIFT macro

H. Peter Anvin
2013-03-18T19:14:59Z

On 03/18/2013 12:13 PM, Yinghai Lu wrote:
>>
>> No, it doesn't. This is C, not elementary school Now I'm really bothered.
>>
>> The comment doesn't say *why* (PUD_SHIFT-PMD_SHIFT)/2 or any other
>> variant is correct, furthermore I suspect that the +1 is misplaced.
>> However, what is really needed is:
>>
>> 1. Someone needs to explain what the logic should be and why, and
>> 2. replace the macro with a symbolic macro, not with a constant and a
>> comment explaining, incorrectly, how that value was derived.
>
> yes, we should find out free_mem_size instead to decide next step size.
>
> But that will come out page table size estimation problem again.
>

Sorry, that comment is double nonsense for someone who isn't intimately
familiar with the code, and it sounds like it is just plain wrong.

Instead, try to explain why 5 is the correct value in the current code
and how it is (or should be!) derived.

-hpa