All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Dominik Kaszewski <dominik.kaszewski@amd.com>
Cc: oe-kbuild-all@lists.linux.dev,
	Alex Deucher <alexander.deucher@amd.com>,
	Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>,
	Chenyu Chen <chen-yu.chen@amd.com>
Subject: [drm-amdgpu:drm-amdgpu-next 47/114] drivers/gpu/drm/amd/amdgpu/../display/dc/dc_memory_pool.c:87:37: warning: stack frame size (32912) exceeds limit (2048) in 'dc_memory_pool_create'
Date: Wed, 23 Sep 2026 19:17:30 +0200	[thread overview]
Message-ID: <202609231919.tiTCav93-lkp@intel.com> (raw)

tree:   https://gitlab.freedesktop.org/drm/amdgpu/kernel drm-amdgpu-next
head:   cf48bd0a46279f4607956cb17c71bda96ee802e3
commit: 6f74688d7e2377e253671d36acd63a988186216b [47/114] drm/amd/display: Add lock-free memory pool
config: loongarch-allyesconfig (https://download.01.org/0day-ci/archive/20260923/202609231919.tiTCav93-lkp@intel.com/config)
compiler: clang version 22.1.8 (https://github.com/llvm/llvm-project ca7933e47d3a3451d81e72ac174dcb5aa28b59d1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260923/202609231919.tiTCav93-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202609231919.tiTCav93-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/gpu/drm/amd/amdgpu/../display/dc/dc_memory_pool.c:87:37: warning: stack frame size (32912) exceeds limit (2048) in 'dc_memory_pool_create' [-Wframe-larger-than]
      87 | __must_check struct dc_memory_pool *dc_memory_pool_create(size_t size,
         |                                     ^
   1 warning generated.


vim +/dc_memory_pool_create +87 drivers/gpu/drm/amd/amdgpu/../display/dc/dc_memory_pool.c

    86	
  > 87	__must_check struct dc_memory_pool *dc_memory_pool_create(size_t size,
    88								  size_t capacity)
    89	{
    90		if (!size || !capacity)
    91			return NULL;
    92	
    93		// Limited by split between size and generation in index_t
    94		if (capacity >= (uint32_t)-DC_MEMORY_POOL_ENUM_SIZE)
    95			return NULL;
    96	
    97		// uint32_t because that's what alloc functions take
    98		const uint32_t block_pages = (uint32_t)size_in_pages(size);
    99		const uint32_t lines = (uint32_t)capacity * block_pages;
   100		const uint32_t padded_struct_size =
   101			sizeof(struct dc_memory_pool) + PAGE_SIZE;
   102	
   103		void *unaligned_pool = kzalloc(padded_struct_size, GFP_KERNEL);
   104	
   105		if (!unaligned_pool)
   106			return NULL;
   107	
   108		struct dc_memory_pool *pool = page_align_up(unaligned_pool);
   109	
   110		*pool = (struct dc_memory_pool){
   111			.size = size,
   112			.capacity = capacity,
   113			.unaligned_pool = unaligned_pool,
   114			.unaligned_memory = kcalloc(lines + 1, PAGE_SIZE, GFP_KERNEL),
   115			.free_list = kcalloc((uint32_t)capacity, sizeof(atomic_t),
   116					     GFP_KERNEL),
   117			.free_head = ATOMIC_INIT(0),
   118		};
   119		pool->memory = page_align_up(pool->unaligned_memory);
   120	
   121		if (!pool->unaligned_memory || !pool->free_list) {
   122			dc_memory_pool_destroy(pool);
   123			return NULL;
   124		}
   125	
   126		for (int32_t i = 0; i < (int32_t)capacity; i++)
   127			atomic_set_release(&pool->free_list[i], i + 1);
   128	
   129		atomic_set_release(&pool->free_list[capacity - 1],
   130				   DC_MEMORY_POOL_SENTINEL);
   131	
   132		return pool;
   133	}
   134	

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

                 reply	other threads:[~2026-09-23 17:18 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202609231919.tiTCav93-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=alexander.deucher@amd.com \
    --cc=chen-yu.chen@amd.com \
    --cc=dominik.kaszewski@amd.com \
    --cc=nicholas.kazlauskas@amd.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.