public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* copy_thread preserves kernel stack
@ 2003-07-03  2:02 Keith Owens
  2003-07-07 21:13 ` David Mosberger
  0 siblings, 1 reply; 2+ messages in thread
From: Keith Owens @ 2003-07-03  2:02 UTC (permalink / raw)
  To: linux-ia64

The ia64 version of copy_thread() preserves the parent kernel stack
which takes stack space away from the child thread, increasing the risk
of stack overflow.  The i386 version of copy_thread() creates a
pristine stack for the new thread.

ia64 has a comment "Note: if we get called through kernel_thread() then
the memory above "(highest addr)" is valid kernel stack memory that
needs to be copied as well".  i386 kernel threads work fine without the
extra stack wastage, so there is no generic reason to save the parent
backtrace.  Apart from unwind problems, I can see no reason for ia64 to
preserve the parent's task in kernel threads.  Any objections to me
doing a patch that constructs an empty stack for ia64 kernel threads?



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

* Re: copy_thread preserves kernel stack
  2003-07-03  2:02 copy_thread preserves kernel stack Keith Owens
@ 2003-07-07 21:13 ` David Mosberger
  0 siblings, 0 replies; 2+ messages in thread
From: David Mosberger @ 2003-07-07 21:13 UTC (permalink / raw)
  To: linux-ia64

>>>>> On Thu, 03 Jul 2003 12:02:54 +1000, Keith Owens <kaos@ocs.com.au> said:

  Keith> ia64 has a comment "Note: if we get called through
  Keith> kernel_thread() then the memory above "(highest addr)" is
  Keith> valid kernel stack memory that needs to be copied as well".
  Keith> i386 kernel threads work fine without the extra stack
  Keith> wastage, so there is no generic reason to save the parent
  Keith> backtrace.  Apart from unwind problems, I can see no reason
  Keith> for ia64 to preserve the parent's task in kernel threads.
  Keith> Any objections to me doing a patch that constructs an empty
  Keith> stack for ia64 kernel threads?

If the patch is clean, I wouldn't have a problem with it.  (Please
make sure that the call-chain of the child thread is properly
terminated, so the unwinder knows when to stop.)

(There used to be only few kernel threads, with little risk of kernel
 stack overflows, but nowadays (2.5.xx) the situation is quite
 different, so it probably makes sense to make this change).

	--david

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

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

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-07-03  2:02 copy_thread preserves kernel stack Keith Owens
2003-07-07 21:13 ` David Mosberger

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