linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [BUG] Description for memmap in kernel-parameters.txt is wrong
@ 2014-01-30 16:52 Andiry Xu
  2014-01-30 19:25 ` Randy Dunlap
  0 siblings, 1 reply; 8+ messages in thread
From: Andiry Xu @ 2014-01-30 16:52 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andiry Xu

Hi,

In kernel-parameters.txt, there is following description:

memmap=nn[KMG]$ss[KMG]
                        [KNL,ACPI] Mark specific memory as reserved.
                        Region of memory to be used, from ss to ss+nn.

Unfortunately this is incorrect. The meaning of nn and ss is reversed.
For example:

Command                  Expected                 Result
memmap 2G$6G        6G - 8G reserved      2G - 8G reserved
memmap 6G$2G        2G - 8G reserved      6G - 8G reserved

Test kernel version 3.13, but I believe the issue has been there long ago.

I'm not sure whether the description or implementation should be
fixed, but apparently they do not match.

Thanks,
Andiry

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [BUG] Description for memmap in kernel-parameters.txt is wrong
  2014-01-30 16:52 [BUG] Description for memmap in kernel-parameters.txt is wrong Andiry Xu
@ 2014-01-30 19:25 ` Randy Dunlap
  2014-01-30 19:33   ` Andiry Xu
  0 siblings, 1 reply; 8+ messages in thread
From: Randy Dunlap @ 2014-01-30 19:25 UTC (permalink / raw)
  To: Andiry Xu, linux-kernel; +Cc: Andiry Xu, Linux MM

[adding linux-mm mailing list]

On 01/30/2014 08:52 AM, Andiry Xu wrote:
> Hi,
> 
> In kernel-parameters.txt, there is following description:
> 
> memmap=nn[KMG]$ss[KMG]
>                         [KNL,ACPI] Mark specific memory as reserved.
>                         Region of memory to be used, from ss to ss+nn.

Should be:
                          Region of memory to be reserved, from ss to ss+nn.

but that doesn't help with the problem that you describe, does it?


> Unfortunately this is incorrect. The meaning of nn and ss is reversed.
> For example:
> 
> Command                  Expected                 Result
> memmap 2G$6G        6G - 8G reserved      2G - 8G reserved
> memmap 6G$2G        2G - 8G reserved      6G - 8G reserved

Are you testing on x86?
The code in arch/x86/kernel/e820.c always parses mem_size followed by start address.
I don't (yet) see where it goes wrong...


> Test kernel version 3.13, but I believe the issue has been there long ago.
> 
> I'm not sure whether the description or implementation should be
> fixed, but apparently they do not match.

I prefer to change the documentation and leave the implementation as is.


-- 
~Randy

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [BUG] Description for memmap in kernel-parameters.txt is wrong
  2014-01-30 19:25 ` Randy Dunlap
@ 2014-01-30 19:33   ` Andiry Xu
  2014-01-30 20:26     ` Randy Dunlap
  0 siblings, 1 reply; 8+ messages in thread
From: Andiry Xu @ 2014-01-30 19:33 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: linux-kernel, Andiry Xu, Linux MM

On Thu, Jan 30, 2014 at 11:25 AM, Randy Dunlap <rdunlap@infradead.org> wrote:
> [adding linux-mm mailing list]
>
> On 01/30/2014 08:52 AM, Andiry Xu wrote:
>> Hi,
>>
>> In kernel-parameters.txt, there is following description:
>>
>> memmap=nn[KMG]$ss[KMG]
>>                         [KNL,ACPI] Mark specific memory as reserved.
>>                         Region of memory to be used, from ss to ss+nn.
>
> Should be:
>                           Region of memory to be reserved, from ss to ss+nn.
>
> but that doesn't help with the problem that you describe, does it?
>

Actually it should be:
                             Region of memory to be reserved, from nn to nn+ss.

That is, exchange nn and ss.

