mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Richard Gooch <rgooch@ras.ucalgary.ca>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Akash Jain <aki.jain@stanford.edu>,
	alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org,
	su.class.cs99q@nntp.stanford.edu
Subject: Re: [PATCH] fs/devfs/base.c
Date: Sun, 3 Jun 2001 18:03:46 -0600	[thread overview]
Message-ID: <200106040003.f5403kd07861@vindaloo.ras.ucalgary.ca> (raw)
In-Reply-To: <Pine.LNX.4.21.0106031652090.32451-100000@penguin.transmeta.com>
In-Reply-To: <200105271321.f4RDLoM00342@mobilix.ras.ucalgary.ca> <Pine.LNX.4.21.0106031652090.32451-100000@penguin.transmeta.com>

Linus Torvalds writes:
> 
> On Sun, 27 May 2001, Richard Gooch wrote:
> > 
> > I absolutely don't want this patch applied. It's bogus. It is entirely
> > safe to alloc 1 kB on the stack in this code, since it has a short and
> > well-controlled code path from syscall entry to the function.
> 
> IT IS NEVER EVER SAFE TO ALLOCATE 1kB OF STACK!

I can see you care about this ;-)

> Why?
>  - the kernel stack is 4kB, and _nobody_ has the right to eat up a
>    noticeable portion of it. It doesn't matter if you "know" your caller
>    or not: you do not know what interrupts happen during this time, and
>    how much stack they want.

OK, that's a good point. Easy solution: disable interrupts in that
function.

Only kidding.

> Ergo: the simple rule of "don't allocate big structures of the
> stack" is always a good rule, and making excuses for it is bad.

OK, well, I can make the structure static instead, since the function
is single-threaded anyway.

				Regards,

					Richard....
Permanent: rgooch@atnf.csiro.au
Current:   rgooch@ras.ucalgary.ca

      parent reply	other threads:[~2001-06-04  0:24 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-05-27 10:12 Akash Jain
2001-05-27 13:21 ` Richard Gooch
2001-05-28 14:43   ` Maximum size of automatic allocation? (was: [PATCH] fs/devfs/base.c) Daniel Phillips
2001-06-03 23:55   ` [PATCH] fs/devfs/base.c Linus Torvalds
2001-06-04  6:44     ` Alan Cox
2001-06-04 10:09       ` Linus Torvalds
2001-06-05  1:41       ` Dawson R Engler
2001-06-05  8:49       ` Ingo Molnar
2001-06-04  7:07     ` Richard Gooch
2001-06-04 19:26       ` Bill Pringlemeir
2001-06-04 19:39         ` Kernel Stack usage [was: [PATCH] fs/devfs/base.c] Bill Pringlemeir
2001-06-05  6:10         ` [PATCH] fs/devfs/base.c H. Peter Anvin
2001-06-05  6:56           ` Alan Cox
2001-06-05 11:37             ` Andrew Morton
2001-06-05 21:38             ` Pavel Machek
2001-06-04 20:15     ` Daniel Phillips
2001-06-05  4:24     ` Paul Mackerras
2001-06-04  0:03   ` Richard Gooch [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200106040003.f5403kd07861@vindaloo.ras.ucalgary.ca \
    --to=rgooch@ras.ucalgary.ca \
    --cc=aki.jain@stanford.edu \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=su.class.cs99q@nntp.stanford.edu \
    --cc=torvalds@transmeta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®