mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Keith Owens <kaos@ocs.com.au>
Cc: vgoyal@in.ibm.com, Takenori Nagano <t-nagano@ah.jp.nec.com>,
	k-miyoshi@cb.jp.nec.com, Bernhard Walle <bwalle@suse.de>,
	kexec@lists.infradead.org, linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [RFC] Handling kernel stack overflows
Date: Fri, 03 Aug 2007 06:36:23 -0600	[thread overview]
Message-ID: <m11wekn6bc.fsf@ebiederm.dsl.xmission.com> (raw)
In-Reply-To: <31700.1186113953@kao2.melbourne.sgi.com> (Keith Owens's message of "Fri, 03 Aug 2007 14:05:53 +1000")


Well we currently keep a struct thread_info on the stack
which while not as bad as task_struct has it's own uses
and implications which may limit what you are trying
to do.

That said a function like:

int call_on_new_stack(int (*continuation)(void *), void *closure)
{
	struct task_struct *tsk;
	struct thread_info *ti;

	if (plenty_of_stack_space())
		return continuation(closure);

	tsk = current();
	ti = alloc_thread_info(tsk);
	if (!ti)
		return -ENOMEM;

	setup_extra_thread_info(tsk, ti, continuation, closure);
	schedule();
}

Might make sense.  Last I heard the block layer and xfs seemed
to have largely solved their problems with running short on stack
space, so I don't know if it is necessary but it certainly sounds
relatively simple and interesting.

Running short on stack space is a recurring theme so a function that
allows us to have a little more when we really need it and be able to
switch even x86_64 to 4K stacks would be interesting.

I'm not quite certain where we could insert calls to call_on_new_stack,
but it looks simple enough that it is worth coding up and playing
with.  If the results are good it could be worth merging.

Eric

  reply	other threads:[~2007-08-03 12:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-03  4:05 Keith Owens
2007-08-03 12:36 ` Eric W. Biederman [this message]
2007-08-05  2:25   ` Keith Owens
2007-08-05  3:42     ` Eric W. Biederman
2007-08-03 13:30 ` Adrian Bunk

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=m11wekn6bc.fsf@ebiederm.dsl.xmission.com \
    --to=ebiederm@xmission.com \
    --cc=akpm@linux-foundation.org \
    --cc=bwalle@suse.de \
    --cc=k-miyoshi@cb.jp.nec.com \
    --cc=kaos@ocs.com.au \
    --cc=kexec@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=t-nagano@ah.jp.nec.com \
    --cc=vgoyal@in.ibm.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®