linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: Wanted: a limit on kernel log buffer size
@ 2003-04-07  8:55 Chuck Ebbert
  0 siblings, 0 replies; 10+ messages in thread
From: Chuck Ebbert @ 2003-04-07  8:55 UTC (permalink / raw)
  To: Randy.Dunlap, linux-kernel

Randy Dunlap:


>+#if (CONFIG_LOG_BUF_SHIFT > 20)
>+#error CONFIG_LOG_BUF_SHIFT is ridiculously large (more than 1 MB).
>+#endif


That ought to do it.  Anyone who needs more than that can just change
the source.


--
 Chuck
 I am not an octal number!

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

* Re: Wanted: a limit on kernel log buffer size
@ 2003-04-07 21:12 Chuck Ebbert
  0 siblings, 0 replies; 10+ messages in thread
From: Chuck Ebbert @ 2003-04-07 21:12 UTC (permalink / raw)
  To: linux-kernel

Randy Dunlap wrote:

>> Just how far does boot get?  What messages are printed before death?


I don't have it exactly, but it's along the lines of:

   Decompressing.... OK, now booting the kernel

i.e., none.


--
 Chuck
 I am not an octal number!

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

* Re: Wanted: a limit on kernel log buffer size
  2003-04-07  8:55 Chuck Ebbert
@ 2003-04-07 16:24 ` Randy.Dunlap
  0 siblings, 0 replies; 10+ messages in thread
From: Randy.Dunlap @ 2003-04-07 16:24 UTC (permalink / raw)
  To: Chuck Ebbert; +Cc: rml, linux-kernel

On Mon, 7 Apr 2003 04:55:27 -0400 Chuck Ebbert <76306.1226@compuserve.com> wrote:

| Robert Love
| 
| > I say if users cannot bother to read the documentation
| >and understanding things, why are they compiling a kernel?
| 
| 
|  True, but then they'll come bleating to l-k when all they get is
| a blank, black screen on boot.  (At least _I_ figured out what
| went wrong first...)

Good that you figured it out.

Just how far does boot get?  What messages are printed before death?

--
~Randy

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

* Re: Wanted: a limit on kernel log buffer size
  2003-04-07  2:49 ` Randy.Dunlap
  2003-04-07  3:35   ` Randy.Dunlap
@ 2003-04-07 12:19   ` Roman Zippel
  1 sibling, 0 replies; 10+ messages in thread
From: Roman Zippel @ 2003-04-07 12:19 UTC (permalink / raw)
  To: Randy.Dunlap; +Cc: 76306.1226, linux-kernel

Hi,

On Sun, 6 Apr 2003, Randy.Dunlap wrote:

> This is a multi-part answer.  Say, 5 parts.
> 
> a.  If someone won't read the help text, how can we help them?
> 
> b.  If we make a 2 GB log buffer size a compile-time error, will
> they read that?
> 
> c.  If we make it a compile-time warning, will they read that?
> 
> d.  What limit(s) do you suggest?  I can try to add some limits.
> 
> e.  This kind of config limiting should be done in the config system IMO.
> I've asked Roman for that capability....

While I don't mind adding limits, checking it at compile time certainly 
won't hurt.
Even better would be a more dynamic solution, which can release unused 
print buffer after booting.

bye, Roman


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

* Re: Wanted: a limit on kernel log buffer size
@ 2003-04-07  8:55 Chuck Ebbert
  2003-04-07 16:24 ` Randy.Dunlap
  0 siblings, 1 reply; 10+ messages in thread
From: Chuck Ebbert @ 2003-04-07  8:55 UTC (permalink / raw)
  To: Robert Love, linux-kernel

Robert Love

> I say if users cannot bother to read the documentation
>and understanding things, why are they compiling a kernel?


 True, but then they'll come bleating to l-k when all they get is
a blank, black screen on boot.  (At least _I_ figured out what
went wrong first...)

--
 Chuck
 I am not a number!

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

* Re: Wanted: a limit on kernel log buffer size
  2003-04-07  3:39     ` Robert Love
