stack overflow on Sparc64

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Mikulas Patocka
Date: Tuesday, June 17, 2008 - 5:47 pm

Hi

I am getting stack overflows on my Sparc64 station. They happen when I 
copy to device-mapper snapshot origin device using small IO size (512 
bytes) and simultaneously execute "lvs" command. The kernel is compiled 
with most debugging functions enabled. The stack trace is this:

__ide_end_request
__blk_end_request
__end_that_request_first
req_bio_endio
bio_endio
clone_endio
dec_pending
bio_endio
clone_endio
dec_pending
bio_endio
clone_endio
dec_pending
bio_endio
end_bio_bh_io_sync
end_buffer_read_sync
__end_buffer_read_notouch
unlock_buffer
wake_up_bit
__wake_up_bit
__wake_up
__wake_up_common
wake_bit_function
autoremove_wake_function
default_wake_function
try_to_wake_up
task_rq_lock
__spin_lock
lock_acquire
__lock_acquire
*** crash, stack overflow

--- observations:

That loop bio_endio->clone_endio->dec_pending is repeating for each level 
of nested devices --- so for any architecture there exists a level at 
which it causes trouble. We need something to prevent recursion, maybe the 
similar trick that was done with avoing bio request function recursion 
(i.e. if bio_endio is called recursively, it just adds the bio to queue 
and lets the top level to call endio method).

Wait queue waking looks like being written by a high-level maniac --- it 
contains 8 levels of calls (none of them inlined). 7 of these calls (until 
try_to_wake_up) do nothing but pass arguments to lower level call. And 
each of these calls allocate at least 192 bytes of stack space. All these 
7 useless calls consume 1360 bytes of stack (and cause windows traps that 
needlessly damage performance). Would you agree to inline most of the 
calls to save stack? Or do you see another solution?

Long-term consideration: Is it possible to implement interrupt stacks on 
sparc64? Functions on sparc eat stack much more aggressively than on other 
architectures (minimum stack size for a function is 192 bytes).

Mikulas
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
stack overflow on Sparc64, Mikulas Patocka, (Tue Jun 17, 5:47 pm)
Re: stack overflow on Sparc64, David Miller, (Tue Jun 17, 9:01 pm)
Re: stack overflow on Sparc64, Mikulas Patocka, (Wed Jun 18, 8:24 pm)
Re: stack overflow on Sparc64, David Miller, (Wed Jun 18, 8:59 pm)
Re: stack overflow on Sparc64, Mikulas Patocka, (Wed Jun 18, 10:17 pm)
Re: stack overflow on Sparc64, David Miller, (Wed Jun 18, 11:37 pm)
Re: stack overflow on Sparc64, Mikulas Patocka, (Thu Jun 19, 6:01 am)
Re: stack overflow on Sparc64, Mikulas Patocka, (Fri Jun 20, 8:47 am)
Re: stack overflow on Sparc64, David Miller, (Fri Jun 20, 10:26 am)
Re: stack overflow on Sparc64, Mikulas Patocka, (Fri Jun 20, 1:34 pm)
Re: stack overflow on Sparc64, David Miller, (Fri Jun 20, 1:37 pm)
Re: stack overflow on Sparc64, Mikulas Patocka, (Fri Jun 20, 2:14 pm)
Re: stack overflow on Sparc64, David Miller, (Fri Jun 20, 2:20 pm)
Re: stack overflow on Sparc64, Mikulas Patocka, (Fri Jun 20, 2:25 pm)
Re: stack overflow on Sparc64, Mikulas Patocka, (Fri Jun 20, 2:26 pm)
Re: stack overflow on Sparc64, David Miller, (Fri Jun 20, 2:41 pm)
Re: stack overflow on Sparc64, David Miller, (Fri Jun 20, 2:44 pm)
Re: stack overflow on Sparc64, David Miller, (Fri Jun 20, 2:47 pm)
Re: stack overflow on Sparc64, Mikulas Patocka, (Fri Jun 20, 3:22 pm)
Re: stack overflow on Sparc64, David Miller, (Fri Jun 20, 3:28 pm)
Re: stack overflow on Sparc64, Mikulas Patocka, (Fri Jun 20, 3:33 pm)
Re: stack overflow on Sparc64, Mikulas Patocka, (Fri Jun 20, 3:36 pm)
Re: stack overflow on Sparc64, David Miller, (Fri Jun 20, 3:47 pm)
Re: stack overflow on Sparc64, Mikulas Patocka, (Fri Jun 20, 5:37 pm)
Re: stack overflow on Sparc64, David Miller, (Fri Jun 20, 9:51 pm)
Re: stack overflow on Sparc64, Mikulas Patocka, (Sat Jun 21, 12:42 pm)
Re: stack overflow on Sparc64, David Miller, (Sun Jun 22, 12:03 am)
Re: stack overflow on Sparc64, Mikulas Patocka, (Sun Jun 22, 6:48 am)
Re: stack overflow on Sparc64, David Miller, (Mon Aug 11, 11:30 pm)
Re: stack overflow on Sparc64, David Miller, (Tue Aug 12, 1:22 am)
Re: stack overflow on Sparc64, Mikulas Patocka, (Tue Aug 12, 5:53 pm)
Re: stack overflow on Sparc64, David Miller, (Tue Aug 12, 5:59 pm)
console handover badness [was: stack overflow on Sparc64], Mikulas Patocka, (Tue Aug 12, 6:11 pm)
Re: console handover badness, David Miller, (Tue Aug 12, 6:22 pm)
Re: console handover badness, David Miller, (Tue Aug 12, 6:40 pm)
Re: console handover badness, David Miller, (Wed Aug 13, 1:50 am)
Re: console handover badness, Mikulas Patocka, (Wed Aug 13, 5:46 am)
Re: console handover badness, David Miller, (Wed Aug 13, 8:25 pm)
Bootmem allocator broken [was: console handover badness], Mikulas Patocka, (Thu Aug 14, 4:11 pm)
Re: Bootmem allocator broken, David Miller, (Thu Aug 14, 4:25 pm)
Re: Bootmem allocator broken, Johannes Weiner, (Thu Aug 14, 4:40 pm)
Re: Bootmem allocator broken, Alexander Beregalov, (Fri Aug 15, 4:09 am)
Re: Bootmem allocator broken, David Miller, (Fri Aug 15, 2:13 pm)