public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Make MAX_INIT_ARGS 25
@ 2004-08-05  2:32 Pete Zaitcev
  2004-08-05  5:52 ` Paweł Sikora
  2004-08-05 14:39 ` Olaf Hering
  0 siblings, 2 replies; 8+ messages in thread
From: Pete Zaitcev @ 2004-08-05  2:32 UTC (permalink / raw)
  To: linux-kernel; +Cc: zaitcev, spot, akpm

Hello, everyone:

We at Red Hat shipped a larger number of arguments for quite some time,
it was required for installations on IBM mainframe (s390), which doesn't
have a good way to pass arguments. I tried to submit it before, but only
half-heartedly, because I saw it as not benefitting folks at large, so
why bloat, right?

I really hate carrying divergent patches in Red Hat tree, even small
ones like this one, but there wasn't enough pull to integrate.
Recently I saw patches which try to make the MAX_INIT_ARGS and
MAX_INIT_ENVS configurable. Apparently, it's needed for someone else
besides mainframe now. This is an example (from Mike McLean):

> There are a number of reasonable situations that go past the current 
> limits of 8.  One that comes to mind is when you want to perform a 
> manual vnc install on a headless machine using anaconda.  This requires 
> passing in a number of parameters to get anaconda past the initial 
> (no-gui) loader screens.

I thought about it and decided that making this configurable is more
trouble than it's worth. We'd need a new entry, all to save a few words.
There would be a need to document it, and to ask users "are you sure you
configured your MAX_INIT_FOO to 20?" OTOH, if we just bump it, any
software can just look at version and magically know if the kernel
supports larger number of arguments, at the moment of kernel installation.
Say, if Linus takes it now, 2.6.8 and above would be "ok for jumpstart".

I'd like to ask (Andrew? Linus?) simply to bump the value somewhat,
without any complications. The value of 25 is specifically selected
to show that it's arbitrary. Mike wanted 32, but that just looked too
meaningful.

-- Pete

--- linux-2.6.7/init/main.c	2004-06-16 16:54:07.000000000 -0700
+++ linux-2.6.7-usb/init/main.c	2004-08-04 19:16:22.566593218 -0700
@@ -102,8 +102,8 @@
 /*
  * Boot command-line arguments
  */
-#define MAX_INIT_ARGS 8
-#define MAX_INIT_ENVS 8
+#define MAX_INIT_ARGS 25
+#define MAX_INIT_ENVS 25
 
 extern void time_init(void);
 /* Default late time init is NULL. archs can override this later. */

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

* Re: Make MAX_INIT_ARGS 25
  2004-08-05  2:32 Make MAX_INIT_ARGS 25 Pete Zaitcev