>
>> Unfortunately this is incorrect. The meaning of nn and ss is reversed.
>> For example:
>>
>> Command                  Expected                 Result
>> memmap 2G$6G        6G - 8G reserved      2G - 8G reserved
>> memmap 6G$2G        2G - 8G reserved      6G - 8G reserved
>
> Are you testing on x86?
> The code in arch/x86/kernel/e820.c always parses mem_size followed by start address.
> I don't (yet) see where it goes wrong...
>

Yes, it's a x86 machine.

>
>> Test kernel version 3.13, but I believe the issue has been there long ago.
>>
>> I'm not sure whether the description or implementation should be
>> fixed, but apparently they do not match.
>
> I prefer to change the documentation and leave the implementation as is.
>

That's fine. memmap itself works OK, it's just the description is
wrong and people like me get confused.

Thanks,
Andiry

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [BUG] Description for memmap in kernel-parameters.txt is wrong
  2014-01-30 19:33   ` Andiry Xu
@ 2014-01-30 20:26     ` Randy Dunlap
  2014-01-30 22:17       ` David Rientjes
  0 siblings, 1 reply; 8+ messages in thread
From: Randy Dunlap @ 2014-01-30 20:26 UTC (permalink / raw)
  To: Andiry Xu; +Cc: linux-kernel, Andiry Xu, Linux MM

On 01/30/2014 11:33 AM, Andiry Xu wrote:
> On Thu, Jan 30, 2014 at 11:25 AM, Randy Dunlap <rdunlap@infradead.org> wrote:
>> [adding linux-mm mailing list]
>>
>> On 01/30/2014 08:52 AM, Andiry Xu wrote:
>>> Hi,
>>>
>>> In kernel-parameters.txt, there is following description:
>>>
>>> memmap=nn[KMG]$ss[KMG]
>>>                         [KNL,ACPI] Mark specific memory as reserved.
>>>                         Region of memory to be used, from ss to ss+nn.
>>
>> Should be:
>>                           Region of memory to be reserved, from ss to ss+nn.
>>
>> but that doesn't help with the problem that you describe, does it?
>>
> 
> Actually it should be:
>                              Region of memory to be reserved, from nn to nn+ss.
> 
> That is, exchange nn and ss.

Yes, I understand that that's what you are reporting.  I just haven't yet
worked out how the code manages to exchange those 2 values.

>>
>>> Unfortunately this is incorrect. The meaning of nn and ss is reversed.
>>> For example:
>>>
>>> Command                  Expected                 Result
>>> memmap 2G$6G        6G - 8G reserved      2G - 8G reserved
>>> memmap 6G$2G        2G - 8G reserved      6G - 8G reserved
>>
>> Are you testing on x86?
>> The code in arch/x86/kernel/e820.c always parses mem_size followed by start address.
>> I don't (yet) see where it goes wrong...
>>
> 
> Yes, it's a x86 machine.
> 
>>
>>> Test kernel version 3.13, but I believe the issue has been there long ago.
>>>
>>> I'm not sure whether the description or implementation should be
>>> fixed, but apparently they do not match.
>>
>> I prefer to change the documentation and leave the implementation as is.
>>
> 
> That's fine. memmap itself works OK, it's just the description is
> wrong and people like me get confused.
> 
> Thanks,
> Andiry


-- 
~Randy

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [BUG] Description for memmap in kernel-parameters.txt is wrong
  2014-01-30 20:26     ` Randy Dunlap
@ 2014-01-30 22:17       ` David Rientjes
  2014-01-30 22:54         ` Randy Dunlap
  0 siblings, 1 reply; 8+ messages in thread
From: David Rientjes @ 2014-01-30 22:17 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: Andiry Xu, linux-kernel, Andiry Xu, Linux MM

On Thu, 30 Jan 2014, Randy Dunlap wrote:

