Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758727AbYBYU1W (ORCPT ); Mon, 25 Feb 2008 15:27:22 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756124AbYBYU1M (ORCPT ); Mon, 25 Feb 2008 15:27:12 -0500 Received: from smtp1.linux-foundation.org ([207.189.120.13]:47532 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756172AbYBYU1K (ORCPT ); Mon, 25 Feb 2008 15:27:10 -0500 Date: Mon, 25 Feb 2008 12:25:22 -0800 From: Andrew Morton To: Peter Osterlund Cc: Nix , linux-kernel@vger.kernel.org, dm-devel@redhat.com Subject: Re: 2.6.24.2: 4KSTACKS + pcdrw + dm + mount -> stack overflow: ide-cd related? dm-related? Message-Id: <20080225122522.f2a9f073.akpm@linux-foundation.org> In-Reply-To: References: <87wsovkth5.fsf@hades.wkstn.nix> <87skzipcpw.fsf@hades.wkstn.nix> X-Mailer: Sylpheed 2.4.7 (GTK+ 2.12.1; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2055 Lines: 63 On Sun, 24 Feb 2008 17:56:09 +0100 Peter Osterlund wrote: > > drivers/block/pktcdvd.c | 16 ++++++++-------- > 1 files changed, 8 insertions(+), 8 deletions(-) > > diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c > index 674cd66..f2510e7 100644 > --- a/drivers/block/pktcdvd.c > +++ b/drivers/block/pktcdvd.c > @@ -849,7 +849,7 @@ static int pkt_flush_cache(struct pktcdvd_device *pd) > /* > * speed is given as the normal factor, e.g. 4 for 4x > */ > -static int pkt_set_speed(struct pktcdvd_device *pd, unsigned write_speed, unsigned read_speed) > +static noinline int pkt_set_speed(struct pktcdvd_device *pd, unsigned write_speed, unsigned read_speed) > > ... yup, I'll grab that. I'll even write your changelog for you (grr). But first, let's do this: From: Andrew Morton People are adding `noinline' in various places to prevent excess stack consumption due to gcc inlining. But once this is done, it is quite unobvious why the `noinline' is present in the code. We can comment each and every site, or we can use noinline_for_stack. Signed-off-by: Andrew Morton --- include/linux/compiler.h | 6 ++++++ 1 file changed, 6 insertions(+) diff -puN include/linux/compiler.h~add-noinline_for_stack include/linux/compiler.h --- a/include/linux/compiler.h~add-noinline_for_stack +++ a/include/linux/compiler.h @@ -138,6 +138,12 @@ extern void __chk_io_ptr(const volatile #define noinline #endif +/* + * Rather then using noinline to prevent stack consumption, use + * noinline_for_stack instead. For documentaiton reasons. + */ +#define noinline_for_stack noinline + #ifndef __always_inline #define __always_inline inline #endif _ (Note that these changes don't let DM off the hook!) -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/