@ 2004-08-05  5:52 ` Paweł Sikora
  2004-08-05 15:21   ` Pete Zaitcev
  2004-08-05 14:39 ` Olaf Hering
  1 sibling, 1 reply; 8+ messages in thread
From: Paweł Sikora @ 2004-08-05  5:52 UTC (permalink / raw)
  To: Pete Zaitcev; +Cc: linux-kernel, spot, akpm

[-- Attachment #1: Type: text/plain, Size: 553 bytes --]

On Thursday 05 of August 2004 04:32, Pete Zaitcev wrote:

> --- linux-2.6.7/init/main.c	2004-06-16 16:54:07.000000000 -0700
> +++ linux-2.6.7-usb/init/main.c	2004-08-04 19:16:22.566593218 -0700
> @@ -102,8 +102,8 @@
>  /*
>   * Boot command-line arguments
>   */
> -#define MAX_INIT_ARGS 8
> -#define MAX_INIT_ENVS 8
> +#define MAX_INIT_ARGS 25
> +#define MAX_INIT_ENVS 25

You should also increase the COMMAND_LINE_SIZE.

-- 
/* Copyright (C) 2003, SCO, Inc. This is valuable Intellectual Property. */

                           #define say(x) lie(x)

[-- Attachment #2: kernel-MAX_INIT_ARGS.patch --]
[-- Type: text/x-diff, Size: 2485 bytes --]

--- linux-2.6.7-rc2/init/main.c.org	2004-06-04 12:58:31.000000000 +0200
+++ linux-2.6.7-rc2/init/main.c	2004-06-04 13:43:02.000000000 +0200
@@ -103,8 +103,8 @@
 /*
  * Boot command-line arguments
  */
-#define MAX_INIT_ARGS 8
-#define MAX_INIT_ENVS 8
+#define MAX_INIT_ARGS 256
+#define MAX_INIT_ENVS 256
 
 extern void time_init(void);
 /* Default late time init is NULL. archs can override this later. */
--- linux-2.6.7/include/asm-i386/param.h.orig	2004-07-03 16:56:41.000000000 +0200
+++ linux-2.6.7/include/asm-i386/param.h	2004-07-03 19:10:53.358244832 +0200
@@ -18,6 +18,6 @@
 #endif
 
 #define MAXHOSTNAMELEN	64	/* max length of hostname */
-#define COMMAND_LINE_SIZE 256
+#define COMMAND_LINE_SIZE 4096
 
 #endif
diff -Nur --exclude '*.orig' linux-2.6.7-rc3.org/include/asm-i386/setup.h linux-2.6.7-rc3/include/asm-i386/setup.h
--- linux-2.6.7-rc3.org/include/asm-i386/setup.h	2004-06-07 21:14:42.000000000 +0200
+++ linux-2.6.7-rc3/include/asm-i386/setup.h	2004-06-08 11:29:19.000000000 +0200
@@ -17,7 +17,7 @@
 #define MAX_NONPAE_PFN	(1 << 20)
 
 #define PARAM_SIZE 2048
-#define COMMAND_LINE_SIZE 256
+#define COMMAND_LINE_SIZE 4096
 
 #define OLD_CL_MAGIC_ADDR	0x90020
 #define OLD_CL_MAGIC		0xA33F
diff -Nur --exclude '*.orig' linux-2.6.7-rc3.org/include/asm-s390/setup.h linux-2.6.7-rc3/include/asm-s390/setup.h
--- linux-2.6.7-rc3.org/include/asm-s390/setup.h	2004-06-07 21:14:58.000000000 +0200
+++ linux-2.6.7-rc3/include/asm-s390/setup.h	2004-06-08 11:30:38.000000000 +0200
@@ -9,7 +9,7 @@
 #define _ASM_S390_SETUP_H
 
 #define PARMAREA		0x10400
-#define COMMAND_LINE_SIZE 	896
+#define COMMAND_LINE_SIZE 	4096
 #define RAMDISK_ORIGIN		0x800000
 #define RAMDISK_SIZE		0x800000
 
--- linux-2.6.7/include/asm-ppc/setup.h.orig	2004-07-06 17:53:17.000000000 +0200
+++ linux-2.6.7/include/asm-ppc/setup.h	2004-07-06 17:55:37.428864888 +0200
@@ -8,7 +8,7 @@
 #include <asm-m68k/setup.h>
 /* We have a bigger command line buffer. */
 #undef COMMAND_LINE_SIZE
-#define COMMAND_LINE_SIZE	512
+#define COMMAND_LINE_SIZE	4096
 
 #endif /* _PPC_SETUP_H */
 #endif /* __KERNEL__ */
--- linux-2.6.7/arch/ppc/syslib/prom.c.orig	2004-07-06 17:53:30.000000000 +0200
+++ linux-2.6.7/arch/ppc/syslib/prom.c	2004-07-06 17:55:57.781770776 +0200
@@ -85,7 +85,7 @@
 extern void enter_rtas(void *);
 void phys_call_rtas(int, int, int, ...);
 
-extern char cmd_line[512];	/* XXX */
+extern char cmd_line[COMMAND_LINE_SIZE];
 extern boot_infos_t *boot_infos;
 unsigned long dev_tree_size;
 

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

* Re: Make MAX_INIT_ARGS 25
  2004-08-05  2:32 Make MAX_INIT_ARGS 25 Pete Zaitcev
  2004-08-05  5:52 ` Paweł Sikora
@ 2004-08-05 14:39 ` Olaf Hering
  2004-08-05 16:08   ` Paul Jackson
  1 sibling, 1 reply; 8+ messages in thread
From: Olaf Hering @ 2004-08-05 14:39 UTC (permalink / raw)
  To: Pete Zaitcev; +Cc: linux-kernel, spot, akpm

 On Wed, Aug 04, Pete Zaitcev wrote:

> 
> --- linux-2.6.7/init/main.c	2004-06-16 16:54:07.000000000 -0700
> +++ linux-2.6.7-usb/init/main.c	2004-08-04 19:16:22.566593218 -0700
> @@ -102,8 +102,8 @@
>  /*
>   * Boot command-line arguments
>   */
> -#define MAX_INIT_ARGS 8
> -#define MAX_INIT_ENVS 8
> +#define MAX_INIT_ARGS 25
> +#define MAX_INIT_ENVS 25

Why is there a limit anyway? Can the whole thing be dynamic? Any why
panic if there are more than n options passed? Just ignore the remaining
options?

-- 
USB is for mice, FireWire is for men!

sUse lINUX ag, nÜRNBERG

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

