Re: [PATCH][RFC] 4K stacks default, not a debug thing any more...?

Neil Brown
2007-07-11T22:09:29Z

On Wednesday July 11, phillips@phunq.net wrote:
> On Wednesday 11 July 2007 10:54, Zan Lynx wrote:
> > Jesper Juhl wrote:
> > > Hi,
> > >
> > > I'm wondering if it's time to make 4K stacks the default and to start
> > > considering removing the 8K stack option alltogether soon?
> > >
> > > One of the big problem spots was XFS, but that got some stack usage
> > > fixes recently, and the 4K stack option has been around for quite a
> > > while now, so people really should have gotten around to fixing any
> > > code that can't handle it. Are there still any big problem areas
> > > remaining?
> >
> > Has anyone fixed the infrequent crashes with 4K stacks and ext3 -> LVM
> > snapshot -> LVM -> DM mirror -> libata?
>
> Ahem: ext3 -> LVM snapshot -> LVM -> DM mirror -> DM crypt -> md -> libata,
> or worse.
>
> No, it's not fixed. The model is wrong. Virtual block drivers should not
> be callling submit_bio. The recursive IO submissions should be handled
> on a dedicated stack, most probably allocated as part of the request queue.
> This could be done easily in device mapper and md, or better, in
> submit_bio.

Maybe you should read that latest kernel source code. Particularly
generic_make_request in block/ll_rw_blk.c.
The comment preceding it read:

/*
* We only want one ->make_request_fn to be active at a time,
* else stack usage with stacked devices could be a problem.
* So use current->bio_{list,tail} to keep a list of requests
* submited by a make_request_fn function.
* current->bio_tail is also used as a flag to say if
* generic_make_request is currently active in this task or not.
* If it is NULL, then no make_request is active. If it is non-NULL,
* then a make_request is active, and new requests should be added
* at the tail
*/

NeilBrown