Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp4541647rwj; Tue, 20 Dec 2022 11:31:56 -0800 (PST) X-Google-Smtp-Source: AA0mqf7CKY3ier53E386Tjr6TFvR+GLPuQUXoCbPKzoh/GR2eqYiUdipPra2/HTW73UgBOY3jDGy X-Received: by 2002:a05:6a20:1389:b0:aa:806:7b91 with SMTP id w9-20020a056a20138900b000aa08067b91mr71805568pzh.39.1671564715931; Tue, 20 Dec 2022 11:31:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671564715; cv=none; d=google.com; s=arc-20160816; b=bBgc32YoaPRVLegA2mpIHq+qb6Z/qfSNvUb5Isw12Y60PdapoUEw0g3ZHLxLX7BHq/ crOYTKwzgAo4RcrN3p2VIc95Xlbu8vEJHsj2FbD9kv2vuyUwtz3BmjXrX3XQAgc5Bg1P KKPk5HsaVyR4SxRNXIixXUT3QjC43i1YOFDMhXtiC9T+CI2C8IyUUrsS1hUBBjOW9+Xt f2BXHUInHrA4HR/qvpUlVn/g9/ThF0okF2O/ft1U00GXYF3PnNBWWF5yYPT7+WwToTnb dt3nlHpNiIzM3Xzh6a30DFB3o9q1dq+EGZEPefuFptMfCcQhjAfJ7jTAwO15wO0BTK6D kr2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=cjwugnyOcfkc5U5fWcTHxiaxFg7f7rBtDIM03J92Ct0=; b=Pf0VIc3NE9ZycYfWwy+OAMslYIhJ2mH7alnJU9HuVGw7cG/6cuySE/4EQMkoT5jOSD /jy/2O9o4wluCNCivqYyslsWie+BghXfqX9Owzh7ciGAFFSH1tBMZFO7Xiok7FIDDwe/ buhsiCcM8Aeta1n9zwwfU+9yMxfdDXHI6UX5MALLtATuv1l630FO7fzFPIQe/QTysIz7 B19es475237m3uRM2ScBU7zHhBbvRJImvhYWUBMbykxUK3JJ65uJ0k0/B9rUsPvVPRta HJIK98dmpeqrQyIXAtCjwB5Efmp/8nAesk5GjHN1rzdeotgRE5nKQpnvK0kY/1CFVAxB bMBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b=SnBtcTV7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m20-20020a635814000000b0048219b9cbbasi14696526pgb.144.2022.12.20.11.31.46; Tue, 20 Dec 2022 11:31:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b=SnBtcTV7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233992AbiLTT20 (ORCPT + 69 others); Tue, 20 Dec 2022 14:28:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54410 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229724AbiLTT2Y (ORCPT ); Tue, 20 Dec 2022 14:28:24 -0500 Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6072115A12 for ; Tue, 20 Dec 2022 11:28:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender: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=cjwugnyOcfkc5U5fWcTHxiaxFg7f7rBtDIM03J92Ct0=; b=SnBtcTV75E1lEfSyHuKfTiMV5H dMwnXrYDrExtJHABsJMQgpNI2DqpYMI2olV+z/urHHiT3C1ZtDTjema5OKq06/N2qkYkJLeGLXm5g l/sXtbaeIeXm/nkVlgAvu5iKq1Ezgz2HN6J7/KVvMIxvdoKVAoNQvTUhHDArZlKD+TWir5KTQmXZt lv6BvBQmi0J1H8eVp405HYKR1f+Nz4V8AIa93X0BnmS574dZAfJi0Utos3uUnHohfmQWwIdbwQa5H VRl4zrt8JzJmyCGTWn5XSMppc2YXzL2G0YBy7AdGCsLA+/NiNo0K/NgvNAS9Z6gseI/xYA0jGHyGw t+3dXwgw==; Received: from [177.34.169.227] (helo=[192.168.0.8]) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_128_GCM:128) (Exim) id 1p7iHI-007609-Ub; Tue, 20 Dec 2022 20:27:53 +0100 Message-ID: <9c9d97a9-7543-06ed-f50b-f48b1c3a9def@igalia.com> Date: Tue, 20 Dec 2022 16:27:43 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Subject: Re: [PATCH] drm/tests: reduce drm_mm_test stack usage To: Arnd Bergmann , David Airlie , Daniel Vetter Cc: Arnd Bergmann , Tom Rix , Daniel Latypov , llvm@lists.linux.dev, Nick Desaulniers , Javier Martinez Canillas , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Nathan Chancellor , =?UTF-8?Q?Ma=c3=adra_Canal?= References: <20221215163511.266214-1-arnd@kernel.org> Content-Language: en-US From: =?UTF-8?Q?Ma=c3=adra_Canal?= In-Reply-To: <20221215163511.266214-1-arnd@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/15/22 13:34, Arnd Bergmann wrote: > From: Arnd Bergmann > > The check_reserve_boundaries function uses a lot of kernel stack, > and it gets inlined by clang, which makes __drm_test_mm_reserve > use even more of it, to the point of hitting the warning limit: > > drivers/gpu/drm/tests/drm_mm_test.c:344:12: error: stack frame size (1048) exceeds limit (1024) in '__drm_test_mm_reserve' [-Werror,-Wframe-larger-than] > > When building with gcc, this does not happen, but the structleak > plugin can similarly increase the stack usage and needs to be > disabled, as we do for all other kunit users. > > Signed-off-by: Arnd Bergmann Apart from the checkpatch problem on the function check_reserve_boundaries(), Reviewed-by: Maíra Canal Best Regards, - Maíra Canal > --- > drivers/gpu/drm/tests/Makefile | 2 ++ > drivers/gpu/drm/tests/drm_mm_test.c | 2 +- > 2 files changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/tests/Makefile b/drivers/gpu/drm/tests/Makefile > index b29ef1085cad..f896ef85c2f2 100644 > --- a/drivers/gpu/drm/tests/Makefile > +++ b/drivers/gpu/drm/tests/Makefile > @@ -12,3 +12,5 @@ obj-$(CONFIG_DRM_KUNIT_TEST) += \ > drm_mm_test.o \ > drm_plane_helper_test.o \ > drm_rect_test.o > + > +CFLAGS_drm_mm_test.o := $(DISABLE_STRUCTLEAK_PLUGIN) > diff --git a/drivers/gpu/drm/tests/drm_mm_test.c b/drivers/gpu/drm/tests/drm_mm_test.c > index 89f12d3b4a21..90a5becc99b8 100644 > --- a/drivers/gpu/drm/tests/drm_mm_test.c > +++ b/drivers/gpu/drm/tests/drm_mm_test.c > @@ -298,7 +298,7 @@ static bool expect_reserve_fail(struct kunit *test, struct drm_mm *mm, struct dr > return false; > } > > -static bool check_reserve_boundaries(struct kunit *test, struct drm_mm *mm, > +static bool noinline_for_stack check_reserve_boundaries(struct kunit *test, struct drm_mm *mm, > unsigned int count, > u64 size) > {