> >>> Hi,
> >>>
> >>> In kernel-parameters.txt, there is following description:
> >>>
> >>> memmap=nn[KMG]$ss[KMG]
> >>>                         [KNL,ACPI] Mark specific memory as reserved.
> >>>                         Region of memory to be used, from ss to ss+nn.
> >>
> >> Should be:
> >>                           Region of memory to be reserved, from ss to ss+nn.
> >>
> >> but that doesn't help with the problem that you describe, does it?
> >>
> > 
> > Actually it should be:
> >                              Region of memory to be reserved, from nn to nn+ss.
> > 
> > That is, exchange nn and ss.
> 
> Yes, I understand that that's what you are reporting.  I just haven't yet
> worked out how the code manages to exchange those 2 values.
> 

It doesn't, the documentation is correct as written and could be improved 
by your suggestion of "Region of memory to be reserved, from ss to ss+nn."  
I think Andiry probably is having a problem with his bootloader 
interpreting the '$' incorrectly (or variable expansion if coming from the 
shell) or interpreting the resulting user-defined e820 map incorrectly.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [BUG] Description for memmap in kernel-parameters.txt is wrong
  2014-01-30 22:17       ` David Rientjes
@ 2014-01-30 22:54         ` Randy Dunlap
  2014-01-30 23:43           ` Andiry Xu
  0 siblings, 1 reply; 8+ messages in thread
From: Randy Dunlap @ 2014-01-30 22:54 UTC (permalink / raw)
  To: David Rientjes; +Cc: Andiry Xu, linux-kernel, Andiry Xu, Linux MM

On 01/30/2014 02:17 PM, David Rientjes wrote:
> On Thu, 30 Jan 2014, Randy Dunlap wrote:
> 
>>>>> Hi,
>>>>>
>>>>> In kernel-parameters.txt, there is following description:
>>>>>
>>>>> memmap=nn[KMG]$ss[KMG]
>>>>>                         [KNL,ACPI] Mark specific memory as reserved.
>>>>>                         Region of memory to be used, from ss to ss+nn.
>>>>
>>>> Should be:
>>>>                           Region of memory to be reserved, from ss to ss+nn.
>>>>
>>>> but that doesn't help with the problem that you describe, does it?
>>>>
>>>
>>> Actually it should be:
>>>                              Region of memory to be reserved, from nn to nn+ss.
>>>
>>> That is, exchange nn and ss.
>>
>> Yes, I understand that that's what you are reporting.  I just haven't yet
>> worked out how the code manages to exchange those 2 values.
>>
> 
> It doesn't, the documentation is correct as written and could be improved 
> by your suggestion of "Region of memory to be reserved, from ss to ss+nn."  
> I think Andiry probably is having a problem with his bootloader 
> interpreting the '$' incorrectly (or variable expansion if coming from the 
> shell) or interpreting the resulting user-defined e820 map incorrectly.
> --

Yeah, I certainly don't see a problem with the code and I would want to
see/understand that before I exchanged the 2 values in the documentation.

I'll submit a patch to make the wording a bit better.

Thanks.

-- 
~Randy

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [BUG] Description for memmap in kernel-parameters.txt is wrong
  2014-01-30 22:54         ` Randy Dunlap
@ 2014-01-30 23:43           ` Andiry Xu
  2014-01-30 23:49             ` Randy Dunlap
  0 siblings, 1 reply; 8+ messages in thread
From: Andiry Xu @ 2014-01-30 23:43 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: David Rientjes, Andiry Xu, linux-kernel, Linux MM

