mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH RESEND] Documentation: update kernel parameter limit notes
@ 2023-02-28 19:05 James Addison
  2023-03-05 23:17 ` Randy Dunlap
  0 siblings, 1 reply; 3+ messages in thread
From: James Addison @ 2023-02-28 19:05 UTC (permalink / raw)
  To: linux-doc, linux-kernel; +Cc: corbet, Randy Dunlap

There does appear to be a limit on the number of parameters accepted by the
kernel at boot-time, so this changeset updates the kernel-parameters.rst
documentation to reflect that.

Signed-off-by: James Addison <jay@jp-hosting.net>
---
 Documentation/admin-guide/kernel-parameters.rst | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Documentation/admin-guide/kernel-parameters.rst
b/Documentation/admin-guide/kernel-parameters.rst
index 19600c502..a3a099127 100644
--- a/Documentation/admin-guide/kernel-parameters.rst
+++ b/Documentation/admin-guide/kernel-parameters.rst
@@ -203,7 +203,8 @@ be entered as an environment variable, whereas its
absence indicates that
 it will appear as a kernel argument readable via /proc/cmdline by programs
 running once the system is up.

-The number of kernel parameters is not limited, but the length of the
+The number of kernel parameters is limited to 32 by default (128 in User Mode
+Linux), and is defined in ./init/main.c as MAX_INIT_ARGS. The length of the
 complete command line (parameters including spaces etc.) is limited to
 a fixed number of characters. This limit depends on the architecture
 and is between 256 and 4096 characters. It is defined in the file

base-commit: e492250d5252635b6c97d52eddf2792ec26f1ec1
-- 
2.39.2

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

* Re: [PATCH RESEND] Documentation: update kernel parameter limit notes
  2023-02-28 19:05 [PATCH RESEND] Documentation: update kernel parameter limit notes James Addison
@ 2023-03-05 23:17 ` Randy Dunlap
  2023-03-06 14:24   ` James Addison
  0 siblings, 1 reply; 3+ messages in thread
From: Randy Dunlap @ 2023-03-05 23:17 UTC (permalink / raw)
  To: James Addison, linux-doc, linux-kernel; +Cc: corbet

Hi James,

On 2/28/23 11:05, James Addison wrote:
> There does appear to be a limit on the number of parameters accepted by the
> kernel at boot-time, so this changeset updates the kernel-parameters.rst
> documentation to reflect that.

I looked at this again.  It's not a limit on the number of kernel command line
parameters AFAICT.  It's a limit on the number of parameters that are passed to
the init process.  Basically any parameter that is not recognized as a kernel
parameter OR anything that is after "--" on the kernel command line is put into
an array of limited size for passing to the init process.

> Signed-off-by: James Addison <jay@jp-hosting.net>
> ---
>  Documentation/admin-guide/kernel-parameters.rst | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/admin-guide/kernel-parameters.rst
> b/Documentation/admin-guide/kernel-parameters.rst
> index 19600c502..a3a099127 100644
> --- a/Documentation/admin-guide/kernel-parameters.rst
> +++ b/Documentation/admin-guide/kernel-parameters.rst
> @@ -203,7 +203,8 @@ be entered as an environment variable, whereas its
> absence indicates that
>  it will appear as a kernel argument readable via /proc/cmdline by programs
>  running once the system is up.
> 
> -The number of kernel parameters is not limited, but the length of the
> +The number of kernel parameters is limited to 32 by default (128 in User Mode
> +Linux), and is defined in ./init/main.c as MAX_INIT_ARGS. The length of the
>  complete command line (parameters including spaces etc.) is limited to
>  a fixed number of characters. This limit depends on the architecture
>  and is between 256 and 4096 characters. It is defined in the file
> 
> base-commit: e492250d5252635b6c97d52eddf2792ec26f1ec1

-- 
~Randy

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

* Re: [PATCH RESEND] Documentation: update kernel parameter limit notes
  2023-03-05 23:17 ` Randy Dunlap
@ 2023-03-06 14:24   ` James Addison
  0 siblings, 0 replies; 3+ messages in thread
From: James Addison @ 2023-03-06 14:24 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: linux-doc, linux-kernel, corbet

On Sun, 5 Mar 2023 at 23:17, Randy Dunlap <rdunlap@infradead.org> wrote:
> I looked at this again.  It's not a limit on the number of kernel command line
> parameters AFAICT.  It's a limit on the number of parameters that are passed to
> the init process.  Basically any parameter that is not recognized as a kernel
> parameter OR anything that is after "--" on the kernel command line is put into
> an array of limited size for passing to the init process.

Ah: that completely explains it, thank you; my testing was inadequete.

I had been testing this using fairly-arbitrary (and therefore unrecognized)
parameter names, so it is expected and correct that when the number of those
exceeds MAX_INIT_ARGS, the kernel does not boot.

For completeness I'll perform similar testing soon using known-parameter names.

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

end of thread, other threads:[~2023-03-06 14:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-28 19:05 [PATCH RESEND] Documentation: update kernel parameter limit notes James Addison
2023-03-05 23:17 ` Randy Dunlap
2023-03-06 14:24   ` James Addison

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

all inboxes | Powered by JetHome®