Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1041307pxb; Tue, 14 Sep 2021 14:57:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyqW/q/T8zFUS5NQqS3HK+YzleOd06QPzmLhg6yvGpbxUAyeMOJq2VaGkzKvN+i65GSH3Wb X-Received: by 2002:a02:2507:: with SMTP id g7mr16131437jag.139.1631656647594; Tue, 14 Sep 2021 14:57:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631656647; cv=none; d=google.com; s=arc-20160816; b=n0+0aRNXggBmpAlzvzZTDsBdpNuYT2EVhwAWpqrJ2U+THUnFcIiY6jUXs7e5Rr3UXM oULmBNfadzwGRQyJb30Utsw+WJ5R6HyPyJZjykw3SmOCbtPyGTCqGplqfS/GcoJt+GmV TjXsnNlnfc7B1v+P9stF6bv7IuYwV+EAUI6dcNATelfTbBMsxYcB4/YlvStZ51wq2JiY OGViWvIM+PS3PE4gfP3u4O64i5nzqYqqGceR3nG4mD0g66EZRgB5luKExZUpV5LnaLes SFWdKswgGR0b4s5eghjx81j2QBFCxjKdioQ8pSxfGKbcA5zmOvhV0p1VtKBiepTrHT9J 2X5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=Ll67rbRc4gUJ+9O6OdSRmSgY9jfPA8IAo6JjA+x1hKU=; b=QgX7/ILD6SAEY+DC8hlAYEWEj3d/DsgM9SQTlc6nlUlqVZYPFeLH6tPDCAXGPfRYi9 O+Ux+9FSntN0qh3gmH5egoGbehZkrw8/0QQYyhf8NLDRq30B0gkooxMMNiigHs8IVd6M qkNuZrhqhVmUjl+nUR0RCmpfgJhNhLj6LwUusIQVuRjq7v71M8GCqv4t+fsYqI4Exog2 Q+dlsZMETgGg4U40yk8FSj5kVHez26wjo0BqEyj+g6bO72ehkD0/nSnVasRlESSZ6rrB fV6g7CanY3ovWia4sX+XuZ4vV+MSASAycR6nUT4yTE7MkOhvrCm4O//VpPvu2d2/lBy3 +i2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Udg92vXY; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o20si13373283iov.71.2021.09.14.14.57.16; Tue, 14 Sep 2021 14:57:27 -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=pass header.i=@kernel.org header.s=k20201202 header.b=Udg92vXY; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232533AbhINV5t (ORCPT + 99 others); Tue, 14 Sep 2021 17:57:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:48726 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232332AbhINV5q (ORCPT ); Tue, 14 Sep 2021 17:57:46 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A5AEF6121E for ; Tue, 14 Sep 2021 21:56:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631656588; bh=Ll67rbRc4gUJ+9O6OdSRmSgY9jfPA8IAo6JjA+x1hKU=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=Udg92vXYImQdyjpQl+ASXx87nMDQoj2aOOHovGwilHCR+klPFzIhRcEeFsGQXmfUt xpdhwREuaTG2c15927DSgbzrValOG471FoHq6NaYXbkbT6TrP+lLXNMGCqtNEy7+xp NOIu4AGcWgrdEzEp2dRut4gVfP/nFzIIyWW+hPncI9AWEGZ1OgLt0oV8WIFnfpkCuz I0djqguPVpltb8MdQWCFYuXN5/RY+Kwn2OtgFLw1RNBB9V/n3Kyafkdh9mrRUVZjIb IP/R3j+anRGh1ql3vIqGSX/KwXD2NHEeTASgPPQc3ix2iY2FmlcOS37kWa8VXjPcdx mQ1DyoNaymn3Q== Received: by mail-wr1-f43.google.com with SMTP id t18so642891wrb.0 for ; Tue, 14 Sep 2021 14:56:28 -0700 (PDT) X-Gm-Message-State: AOAM531yI15RgSZWEEdQYxaDysBi152H8khKVoJe3eUoiBgnsV70afIS YHLxOc3dRRH0OPlBAVSsopyRu9Bbn40q57EOZkQ= X-Received: by 2002:a5d:528b:: with SMTP id c11mr1274072wrv.369.1631656587222; Tue, 14 Sep 2021 14:56:27 -0700 (PDT) MIME-Version: 1.0 References: <20210914210508.10627-1-harry.wentland@amd.com> In-Reply-To: <20210914210508.10627-1-harry.wentland@amd.com> From: Arnd Bergmann Date: Tue, 14 Sep 2021 23:56:11 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] drm/amd/display: Reduce stack size for dml21_ModeSupportAndSystemConfigurationFull To: Harry Wentland Cc: amd-gfx list , Nick Desaulniers , Linus Torvalds , Linux Kernel Mailing List , Leo Li , Alex Deucher , =?UTF-8?Q?Christian_K=C3=B6nig?= , xinhui pan , Nathan Chancellor , Guenter Roeck , llvm@lists.linux.dev Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 14, 2021 at 11:05 PM Harry Wentland wrote: > > [Why & How] > With Werror enabled in the kernel we were failing the clang build since > dml21_ModeSupportAndSystemConfigurationFull's stack frame is 1064 when > building with clang, and exceeding the default 1024 stack frame limit. > > The culprit seems to be the Pipe struct, so pull the relevant block > out into its own sub-function. I suspect it's not the Pipe struct but rather the way that you call another function with a crazy number of arguments here. After your change, this likely gets inlined and you avoid the problem, so the patch ends up doing the right thing. If you do more patches like this, I would suggest mentioning the new stack usage of the calling function and the new noinline function, to make sure that the combined number isn't actually worse than the old number. You can get these numbers by recompiling the file with the frame size warning set to a low value, e.g. adding -Wframe-larger-than=100 to the command line. Acked-by: Arnd Bergmann