@ 2003-04-07  4:32       ` Randy.Dunlap
  0 siblings, 0 replies; 10+ messages in thread
From: Randy.Dunlap @ 2003-04-07  4:32 UTC (permalink / raw)
  To: rml; +Cc: rddunlap, 76306.1226, linux-kernel

> On Sun, 2003-04-06 at 23:35, Randy.Dunlap wrote:
>
>> > a.  If someone won't read the help text, how can we help them?
>> >
>> > b.  If we make a 2 GB log buffer size a compile-time error, will they
>> read that?
>> >
>> > c.  If we make it a compile-time warning, will they read that?
>> >
>> > d.  What limit(s) do you suggest?  I can try to add some limits.
>> >
>> > e.  This kind of config limiting should be done in the config system
>> IMO. I've asked Roman for that capability....
>>
>> Here's a patch that limits kernel log buffer size to 1 MB max.
>> Comments?
>
> I liked points (a) and (e) above.
>
> I say if users cannot bother to read the documentation and understanding
> things, why are they compiling a kernel?
>
> And if we are going to implement parameters bounds checking it should be
> done in kconfig.  There are a few other places that want it, too.

I forgot another point:  don't change default config settings unless
you are willing to read the help text.

~Randy  [sorry if you get this multiple times; i had to resend it]





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

* Re: Wanted: a limit on kernel log buffer size
  2003-04-07  3:35   ` Randy.Dunlap
@ 2003-04-07  3:39     ` Robert Love
  2003-04-07  4:32       ` Randy.Dunlap
  0 siblings, 1 reply; 10+ messages in thread
From: Robert Love @ 2003-04-07  3:39 UTC (permalink / raw)
  To: Randy.Dunlap; +Cc: 76306.1226, linux-kernel

On Sun, 2003-04-06 at 23:35, Randy.Dunlap wrote:

> > a.  If someone won't read the help text, how can we help them?
> >
> > b.  If we make a 2 GB log buffer size a compile-time error, will
> > they read that?
> >
> > c.  If we make it a compile-time warning, will they read that?
> >
> > d.  What limit(s) do you suggest?  I can try to add some limits.
> >
> > e.  This kind of config limiting should be done in the config system IMO.
> > I've asked Roman for that capability....
> 
> Here's a patch that limits kernel log buffer size to 1 MB max.
> Comments?

I liked points (a) and (e) above.

I say if users cannot bother to read the documentation and understanding
things, why are they compiling a kernel?

And if we are going to implement parameters bounds checking it should be
done in kconfig.  There are a few other places that want it, too.

	Robert Love


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

* Re: Wanted: a limit on kernel log buffer size
  2003-04-07  2:49 ` Randy.Dunlap
@ 2003-04-07  3:35   ` Randy.Dunlap
  2003-04-07  3:39     ` Robert Love
  2003-04-07 12:19   ` Roman Zippel
  1 sibling, 1 reply; 10+ messages in thread
From: Randy.Dunlap @ 2003-04-07  3:35 UTC (permalink / raw)
  To: rddunlap; +Cc: 76306.1226, linux-kernel

>>  Some people (who will mercifully go unnamed) just will _not_
>> read the documentation, and set the kernel log buffer shift
>> to 31 on a 256MB machine.  This attempt to allocate 2GB of memory for the
>> buffer results in an unbootable kernel.
>>
>>  Suggestions?
>
> This is a multi-part answer.  Say, 5 parts.
>
> a.  If someone won't read the help text, how can we help them?
>
> b.  If we make a 2 GB log buffer size a compile-time error, will
> they read that?
>
> c.  If we make it a compile-time warning, will they read that?
>
> d.  What limit(s) do you suggest?  I can try to add some limits.
>
> e.  This kind of config limiting should be done in the config system IMO.
> I've asked Roman for that capability....


