All of lore.kernel.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: Yinghai Lu <yinghai@kernel.org>
Cc: Lin Feng <linfeng@cn.fujitsu.com>,
	akpm@linux-foundation.org, linux-mm@kvack.org, x86@kernel.org,
	linux-kernel@vger.kernel.org, tglx@linutronix.de,
	mingo@redhat.com, penberg@kernel.org, jacob.shin@amd.com
Subject: Re: [PATCH] x86: mm: accurate the comments for STEP_SIZE_SHIFT macro
Date: Mon, 18 Mar 2013 12:14:45 -0700	[thread overview]
Message-ID: <514767A5.4020601@zytor.com> (raw)
In-Reply-To: <CAE9FiQUZDqqeAp2y=Pc9yFT81Pf+ei2SEx4NUD6jC+nQmd6PcA@mail.gmail.com>

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



--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

WARNING: multiple messages have this Message-ID (diff)
From: "H. Peter Anvin" <hpa@zytor.com>
To: Yinghai Lu <yinghai@kernel.org>
Cc: Lin Feng <linfeng@cn.fujitsu.com>,
	akpm@linux-foundation.org, linux-mm@kvack.org, x86@kernel.org,
	linux-kernel@vger.kernel.org, tglx@linutronix.de,
	mingo@redhat.com, penberg@kernel.org, jacob.shin@amd.com
Subject: Re: [PATCH] x86: mm: accurate the comments for STEP_SIZE_SHIFT macro
Date: Mon, 18 Mar 2013 12:14:45 -0700	[thread overview]
Message-ID: <514767A5.4020601@zytor.com> (raw)
In-Reply-To: <CAE9FiQUZDqqeAp2y=Pc9yFT81Pf+ei2SEx4NUD6jC+nQmd6PcA@mail.gmail.com>

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




  reply	other threads:[~2013-03-18 19:14 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-18 10:21 [PATCH] x86: mm: accurate the comments for STEP_SIZE_SHIFT macro Lin Feng
2013-03-18 10:21 ` Lin Feng
2013-03-18 18:53 ` Yinghai Lu
2013-03-18 18:53   ` Yinghai Lu
2013-03-18 18:59   ` H. Peter Anvin
2013-03-18 18:59     ` H. Peter Anvin
2013-03-18 19:13     ` Yinghai Lu
2013-03-18 19:13       ` Yinghai Lu
2013-03-18 19:14       ` H. Peter Anvin [this message]
2013-03-18 19:14         ` H. Peter Anvin
2013-03-18 21:19         ` Yinghai Lu
2013-03-18 22:50           ` H. Peter Anvin
2013-03-18 22:50             ` H. Peter Anvin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=514767A5.4020601@zytor.com \
    --to=hpa@zytor.com \
    --cc=akpm@linux-foundation.org \
    --cc=jacob.shin@amd.com \
    --cc=linfeng@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mingo@redhat.com \
    --cc=penberg@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    --cc=yinghai@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.