Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp76249ybl; Tue, 7 Jan 2020 14:29:08 -0800 (PST) X-Google-Smtp-Source: APXvYqxS0/TVgbBXziJi8VLSAiSehdr5WzEL/CJB+DGXXDDfJ82jeKWF5/VQFxbhZBVji6dbSSJ8 X-Received: by 2002:aca:388:: with SMTP id 130mr553457oid.89.1578436148464; Tue, 07 Jan 2020 14:29:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578436148; cv=none; d=google.com; s=arc-20160816; b=Ls4Q5Y0Lc8vnUEcLXW9/9SQ8u5h/HLc7QvlFhN3/5MKIS6o4p1d2VtWVqhosjI7HEr O4/hc/iJSyNE75hAbopk683t6Hj2V0+qXqTQWeOcGwEhNObZnM4GEny/73dPNnirSCT7 8WK+DfFyVbkes5MJ823EmHFaiHRwLqqL3ySOmCuRX8dszOtUsPyO33G3Djf+Wn5D4B5/ j5V9gpUYbvH7SsvhW75UbP/w4BzFbTdk0Ym35FCzTfsbj9Q4pcblSuzXKfARQQdF1H5t ZfPzMs+4Xjvm7KcyD1lXindbUbm1KC3RS11KUL90fhZndHMXu/CV4Ry0pcrslVZ6454n NxMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=rSIBPs+w9xtE02LMroqTw6x3MoKMt0ZBc5ENJEP9JjU=; b=bos27lT2P+wotRhMjZv8A08BZe6uFF38ZSySATX/DLI9DOhl9r5/K07V9sP6BpKdqs EcKJn2ayNgrwGZhzPkJFCh+tP867OKVqjNT7chM8OJ/zH5QJHC0WqdOAZvKBaL6ocVTX LYZmN/gd1daDyw5cmAokeCtBTyyq+3dW3N8amJnCVqbcytOew3UQgcsAa7WmxbU+IYzS qNTIUzPwLxBJDnquxODxBATpns03YuexSyTTjsvMixVCRbLe8g2QOkmwRBkMAMb6EmwG ICrPX2tbzb61eRaVPO6c/+LcLUohyvjV3GSGp6yFpOAWV0SusQ58sbxx6U+2cAPwtC8M pH8g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c21si665196oto.176.2020.01.07.14.28.55; Tue, 07 Jan 2020 14:29:08 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727417AbgAGW0x (ORCPT + 99 others); Tue, 7 Jan 2020 17:26:53 -0500 Received: from mout.kundenserver.de ([217.72.192.75]:48165 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727183AbgAGW0x (ORCPT ); Tue, 7 Jan 2020 17:26:53 -0500 Received: from mail-qk1-f169.google.com ([209.85.222.169]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.145]) with ESMTPSA (Nemesis) id 1Ma1wY-1j9yEZ48tY-00VwoW for ; Tue, 07 Jan 2020 23:26:52 +0100 Received: by mail-qk1-f169.google.com with SMTP id j9so971782qkk.1 for ; Tue, 07 Jan 2020 14:26:51 -0800 (PST) X-Gm-Message-State: APjAAAVmU6N2OcHBKgKoO/qeqkduVlrgWfzvDgcZmgWxGHt+mNJzw8mx x2HZIzbNEv+HLnsjycEmg2tGsi6KW+L/sSF0Hx4= X-Received: by 2002:a37:84a:: with SMTP id 71mr1543490qki.138.1578436010905; Tue, 07 Jan 2020 14:26:50 -0800 (PST) MIME-Version: 1.0 References: <20200107212747.4182515-1-arnd@arndb.de> <20200107220019.GC7869@pendragon.ideasonboard.com> <20200107221222.GE7869@pendragon.ideasonboard.com> In-Reply-To: <20200107221222.GE7869@pendragon.ideasonboard.com> From: Arnd Bergmann Date: Tue, 7 Jan 2020 23:26:34 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] drm: panel: fix excessive stack usage in td028ttec1_prepare To: Laurent Pinchart Cc: Thierry Reding , David Airlie , Daniel Vetter , Oleksandr Natalenko , Sam Ravnborg , Linus Walleij , Boris Brezillon , Tomi Valkeinen , dri-devel , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:u6/beJz7TR6r0QjR0vl02vCMk13wj0ZyfnwIHL7j3P1KqZQ79AT yNPk9vm930p7cC1ZzANAW5s1hHFuVKP7bYHBAlx9vwVqGBFAc/cCytdTkb3V0TuEaOctcJA NztDqF9lhRw+kx95H443koakYFGJ52IzR4gdHWtrvB6siIlksuj+JFygWgK+XJpK7XOMpB3 oC2zNhl3kbqI7LiSKC5lA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:mzMZv78yU4M=:Ilsriw39ANpoNbCkxRAfF1 Wtjl/cqG8niW2KQctjbpxCJGRnKcSQhJTWNQLt9Dvfsm4tw57LrD9sYGkDaRBdjvRj9P3LwLC BnC0t3lIKZtjOhbkHc/rmu25SYg5QKZYFz8SHoWHD7LORGYB+WThs+ZBYpdCq/JpeuX3mFNrf r4PCgbUK5MegoLiAS+ikVFsSeysUgAm6hL4fiQpV24af88Yj0Q3gl+/UAmUY7SwhjE44zCpWY wn6SJJSyGaubmQBdbGYfnLJt8hSimgByh22R7EcqyhK1+bQMLwBU8gwGrRYlwkV9T7UL3h1/L cMdhDjje/FEHFWe9DEmTfC+E2B91NYwo93i9gOBsz615LjYwcWCtNof50T4CofiG8OLVV8voE lMZ4Z4k8i39QB7lopfR4ROKC5T6OaL1tapQLXVCf10l/SsmAh18e6hoe/mcI5SqmpavS//YxG xI7w+WQ8WOsYA27j16rUQhNE1QZmfVQeqgwfdRilFFhguCTIvHnpQtSNk0NxdObtBz9nFa9Sp dPFLSrM1usCURSiXa6ubT/APUsRg2T3HKz5xCcUK9jcnH/+X32qQhMGecmy8mvDv/H6MdswTL zn2bl0xqjLxkzxDBqNGpwLDu2ZdHgOhW+zfI/ecjcJzTmK1ZDVkZGNVzcXO5l3B3bB2aJspQB AXmQq5Hr6wsktMS9vuq28llNY7hPixjp7EN/qDIC5//a4uojSdF6SX6JvuAQ9HS68Ty+Li0i2 og2x5tsD8Onr6e0fvUh//Flb/U27wJdm/iVU5uNOGMJlW3XndcU9BlUdPx2TO09a6L2TvcF1A uZGUSGM6j4GGkLpFyXm+xU6YrxJorFTo3tMhliEC8LByKKukmKU0qqpZuu9PZO/c07ZJH2mr5 RScADPJX2VRJ/xnK/EkA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 7, 2020 at 11:12 PM Laurent Pinchart wrote: > On Tue, Jan 07, 2020 at 11:09:13PM +0100, Arnd Bergmann wrote: > > On Tue, Jan 7, 2020 at 11:00 PM Laurent Pinchart wrote: > > > Isn't this something that should be fixed at the compiler level ? > > > > I suspect but have not verified that structleak gcc plugin is partly at > > fault here as well, it has caused similar problems elsewhere. I checked that now, and it's indeed the structleak plugin. Interestingly the problem goes away without the -fconserve-stack option, which is meant to reduce the stack usage bug has the opposite effect here (!). I'll do some more tests tomorrow. > > If you like I can try to dig deeper before that patch gets merged, > > and explain more in the changelog or open a gcc bug if necessary. > > I think we'll need to merge this in the meantime, but if gcc is able to > detect too large frame sizes, I think it should have the ability to take > a frame size limit into account when optimizing. I haven't checked if > this is already possible and just not honoured here (possibly due to a > bug) or if the feature is entirely missing. In any case we'll likely > have to live with this compiler issue for quite some time. When talking to gcc developers about other files that use excessive amounts of stack space, it was pointed out to me that this is a fundamentally hard problem to solve in general: what usually happens is that one optimization step uses a heuristic for inlining, but the register allocator much later runs out of registers and spills them to the stack at a point when it's too late to undo the earlier optimizations. Arnd