Here's a patch that limits kernel log buffer size to 1 MB max.
Comments?

I'm inserting it here via cut-and-paste, so it might not be all clean.
Patch is to 2.5.66-PV (plain vanilla).


patch_name:	logbuf-limit.patch
patch_version:	2003-04-06.20:28:43
author:		Randy.Dunlap <rddunlap@osdl.org>
description:	limit kernel log buffer size to 1 MB
product:	Linux
product_versions: 2.5.66
diffstat:	=
 kernel/printk.c |    3 +++
 1 files changed, 3 insertions(+)


diff -Naur ./kernel/printk.c%LBLIM ./kernel/printk.c
--- ./kernel/printk.c%LBLIM	2003-04-06 20:27:28.000000000 -0700
+++ ./kernel/printk.c	2003-04-06 20:27:53.000000000 -0700
@@ -34,6 +34,9 @@

 #define LOG_BUF_LEN	(1 << CONFIG_LOG_BUF_SHIFT)
 #define LOG_BUF_MASK	(LOG_BUF_LEN-1)
+#if (CONFIG_LOG_BUF_SHIFT > 20)
+#error CONFIG_LOG_BUF_SHIFT is ridiculously large (more than 1 MB).
+#endif

 /* printk's without a loglevel use this.. */
 #define DEFAULT_MESSAGE_LOGLEVEL 4 /* KERN_WARNING */





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

* Re: Wanted: a limit on kernel log buffer size
  2003-04-07  1:34 Chuck Ebbert
@ 2003-04-07  2:49 ` Randy.Dunlap
  2003-04-07  3:35   ` Randy.Dunlap
  2003-04-07 12:19   ` Roman Zippel
  0 siblings, 2 replies; 10+ messages in thread
From: Randy.Dunlap @ 2003-04-07  2:49 UTC (permalink / raw)
  To: 76306.1226; +Cc: linux-kernel

>  Some people (who will mercifully go unnamed) just will _not_
> read the documentation, and set the kernel log buffer shift
> to 31 on a 256MB machine.  This attempt to allocate 2GB of memory
> for the buffer results in an unbootable kernel.
>
>  Suggestions?

This is a multi-part answer.  Say, 5 parts.

a.  If someone won't read the help text, how can we help them?

b.  If we make a 2 GB log buffer size a compile-time error, will
they read that?

c.  If we make it a compile-time warning, will they read that?

d.  What limit(s) do you suggest?  I can try to add some limits.

e.  This kind of config limiting should be done in the config system IMO.
I've asked Roman for that capability....

~Randy




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

* Wanted: a limit on kernel log buffer size
@ 2003-04-07  1:34 Chuck Ebbert
  2003-04-07  2:49 ` Randy.Dunlap
  0 siblings, 1 reply; 10+ messages in thread
From: Chuck Ebbert @ 2003-04-07  1:34 UTC (permalink / raw)
  To: linux-kernel

 Some people (who will mercifully go unnamed) just will _not_
read the documentation, and set the kernel log buffer shift
to 31 on a 256MB machine.  This attempt to allocate 2GB of memory
for the buffer results in an unbootable kernel.

 Suggestions?

--
 Chuck
 I am not a number!

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

end of thread, other threads:[~2003-04-07 21:03 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-07  8:55 Wanted: a limit on kernel log buffer size Chuck Ebbert
  -- strict thread matches above, loose matches on Subject: below --
2003-04-07 21:12 Chuck Ebbert
2003-04-07  8:55 Chuck Ebbert
2003-04-07 16:24 ` Randy.Dunlap
2003-04-07  1:34 Chuck Ebbert
2003-04-07  2:49 ` Randy.Dunlap
2003-04-07  3:35   ` Randy.Dunlap
2003-04-07  3:39     ` Robert Love
2003-04-07  4:32       ` Randy.Dunlap
2003-04-07 12:19   ` Roman Zippel

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).