From patchwork Fri May 29 20:15:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 187318 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp910702ilb; Fri, 29 May 2020 13:15:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzL/0IhfThSZjKN8hkK+mhF0gvB0hoSFd0uKvgMAavxFfPN8vh8Qs8ZCMpdfMG72YVEWlt5 X-Received: by 2002:a63:1615:: with SMTP id w21mr9547961pgl.217.1590783357297; Fri, 29 May 2020 13:15:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590783357; cv=none; d=google.com; s=arc-20160816; b=qdR2zpSgc0Ut0D6JAqvyMzoekizMRFBP+y0xsDU9HKAXqzlU/DjDiKL2XxmuxceJp7 wBaa7XADtH5HhgOMimAczboezNoIf74+q0IJslWIOteQ/gVD6OzdzsdB3AjA8qpO1Mzh pm9cPcxl6PqWT38yqS25Xbn6HWk5+ZeiTGtRADbnyDheJPr0v6MWT3iZ99c7wsMChbUQ bPJ9tWBKYZrsDmojxePKJqRbWcG8aOrAAWJdhxkOwPoV5yqAGzc8REXdWDQvQp98YarI mJx7kZMouzh3sW++znyo8Gb9BFLNIudGGPMTbdcTp50owznm6w7mV6nSHffIwTfy1UI3 LbXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:message-id:date:subject:to:from :delivered-to; bh=Cm89V1Pz/51mdihHgFp4HQsaMs+rsHRxTmStxwiw3hg=; b=CQrfmpcK/LJCqZqIKw4+ONdlXfqb4t2PdziV++ig3BtI0g0rCwTqMAYZY7wh1ruxBQ ToIaPwMGbxK1c/aqZjXtopKIAffX6G+JYRGm3ufreik57Wk+/Id9+94bqsGNCgz7CO6b ztitYvkTJ4Vh70zVeL6tD+JyNS6aoZLUYZdSbXzFbkX84bjrKrjK/xDYMEbOwkvhDmqj AFxj1NZnlheUZSOIh2/+0VZn96NHWPSEGTfVaEcAPEDiivZWSnx/b4Ae3zXCNepJLCpH qK2BPHJe7gh7MNwuCIbAeEq25hqw/N4hAjSF9mlA5KnjW0VQwUcOkKMtElasSjCgTnxP xEJw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [2610:10:20:722:a800:ff:fe36:1795]) by mx.google.com with ESMTPS id i14si7826023pgm.278.2020.05.29.13.15.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 May 2020 13:15:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) client-ip=2610:10:20:722:a800:ff:fe36:1795; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4E7A66E96C; Fri, 29 May 2020 20:15:51 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.130]) by gabe.freedesktop.org (Postfix) with ESMTPS id 385F56E969 for ; Fri, 29 May 2020 20:15:48 +0000 (UTC) Received: from threadripper.lan ([149.172.98.151]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.129]) with ESMTPA (Nemesis) id 1MAOa3-1jpzoR1Oqx-00BsNh; Fri, 29 May 2020 22:15:36 +0200 From: Arnd Bergmann To: David Airlie , Daniel Vetter , =?utf-8?q?Christian_K=C3=B6nig?= , Nirmoy Das , Chris Wilson Subject: [PATCH] drm/selftests/mm: reduce per-function stack usage Date: Fri, 29 May 2020 22:15:26 +0200 Message-Id: <20200529201534.474853-1-arnd@arndb.de> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 X-Provags-ID: V03:K1:ho4Mq3U3EtYfgJFR+q7973027xSV2eRELOhe3ml5gCU4m/2NxjG UwhT06TUOtlUo0TML7Hgbve1EF9Pa25ivKXm39twJdLIYZMu9WdiZbOP/XQqo1CGtibwBdv s9wd3LzL6M9uv0/1NLtMw4W/rqPCpYbNfpenFzkGW3EJndjzP76/7MZK43q6dVvNUHo880c A5HmS83cgLYOALPtHFf1w== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1; V03:K0:9vksc22pmvo=:P9XjhkE+Q3JWW5vZh3siuU ezOC3IX4ktHT9kZRx/6s6Hppi7WQWsH9w7QOkliZdzUXhXxic7ZRmNIU2qeiJikarCw2bI8H5 vbKkVQchoJYirSJznL7jWKW9ZARqAEVdBHAr6MDpqku6u838ZyNp52zB7a2IJyePtkDd4CDvE LPHUY24SE6z1OFHQl4OXhXbXAFESWWQl88ZnfhjloIeDG6E39ii/64/VmmmRnf02N6kCqmxd3 RP/7H+wwG5aN2/7YI1Z7dfOKjVIO3FBkv/SoCajVFRvOJGG8yP1tKIfuOIDgdPvjSIGjSlvG3 3ob2my9I3PU0g22tAjMVAagjAGbt1QPUIDP9Hz8LBeaObegCW15UO1LUIP2jbzw10FGhzN9DA ILPtP+o27BwKaRk32/FuD/D7ed+w3HqbXEGy2wOXEcClLKSe1CURWgobJfKzl94mIyMkV4k04 VbUNIGx07Ngg8/An3jz5Q54tijiAPToUuhRQkMMXOLATm7+hvsQs3ZHvfObEb5PpaerqFVjGY nVgRkkfRTWvOlwqbBd49Rri6vSTfbFdmjYh/4LQUwon7Y2e79V4rA3oWaEmpH7TkZoN7tlEEM bMCPfLF42BinIC28wN0x+6ieUqz+uWur2CfhFw5l/EIwEf/vmGJeBdMABEiNobKhq/R/JT+o+ 5UYBClvnphTH2sql5sPfKnrNdMli+7Z/Thp1a1a0CfeeHWS8R8mn10MfyoNk4pJcxJIKtHECk vCupWg2BVpwyfTCys96xRpGqM/DR7h4/9FaOTAWOvnVKHtKnKcYk7PKOsJ1GYOeF7xfBHko+n 1lVLY/kBbRPg/7sGq+/5BqyXn4Q4R2btongqsymuZ52S7+8L3s= X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, kbuild test robot , Arnd Bergmann , Tvrtko Ursulin Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The check_reserve_boundaries() function has a large array on the stack, over 500 bytes. It gets inlined into __igt_reserve, which has multiple other large structures as well but stayed just under the stack size warning limit of 1024 bytes until one more member got added to struct drm_mm_node, causing a warning: drivers/gpu/drm/selftests/test-drm_mm.c:371:12: error: stack frame size of 1032 bytes in function '__igt_reserve' [-Werror,-Wframe-larger-than=] As far as I can tell, this is not nice but will not be called from a context that is already low for the kernel stack, so just annotate the inner function as noinline_for_stack to ensure that each function by itself stays under the warning limit. Fixes: 0cdea4455acd ("drm/mm: optimize rb_hole_addr rbtree search") Signed-off-by: Arnd Bergmann --- drivers/gpu/drm/selftests/test-drm_mm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) -- 2.26.2 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel Reviewed-by: Chris Wilson diff --git a/drivers/gpu/drm/selftests/test-drm_mm.c b/drivers/gpu/drm/selftests/test-drm_mm.c index 9aabe82dcd3a..30108c330db8 100644 --- a/drivers/gpu/drm/selftests/test-drm_mm.c +++ b/drivers/gpu/drm/selftests/test-drm_mm.c @@ -323,9 +323,8 @@ static bool expect_reserve_fail(struct drm_mm *mm, struct drm_mm_node *node) return false; } -static bool check_reserve_boundaries(struct drm_mm *mm, - unsigned int count, - u64 size) +static noinline_for_stack bool +check_reserve_boundaries(struct drm_mm *mm, unsigned int count, u64 size) { const struct boundary { u64 start, size;