public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: ooyama eiichi <ooyama@tritech.co.jp>
Cc: cw@f00f.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: kernel stack size
Date: Sat, 02 Apr 2005 14:04:11 -0500	[thread overview]
Message-ID: <1112468651.27149.4.camel@localhost.localdomain> (raw)
In-Reply-To: <20050403.034858.70218818.ooyama@tritech.co.jp>

On Sun, 2005-04-03 at 03:48 +0900, ooyama eiichi wrote:

> > > because my driver hungs the machine by an certain ioctl.  and it
> > > seems to me there is no bad in the code correspond to the ioctl,
> > > except for that it is using large auto variables.  (some functions
> > > are useing ~1KB autos)
> > 
> > don't do that, even if you make it 'apparently' work for you it will
> > just end up being a problem mater on or for someone else
> > 
> 
> I changed these to using kmalloc().
> (but not yet confirmed for my driver to work properly)

You can also use globally static variables too. But this makes for
non-reentry code.

Sometimes I don't feel that a kmalloc is worth it, and if the function
in question for the driver would seldom have problems with reentry, I
use a statically defined global, and protect it with spin_locks. If
these can also be used in interrupt context, you need to use the
spin_lock_irqsave variants.  But don't do this if the critical section
has long latencies.

-- Steve



  reply	other threads:[~2005-04-02 19:04 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-02 17:46 kernel stack size ooyama eiichi
2005-04-02 17:53 ` Chris Wedgwood
2005-04-02 18:15   ` ooyama eiichi
2005-04-02 18:24     ` Chris Wedgwood
2005-04-02 18:48       ` ooyama eiichi
2005-04-02 19:04         ` Steven Rostedt [this message]
2005-04-02 19:37           ` Al Viro
2005-04-02 19:52             ` Steven Rostedt
2005-04-02 18:29     ` Brian Gerst
  -- strict thread matches above, loose matches on Subject: below --
2005-04-02 20:14 Manfred Spraul
2005-04-02 22:15 ` Steven Rostedt
2005-04-03  7:10   ` Manfred Spraul
2005-04-03 18:01     ` Steven Rostedt
2005-04-03 19:23       ` Manfred Spraul
2003-10-09 19:14 Punj, Arun

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=1112468651.27149.4.camel@localhost.localdomain \
    --to=rostedt@goodmis.org \
    --cc=cw@f00f.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ooyama@tritech.co.jp \
    /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