On Thu, Jan 30, 2014 at 2:54 PM, Randy Dunlap <rdunlap@infradead.org> wrote:
> On 01/30/2014 02:17 PM, David Rientjes wrote:
>> On Thu, 30 Jan 2014, Randy Dunlap wrote:
>>
>>>>>> Hi,
>>>>>>
>>>>>> In kernel-parameters.txt, there is following description:
>>>>>>
>>>>>> memmap=nn[KMG]$ss[KMG]
>>>>>>                         [KNL,ACPI] Mark specific memory as reserved.
>>>>>>                         Region of memory to be used, from ss to ss+nn.
>>>>>
>>>>> Should be:
>>>>>                           Region of memory to be reserved, from ss to ss+nn.
>>>>>
>>>>> but that doesn't help with the problem that you describe, does it?
>>>>>
>>>>
>>>> Actually it should be:
>>>>                              Region of memory to be reserved, from nn to nn+ss.
>>>>
>>>> That is, exchange nn and ss.
>>>
>>> Yes, I understand that that's what you are reporting.  I just haven't yet
>>> worked out how the code manages to exchange those 2 values.
>>>
>>
>> It doesn't, the documentation is correct as written and could be improved
>> by your suggestion of "Region of memory to be reserved, from ss to ss+nn."
>> I think Andiry probably is having a problem with his bootloader
>> interpreting the '$' incorrectly (or variable expansion if coming from the
>> shell) or interpreting the resulting user-defined e820 map incorrectly.
>> --
>
> Yeah, I certainly don't see a problem with the code and I would want to
> see/understand that before I exchanged the 2 values in the documentation.
>
> I'll submit a patch to make the wording a bit better.
>

I'm using Ubuntu 13.04 with GRUB2. If it's a bootloader issue, what should I do?

Thanks,
Andiry

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [BUG] Description for memmap in kernel-parameters.txt is wrong
  2014-01-30 23:43           ` Andiry Xu
@ 2014-01-30 23:49             ` Randy Dunlap
  0 siblings, 0 replies; 8+ messages in thread
From: Randy Dunlap @ 2014-01-30 23:49 UTC (permalink / raw)
  To: Andiry Xu; +Cc: David Rientjes, Andiry Xu, linux-kernel, Linux MM

On 01/30/2014 03:43 PM, Andiry Xu wrote:
> On Thu, Jan 30, 2014 at 2:54 PM, Randy Dunlap <rdunlap@infradead.org> wrote:
>> On 01/30/2014 02:17 PM, David Rientjes wrote:
>>> On Thu, 30 Jan 2014, Randy Dunlap wrote:
>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> In kernel-parameters.txt, there is following description:
>>>>>>>
>>>>>>> memmap=nn[KMG]$ss[KMG]
>>>>>>>                         [KNL,ACPI] Mark specific memory as reserved.
>>>>>>>                         Region of memory to be used, from ss to ss+nn.
>>>>>>
>>>>>> Should be:
>>>>>>                           Region of memory to be reserved, from ss to ss+nn.
>>>>>>
>>>>>> but that doesn't help with the problem that you describe, does it?
>>>>>>
>>>>>
>>>>> Actually it should be:
>>>>>                              Region of memory to be reserved, from nn to nn+ss.
>>>>>
>>>>> That is, exchange nn and ss.
>>>>
>>>> Yes, I understand that that's what you are reporting.  I just haven't yet
>>>> worked out how the code manages to exchange those 2 values.
>>>>
>>>
>>> It doesn't, the documentation is correct as written and could be improved
>>> by your suggestion of "Region of memory to be reserved, from ss to ss+nn."
>>> I think Andiry probably is having a problem with his bootloader
>>> interpreting the '$' incorrectly (or variable expansion if coming from the
>>> shell) or interpreting the resulting user-defined e820 map incorrectly.
>>> --
>>
>> Yeah, I certainly don't see a problem with the code and I would want to
>> see/understand that before I exchanged the 2 values in the documentation.
>>
>> I'll submit a patch to make the wording a bit better.
>>
> 
> I'm using Ubuntu 13.04 with GRUB2. If it's a bootloader issue, what should I do?

See https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/448413

i.e., use shell escape '\' character.

-- 
~Randy

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-01-30 23:50 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-30 16:52 [BUG] Description for memmap in kernel-parameters.txt is wrong Andiry Xu
2014-01-30 19:25 ` Randy Dunlap
2014-01-30 19:33   ` Andiry Xu
2014-01-30 20:26     ` Randy Dunlap
2014-01-30 22:17       ` David Rientjes
2014-01-30 22:54         ` Randy Dunlap
2014-01-30 23:43           ` Andiry Xu
2014-01-30 23:49             ` Randy Dunlap

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).