Skip to content

Commit 523dfa9

Browse files
arndbmairacanal
authored andcommitted
drm/tests: reduce drm_mm_test stack usage
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 <[email protected]> Reviewed-by: Maíra Canal <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]> Signed-off-by: Maíra Canal <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent b02897e commit 523dfa9

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

drivers/gpu/drm/tests/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,5 @@ obj-$(CONFIG_DRM_KUNIT_TEST) += \
1212
drm_mm_test.o \
1313
drm_plane_helper_test.o \
1414
drm_rect_test.o
15+
16+
CFLAGS_drm_mm_test.o := $(DISABLE_STRUCTLEAK_PLUGIN)

drivers/gpu/drm/tests/drm_mm_test.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -298,9 +298,9 @@ static bool expect_reserve_fail(struct kunit *test, struct drm_mm *mm, struct dr
298298
return false;
299299
}
300300

301-
static bool check_reserve_boundaries(struct kunit *test, struct drm_mm *mm,
302-
unsigned int count,
303-
u64 size)
301+
static bool noinline_for_stack check_reserve_boundaries(struct kunit *test, struct drm_mm *mm,
302+
unsigned int count,
303+
u64 size)
304304
{
305305
const struct boundary {
306306
u64 start, size;

0 commit comments

Comments
 (0)