* 2.6.18-rc3-mm2 early_param mem= fix
@ 2006-08-06 17:22 Hugh Dickins
2006-08-06 17:31 ` Hugh Dickins
` (2 more replies)
0 siblings, 3 replies; 13+ messages in thread
From: Hugh Dickins @ 2006-08-06 17:22 UTC (permalink / raw)
To: Andrew Morton; +Cc: Rusty Russell, Andi Kleen, linux-kernel
I was impressed by how fast 2.6.18-rc3-mm2 is under memory pressure,
until I noticed that my "mem=512M" boot option was doing nothing. The
two fixes below got it working, but I wonder how many other early_param
"option=" args are wrong (e.g. "memmap=" in the same file): x86_64
shows many such, i386 shows only one, I've not followed it up further.
Hugh
--- 2.6.18-rc3-mm2/arch/x86_64/kernel/e820.c 2006-08-06 12:25:35.000000000 +0100
+++ linux/arch/x86_64/kernel/e820.c 2006-08-06 18:05:33.000000000 +0100
@@ -646,11 +646,11 @@ static int __init parse_memopt(char *p)
{
if (!p)
return -EINVAL;
- end_user_pfn = memparse(p, NULL);
+ end_user_pfn = memparse(p, &p);
end_user_pfn >>= PAGE_SHIFT;
return 0;
}
-early_param("mem=", parse_memopt);
+early_param("mem", parse_memopt);
static int userdef __initdata;
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: 2.6.18-rc3-mm2 early_param mem= fix 2006-08-06 17:22 2.6.18-rc3-mm2 early_param mem= fix Hugh Dickins @ 2006-08-06 17:31 ` Hugh Dickins 2006-08-07 15:08 ` Andy Whitcroft 2006-08-07 21:09 ` Eric W. Biederman 2006-08-06 19:15 ` Andrew Morton 2006-08-07 2:54 ` Rusty Russell 2 siblings, 2 replies; 13+ messages in thread From: Hugh Dickins @ 2006-08-06 17:31 UTC (permalink / raw) To: Andrew Morton; +Cc: Rusty Russell, Andi Kleen, linux-kernel On Sun, 6 Aug 2006, Hugh Dickins wrote: > I was impressed by how fast 2.6.18-rc3-mm2 is under memory pressure, > until I noticed that my "mem=512M" boot option was doing nothing. The > two fixes below got it working, but I wonder how many other early_param > "option=" args are wrong (e.g. "memmap=" in the same file): x86_64 > shows many such, i386 shows only one, I've not followed it up further. Oh, and that's not enough for it to show up in x86_64's /proc/cmdline. Hugh ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: 2.6.18-rc3-mm2 early_param mem= fix 2006-08-06 17:31 ` Hugh Dickins @ 2006-08-07 15:08 ` Andy Whitcroft 2006-08-07 21:09 ` Eric W. Biederman 1 sibling, 0 replies; 13+ messages in thread From: Andy Whitcroft @ 2006-08-07 15:08 UTC (permalink / raw) To: Hugh Dickins; +Cc: Andrew Morton, Rusty Russell, Andi Kleen, linux-kernel Hugh Dickins wrote: > On Sun, 6 Aug 2006, Hugh Dickins wrote: >> I was impressed by how fast 2.6.18-rc3-mm2 is under memory pressure, >> until I noticed that my "mem=512M" boot option was doing nothing. The >> two fixes below got it working, but I wonder how many other early_param >> "option=" args are wrong (e.g. "memmap=" in the same file): x86_64 >> shows many such, i386 shows only one, I've not followed it up further. > > Oh, and that's not enough for it to show up in x86_64's /proc/cmdline. Thats one I've been chasing and is caused by this same patch. We've lost the separation between command_line and saved_command_line and the user visible line gets trunc'd. Andi has a later version which has this part fixed as far as I can tell. I'm posting a dirty patch in response to my report of this to at least get past this bit as our test system relies on the commmand line being maintained to user space. -apw ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: 2.6.18-rc3-mm2 early_param mem= fix 2006-08-06 17:31 ` Hugh Dickins 2006-08-07 15:08 ` Andy Whitcroft @ 2006-08-07 21:09 ` Eric W. Biederman 2006-08-09 0:10 ` Keith Mannthey 1 sibling, 1 reply; 13+ messages in thread From: Eric W. Biederman @ 2006-08-07 21:09 UTC (permalink / raw) To: Hugh Dickins; +Cc: Andrew Morton, Rusty Russell, Andi Kleen, linux-kernel Hugh Dickins <hugh@veritas.com> writes: > On Sun, 6 Aug 2006, Hugh Dickins wrote: >> I was impressed by how fast 2.6.18-rc3-mm2 is under memory pressure, >> until I noticed that my "mem=512M" boot option was doing nothing. The >> two fixes below got it working, but I wonder how many other early_param >> "option=" args are wrong (e.g. "memmap=" in the same file): x86_64 >> shows many such, i386 shows only one, I've not followed it up further. > > Oh, and that's not enough for it to show up in x86_64's /proc/cmdline. The /proc/cmdline part is easy. Someone deleted the copy from saved_command_line to command_line. Since kernel/params.c:parse_args called in init/main.c is destructive if we don't do this we will never see a reasonable command line in /proc, and /init implementations that parse /proc/command_line will choke horribly. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> diff --git a/arch/x86_64/kernel/setup.c b/arch/x86_64/kernel/setup.c index 3bc1ff4..37206a4 100644 --- a/arch/x86_64/kernel/setup.c +++ b/arch/x86_64/kernel/setup.c @@ -378,7 +378,8 @@ #endif early_identify_cpu(&boot_cpu_data); parse_early_param(); - *cmdline_p = saved_command_line; + memcpy(command_line, saved_command_line, COMMAND_LINE_SIZE); + *cmdline_p = command_line; finish_e820_parsing(); ^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: 2.6.18-rc3-mm2 early_param mem= fix 2006-08-07 21:09 ` Eric W. Biederman @ 2006-08-09 0:10 ` Keith Mannthey 2006-08-09 1:03 ` Andi Kleen 2006-08-09 1:27 ` Rusty Russell 0 siblings, 2 replies; 13+ messages in thread From: Keith Mannthey @ 2006-08-09 0:10 UTC (permalink / raw) To: Eric W. Biederman Cc: Hugh Dickins, Andrew Morton, Rusty Russell, Andi Kleen, linux-kernel, apw On 8/7/06, Eric W. Biederman <ebiederm@xmission.com> wrote: > Hugh Dickins <hugh@veritas.com> writes: > > > On Sun, 6 Aug 2006, Hugh Dickins wrote: > >> I was impressed by how fast 2.6.18-rc3-mm2 is under memory pressure, > >> until I noticed that my "mem=512M" boot option was doing nothing. The > >> two fixes below got it working, but I wonder how many other early_param > >> "option=" args are wrong (e.g. "memmap=" in the same file): x86_64 > >> shows many such, i386 shows only one, I've not followed it up further. > > > > Oh, and that's not enough for it to show up in x86_64's /proc/cmdline. > > The /proc/cmdline part is easy. > > Someone deleted the copy from saved_command_line to command_line. > Since kernel/params.c:parse_args called in init/main.c is destructive > if we don't do this we will never see a reasonable command line in /proc, > and /init implementations that parse /proc/command_line will choke horribly. > > Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> > > diff --git a/arch/x86_64/kernel/setup.c b/arch/x86_64/kernel/setup.c > index 3bc1ff4..37206a4 100644 > --- a/arch/x86_64/kernel/setup.c > +++ b/arch/x86_64/kernel/setup.c > @@ -378,7 +378,8 @@ #endif > early_identify_cpu(&boot_cpu_data); > > parse_early_param(); > - *cmdline_p = saved_command_line; > + memcpy(command_line, saved_command_line, COMMAND_LINE_SIZE); > + *cmdline_p = command_line; > > finish_e820_parsing(); Ok this helped keep the cmdline around but the early_param is still busted with 2.6.18-rc3-mm2 (I don't have cmdline problem with non -mm 2.6.18-rc3). I am booting with numa=hotadd=100 on x86_64. The parameter hotadd_percent is not getting setup right. Printk tells me that numa_setup is not called during boot. if I change early_param("numa=", numa_setup); to early_param("numa", numa_setup); The parameter hotadd_percent is setup right but there is a "Malformed early option 'numa'" message. Is there some other patch that I missed to fix this? Also it seems like the earlyconsole isn't getting setup right.... It seems to take forever to start (say about 20-30 seconds) This pause in the boot is caused by the reserve hot-add patch but early console should start before the pause. command line is root=/dev/sda3 ip=9.47.66.153:9.47.66.169:9.47.66.1:255.255.255.0 resume=/dev/sda2 showopts earlyprintk=ttyS0,115200 console=ttyS0,115200 console=tty0 debug numa=hotadd=100 Again thing work as expected with 2.6.18-rc3. Thanks, Keith ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: 2.6.18-rc3-mm2 early_param mem= fix 2006-08-09 0:10 ` Keith Mannthey @ 2006-08-09 1:03 ` Andi Kleen 2006-08-09 1:27 ` Rusty Russell 1 sibling, 0 replies; 13+ messages in thread From: Andi Kleen @ 2006-08-09 1:03 UTC (permalink / raw) To: Keith Mannthey Cc: Eric W. Biederman, Hugh Dickins, Andrew Morton, Rusty Russell, linux-kernel, apw > > Again thing work as expected with 2.6.18-rc3. Everything I knew of is fixed in the latest version of the patch, just -mm* still has the old one. It's useless to report any more bugs against the -mm* version. -Andi ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: 2.6.18-rc3-mm2 early_param mem= fix 2006-08-09 0:10 ` Keith Mannthey 2006-08-09 1:03 ` Andi Kleen @ 2006-08-09 1:27 ` Rusty Russell 1 sibling, 0 replies; 13+ messages in thread From: Rusty Russell @ 2006-08-09 1:27 UTC (permalink / raw) To: Keith Mannthey Cc: Eric W. Biederman, Hugh Dickins, Andrew Morton, Andi Kleen, linux-kernel, apw On Tue, 2006-08-08 at 17:10 -0700, Keith Mannthey wrote: > The parameter hotadd_percent is setup right but there is a > "Malformed early option 'numa'" message. For the record: this happens when the function registered with early_param() returns non-zero. __setup() functions return 1 if OK, module_param() and early_param() return 0 or a -ve error code. Hope that clarifies, Rusty. -- Help! Save Australia from the worst of the DMCA: http://linux.org.au/law ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: 2.6.18-rc3-mm2 early_param mem= fix 2006-08-06 17:22 2.6.18-rc3-mm2 early_param mem= fix Hugh Dickins 2006-08-06 17:31 ` Hugh Dickins @ 2006-08-06 19:15 ` Andrew Morton 2006-08-07 2:06 ` Andi Kleen 2006-08-07 2:54 ` Rusty Russell 2 siblings, 1 reply; 13+ messages in thread From: Andrew Morton @ 2006-08-06 19:15 UTC (permalink / raw) To: Hugh Dickins; +Cc: rusty, ak, linux-kernel On Sun, 6 Aug 2006 18:22:04 +0100 (BST) Hugh Dickins <hugh@veritas.com> wrote: > I was impressed by how fast 2.6.18-rc3-mm2 is under memory pressure, > until I noticed that my "mem=512M" boot option was doing nothing. The > two fixes below got it working, but I wonder how many other early_param > "option=" args are wrong (e.g. "memmap=" in the same file): x86_64 > shows many such, i386 shows only one, I've not followed it up further. Thanks again. Andi, it sounds like so many fixes will be needed there that it's worth dropping, pending rev #2. ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: 2.6.18-rc3-mm2 early_param mem= fix 2006-08-06 19:15 ` Andrew Morton @ 2006-08-07 2:06 ` Andi Kleen 0 siblings, 0 replies; 13+ messages in thread From: Andi Kleen @ 2006-08-07 2:06 UTC (permalink / raw) To: Andrew Morton; +Cc: Hugh Dickins, rusty, linux-kernel On Sunday 06 August 2006 21:15, Andrew Morton wrote: > On Sun, 6 Aug 2006 18:22:04 +0100 (BST) > Hugh Dickins <hugh@veritas.com> wrote: > > > I was impressed by how fast 2.6.18-rc3-mm2 is under memory pressure, > > until I noticed that my "mem=512M" boot option was doing nothing. The > > two fixes below got it working, but I wonder how many other early_param > > "option=" args are wrong (e.g. "memmap=" in the same file): x86_64 > > shows many such, i386 shows only one, I've not followed it up further. > > Thanks again. > > Andi, it sounds like so many fixes will be needed there that it's worth > dropping, pending rev #2. Yes, it looks like it. Now I remember why I dropped this a long time ago already ;-) After fixing Hugh's issue with all parameters (there were some more with this) the kernel goes into an endless loop at boot when you have one which is a full prefix of another. -Andi ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: 2.6.18-rc3-mm2 early_param mem= fix 2006-08-06 17:22 2.6.18-rc3-mm2 early_param mem= fix Hugh Dickins 2006-08-06 17:31 ` Hugh Dickins 2006-08-06 19:15 ` Andrew Morton @ 2006-08-07 2:54 ` Rusty Russell 2006-08-07 2:55 ` Andi Kleen 2 siblings, 1 reply; 13+ messages in thread From: Rusty Russell @ 2006-08-07 2:54 UTC (permalink / raw) To: Hugh Dickins; +Cc: Andrew Morton, Andi Kleen, linux-kernel, Len Brown On Sun, 2006-08-06 at 18:22 +0100, Hugh Dickins wrote: > but I wonder how many other early_param > "option=" args are wrong (e.g. "memmap=" in the same file): x86_64 > shows many such, i386 shows only one, I've not followed it up further. Thanks Hugh. Andrew, here's that i386 fix: Subject: Fix acpi_sci early_param Unlike __setup which just does prefix matching, early_param does actual command-line parsing (as module_param), so no "=" is needed or desired. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> --- linux-2.6.18-rc3-mm2/arch/i386/kernel/acpi/boot.c.~1~ 2006-08-07 12:40:14.000000000 +1000 +++ linux-2.6.18-rc3-mm2/arch/i386/kernel/acpi/boot.c 2006-08-07 12:49:42.000000000 +1000 @@ -1292,4 +1292,4 @@ return -EINVAL; return 0; } -early_param("acpi_sci=", setup_acpi_sci); +early_param("acpi_sci", setup_acpi_sci); -- Help! Save Australia from the worst of the DMCA: http://linux.org.au/law ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: 2.6.18-rc3-mm2 early_param mem= fix 2006-08-07 2:54 ` Rusty Russell @ 2006-08-07 2:55 ` Andi Kleen 2006-08-07 3:08 ` Rusty Russell 0 siblings, 1 reply; 13+ messages in thread From: Andi Kleen @ 2006-08-07 2:55 UTC (permalink / raw) To: Rusty Russell; +Cc: Hugh Dickins, Andrew Morton, linux-kernel, Len Brown On Monday 07 August 2006 04:54, Rusty Russell wrote: > On Sun, 2006-08-06 at 18:22 +0100, Hugh Dickins wrote: > > but I wonder how many other early_param > > "option=" args are wrong (e.g. "memmap=" in the same file): x86_64 > > shows many such, i386 shows only one, I've not followed it up further. > > Thanks Hugh. > > Andrew, here's that i386 fix: I had already fixed that one and the x86-64 ones. But it still doesn't boot on x86-64 - gets into an endless loop at boot. I'm suspecting the code can't deal with duplicated prefixes. -Andi ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: 2.6.18-rc3-mm2 early_param mem= fix 2006-08-07 2:55 ` Andi Kleen @ 2006-08-07 3:08 ` Rusty Russell 2006-08-07 3:13 ` Andi Kleen 0 siblings, 1 reply; 13+ messages in thread From: Rusty Russell @ 2006-08-07 3:08 UTC (permalink / raw) To: Andi Kleen; +Cc: Hugh Dickins, Andrew Morton, linux-kernel, Len Brown On Mon, 2006-08-07 at 04:55 +0200, Andi Kleen wrote: > On Monday 07 August 2006 04:54, Rusty Russell wrote: > > On Sun, 2006-08-06 at 18:22 +0100, Hugh Dickins wrote: > > > but I wonder how many other early_param > > > "option=" args are wrong (e.g. "memmap=" in the same file): x86_64 > > > shows many such, i386 shows only one, I've not followed it up further. > > > > Thanks Hugh. > > > > Andrew, here's that i386 fix: > > I had already fixed that one and the x86-64 ones. > > But it still doesn't boot on x86-64 - gets into an endless loop > at boot. I'm suspecting the code can't deal with duplicated > prefixes. Works fine here: early_param("param", early_param1); early_param("param2", early_param2); I'm building an x86_64 kernel, and hoping it runs under qemu. If so, I'll find the problem... Thanks, Rusty. -- Help! Save Australia from the worst of the DMCA: http://linux.org.au/law ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: 2.6.18-rc3-mm2 early_param mem= fix 2006-08-07 3:08 ` Rusty Russell @ 2006-08-07 3:13 ` Andi Kleen 0 siblings, 0 replies; 13+ messages in thread From: Andi Kleen @ 2006-08-07 3:13 UTC (permalink / raw) To: Rusty Russell; +Cc: Hugh Dickins, Andrew Morton, linux-kernel, Len Brown On Monday 07 August 2006 05:08, Rusty Russell wrote: > On Mon, 2006-08-07 at 04:55 +0200, Andi Kleen wrote: > > On Monday 07 August 2006 04:54, Rusty Russell wrote: > > > On Sun, 2006-08-06 at 18:22 +0100, Hugh Dickins wrote: > > > > but I wonder how many other early_param > > > > "option=" args are wrong (e.g. "memmap=" in the same file): x86_64 > > > > shows many such, i386 shows only one, I've not followed it up further. > > > > > > Thanks Hugh. > > > > > > Andrew, here's that i386 fix: > > > > I had already fixed that one and the x86-64 ones. > > > > But it still doesn't boot on x86-64 - gets into an endless loop > > at boot. I'm suspecting the code can't deal with duplicated > > prefixes. > > Works fine here: 32bit works for me too, but x86-64 does. Strangely it seems to somehow reenter head64 copy_boot_data. Perhaps stack gets smashed somehow? It goes into an endless loop of: Bootdata ok (command line is ip=dhcp nfsroot=10.23.204.1:/home/nfsroot/gaston root=/dev/nfs debug vga=0x0f07 rw pci=noacpi earlyprintk=serial,ttyS0,115200 console=ttyS0,115200 earlyprintk=serial,ttyS0,115200 console=tty0 BOOT_IMAGE=bzImage ) Bootdata ok (command line is ip=dhcp nfsroot=10.23.204.1:/home/nfsroot/gaston root=/dev/nfs debug vga=0x0f07 rw pci=noacpi earlyprintk=serial,ttyS0,115200 console=ttyS0,115200 earlyprintk=serial,ttyS0,115200 console=tty0 BOOT_IMAGE=bzImage ) Bootdata ok (command line is ip=dhcp nfsroot=10.23.204.1:/home/nfsroot/gaston root=/dev/nfs debug vga=0x0f07 rw pci=noacpi earlyprintk=serial,ttyS0,115200 console=ttyS0,115200 earlyprintk=serial,ttyS0,115200 console=tty0 BOOT_IMAGE=bzImage ) etc. That is with all =s removed in early_params (i got that wrong in a lot of cases -- the only option I tested was apic which didn't have it) -Andi > ^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2006-08-09 1:27 UTC | newest] Thread overview: 13+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2006-08-06 17:22 2.6.18-rc3-mm2 early_param mem= fix Hugh Dickins 2006-08-06 17:31 ` Hugh Dickins 2006-08-07 15:08 ` Andy Whitcroft 2006-08-07 21:09 ` Eric W. Biederman 2006-08-09 0:10 ` Keith Mannthey 2006-08-09 1:03 ` Andi Kleen 2006-08-09 1:27 ` Rusty Russell 2006-08-06 19:15 ` Andrew Morton 2006-08-07 2:06 ` Andi Kleen 2006-08-07 2:54 ` Rusty Russell 2006-08-07 2:55 ` Andi Kleen 2006-08-07 3:08 ` Rusty Russell 2006-08-07 3:13 ` Andi Kleen
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox