Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp5202416pxu; Wed, 21 Oct 2020 17:03:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwiH2xKqB4kam3JYxgz35cmvOPTbhikNuTzIvI8jGkYNDYGY4s43Mtvd+QlWi9lX6srsHUk X-Received: by 2002:a05:6402:69a:: with SMTP id f26mr2324446edy.170.1603324986876; Wed, 21 Oct 2020 17:03:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603324986; cv=none; d=google.com; s=arc-20160816; b=ZizEtGsAUMXOTMlB8k8LEYidVdOL0UOujdg3H40z4wqFpTjcOTwc0AEEYNaXscNbfk ITT3QLLJt1KMuIf1Gw1xYI+qKlB1unLZUJ4Hh0WweL6hdNY4PfId8cC9/grm2atxk1KB kqmBNeSSoimDNNpDTqlLM7VFKRdcPAlcbUV8i6kaqonEl1j9GwdemeTLr1nXFfIjFJ2I monr2X9HJzd04YhDkbM++CD8otXgL9MpVoaU9QRwUp1sKbjZHcS/fjEPkCom1zC2iWZa +aLkMQL7TjXQOnXLE2R4h5RW4rsPagUnD0zEhdjXbTewcfe3vunRDzeLQcHaVBg+DSZc aUFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=KjDZj7jv/QmeVv/HyadGtxH0b8QpjjCHYbS7ZTPmBWE=; b=b0bC2leXKxvx4+DC3j/RtbqHfn2A8YW2uq9R2D/QW6h85p2nUKc4HNuqn+pMqdp3R4 U3mq/EzvNSwqmkKtqxi8SrY6ygqISyw74LttQcVpvLRt78o46pezZuLospVv/5wHRnLb S+9Puo5VIoTu/cOO/SQQyJG/Mt6Wh/co6m5BpHDsesliJfPEuQYdiujKfQxDtQ9eSt+C ti3Reqz9WpsEvR+SGqlN3q7dJ6NOKaJr6o6KZ5QpcaPqXaBORJGsNZX80BXhZ2N8dGIj mceTk3zBJ+5D2uMAhjXfyJM7AHqTBM9ZjrNjI4r3zda8Budl1UO3xy67fpSQca9sfnP2 O2gQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=0MSJvLoa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a15si2846996eju.63.2020.10.21.17.02.45; Wed, 21 Oct 2020 17:03:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=0MSJvLoa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2440392AbgJUMeP (ORCPT + 99 others); Wed, 21 Oct 2020 08:34:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2440367AbgJUMeO (ORCPT ); Wed, 21 Oct 2020 08:34:14 -0400 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75AC1C0613CE for ; Wed, 21 Oct 2020 05:34:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=KjDZj7jv/QmeVv/HyadGtxH0b8QpjjCHYbS7ZTPmBWE=; b=0MSJvLoarof91KiLDHrbNudem nNnus0fI426ZesZDBv96ZksSlXAwGCKZtZBDlAl1dywPBwTK36wSJ8RYOFBv+kEK5GyyNDfUTnixg Jw0hd6H4JHE0+rfFGZkEZCroz4bncPTVKk7epp/ewjYrX+gIqc+sOO8c2wAiZJT6YMxCB6dqlyGZj QvC03krJ7bDzDPoGDzv8UrT993jHzISm4B+Mdg2LQ17A1+EgW3H+H4Va7Y+nvmPPyUH9OMXz6JBdW nnNix9L1WSJbwfCryjP6JOowtx9AK9WOU0epyikDdMLbMrPm5mYvg/++vz9P5X1k/v8y+CWm4bwgP oc0PPSzIw==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:49092) by pandora.armlinux.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kVDJc-0000W6-Ji; Wed, 21 Oct 2020 13:34:04 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1kVDJY-0006Ng-MV; Wed, 21 Oct 2020 13:34:00 +0100 Date: Wed, 21 Oct 2020 13:34:00 +0100 From: Russell King - ARM Linux admin To: Arnd Bergmann Cc: Maninder Singh , v.narang@samsung.com, a.sahrawat@samsung.com, Andrew Morton , Marc Zyngier , Sebastian Andrzej Siewior , Vincent Whitchurch , Nick Desaulniers , "linux-kernel@vger.kernel.org" , Valentin Schneider , Dmitry Safonov <0x7f454c46@gmail.com>, Thomas Gleixner , Nathan Huckleberry , Will Deacon , Jian Cai , Linux ARM , Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= Subject: Re: [PATCH 0/3] IRQ stack support for ARM Message-ID: <20201021123400.GK1551@shell.armlinux.org.uk> References: <1602141333-17822-1-git-send-email-maninder1.s@samsung.com> <20201008083015.GK1551@shell.armlinux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: Russell King - ARM Linux admin Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 21, 2020 at 01:58:21PM +0200, Arnd Bergmann wrote: > (replying to my own mail, apparently my normal outgoing email server is > blacklisted, so resending from @kernel.org) > > On Fri, Oct 16, 2020 at 12:09 PM Arnd Bergmann wrote: > > > > On Thu, Oct 8, 2020 at 10:32 AM Russell King - ARM Linux admin > > wrote: > > > On Thu, Oct 08, 2020 at 12:45:30PM +0530, Maninder Singh wrote: > > > > Observed Stack Overflow on 8KB kernel stack on ARM specially > > > > incase on network interrupts, which results in undeterministic behaviour. > > > > So there is need for per cpu dedicated IRQ stack for ARM. > > > > > > > > As ARm does not have extra co-processor register > > > > to save thread info pointer, IRQ stack will be at some > > > > performance cost, so code is under CONFIG_IRQ_STACK. > > > > > > > > and we don't have much knowledge and set up for CLANG > > > > and ARM_UNWIND, so dependency added for both cases. > > > > > > > > Tested patch set with QEMU for latest kernel > > > > and 4.1 kernel for ARM target with same patch set. > > > > > > You need to investigate and show where and why this is happening. My > > > guess is you have a network driver that uses a lot of kernel stack > > > space, which itself would be a bug. > > > > Agreed. > > > > > Note that there are compiler versions out there that mis-optimise and > > > eat stack space - the kernel build should be warning if a function > > > uses a large amount of stack. > > > > Some more ideas for figuring it out: > > > > CONFIG_DEBUG_STACK_USAGE may also be helpful in identifying > > code paths that are deeply nested with multiple functions taking a > > lot of stack space, but each one staying under the limit. > > > > CONFIG_DEBUG_STACKOVERFLOW would also help here but > > is not supported on Arm at the moment. There was a patch[1] from > > Uwe Kleine-K?nig to add this, and I suppose we should still add > > that, in particular if it helps debug this problem. > > > > CONFIG_VMAP_STACK is probably the best way to debug > > random runtime stack overflows because using a guard page > > turns random memory corruption into an immediate oops, > > but I don't think there is an implementation for Arm yet and > > using a lot of vmalloc space means we might not be able to > > default to this. > > > > Regardless of identifying and fixing the bug Maninder found, I > > also think that supporting separate async stacks on Arm is useful > > for determinism. Most of the popular architectures use irqstack > > for this reason, and I was actually surprised that we don't do it > > on arch/arm/. > > > > Arnd > > > > [1] https://lore.kernel.org/linux-arm-kernel/20200108082913.29710-1-u.kleine-koenig@pengutronix.de/ We don't do it because we don't have a separate register to be able to store the thread_info pointer, and copying that lump between the SVC and IRQ stack will add massively to IRQ latency, especially for older machines. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!