* Re: Make MAX_INIT_ARGS 25
  2004-08-05  5:52 ` Paweł Sikora
@ 2004-08-05 15:21   ` Pete Zaitcev
  2004-08-05 16:13     ` Paul Jackson
  0 siblings, 1 reply; 8+ messages in thread
From: Pete Zaitcev @ 2004-08-05 15:21 UTC (permalink / raw)
  To: Pawe__ Sikora; +Cc: linux-kernel, spot, akpm

On Thu, 5 Aug 2004 07:52:46 +0200
Pawe__ Sikora <pluto@pld-linux.org> wrote:

> > -#define MAX_INIT_ARGS 8
> > -#define MAX_INIT_ENVS 8
> > +#define MAX_INIT_ARGS 25
> > +#define MAX_INIT_ENVS 25
> 
> You should also increase the COMMAND_LINE_SIZE.

I'm not doing it because I have nothing better to do, but because we
have a specific requirement. Our software works fine with the current
maximum buffer size. If you have different requirement, please let
me know what kind of situation it is in detail, it might help advocacy.

-- Pete

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

* Re: Make MAX_INIT_ARGS 25
  2004-08-05 14:39 ` Olaf Hering
@ 2004-08-05 16:08   ` Paul Jackson
  2004-08-05 16:12     ` Olaf Hering
  0 siblings, 1 reply; 8+ messages in thread
From: Paul Jackson @ 2004-08-05 16:08 UTC (permalink / raw)
  To: Olaf Hering; +Cc: zaitcev, linux-kernel, spot, akpm

> Can the whole thing be dynamic?

We're a little short of dynamic memory allocation mechanisms
this early in the boot, I'm afraid.

-- 
                          I won't rest till it's the best ...
                          Programmer, Linux Scalability
                          Paul Jackson <pj@sgi.com> 1.650.933.1373

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

* Re: Make MAX_INIT_ARGS 25
  2004-08-05 16:08   ` Paul Jackson
@ 2004-08-05 16:12     ` Olaf Hering
  2004-08-06 20:10       ` Pete Zaitcev
  0 siblings, 1 reply; 8+ messages in thread
From: Olaf Hering @ 2004-08-05 16:12 UTC (permalink / raw)
  To: Paul Jackson; +Cc: zaitcev, linux-kernel, spot, akpm

 On Thu, Aug 05, Paul Jackson wrote:

> > Can the whole thing be dynamic?
> 
> We're a little short of dynamic memory allocation mechanisms
> this early in the boot, I'm afraid.

Ok, I'm fine with 32, we have such a patch since ages.


-- 
USB is for mice, FireWire is for men!

sUse lINUX ag, nÜRNBERG

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

* Re: Make MAX_INIT_ARGS 25
  2004-08-05 15:21   ` Pete Zaitcev
@ 2004-08-05 16:13     ` Paul Jackson
  0 siblings, 0 replies; 8+ messages in thread
From: Paul Jackson @ 2004-08-05 16:13 UTC (permalink / raw)
  To: Pete Zaitcev; +Cc: pluto, linux-kernel, spot, akpm

> You should also increase the COMMAND_LINE_SIZE.

Unlike the generic settings in init/main.c of MAX_INIT_ARGS and
MAX_INIT_ENV, the setting of COMMAND_LINE_SIZE is arch-specific, and on
many arch's already set to an ample value such as 512, 896 or 1024.

If you have a specific arch for which this value is too small
for your needs, you probably need to take that up with the
maintainers of that arch code.

-- 
                          I won't rest till it's the best ...
                          Programmer, Linux Scalability
                          Paul Jackson <pj@sgi.com> 1.650.933.1373

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

* Re: Make MAX_INIT_ARGS 25
  2004-08-05 16:12     ` Olaf Hering
@ 2004-08-06 20:10       ` Pete Zaitcev
  0 siblings, 0 replies; 8+ messages in thread
From: Pete Zaitcev @ 2004-08-06 20:10 UTC (permalink / raw)
  To: Olaf Hering; +Cc: Paul Jackson, linux-kernel, spot, akpm, zaitcev

On Thu, 5 Aug 2004 18:12:36 +0200
Olaf Hering <olh@suse.de> wrote:

>  On Thu, Aug 05, Paul Jackson wrote:
> 
> > > Can the whole thing be dynamic?
> > 
> > We're a little short of dynamic memory allocation mechanisms
> > this early in the boot, I'm afraid.
> 
> Ok, I'm fine with 32, we have such a patch since ages.

I certainly don't mind 32, if SuSE software needs that. We shipped 25
for a while and everything worked on our side, so I wasn't aware.
In actuality, Mike McLean's patch did establish 32, but then it
looked like a knee-jerk power of 2 alignment, which we C hackers love
irrationally :-)

-- Pete

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

end of thread, other threads:[~2004-08-06 20:12 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-05  2:32 Make MAX_INIT_ARGS 25 Pete Zaitcev
2004-08-05  5:52 ` Paweł Sikora
2004-08-05 15:21   ` Pete Zaitcev
2004-08-05 16:13     ` Paul Jackson
2004-08-05 14:39 ` Olaf Hering
2004-08-05 16:08   ` Paul Jackson
2004-08-05 16:12     ` Olaf Hering
2004-08-06 20:10       ` Pete Zaitcev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox