Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>,
	intel-xe@lists.freedesktop.org
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	"Thomas Hellström" <thomas.hellstrom@linux.intel.com>,
	dri-devel@lists.freedesktop.org, airlied@gmail.com,
	"Matthew Brost" <matthew.brost@intel.com>,
	"Matthew Auld" <matthew.auld@intel.com>,
	"Christian König" <christian.koenig@amd.com>
Subject: Re: [PATCH 3/3] drm/ttm, drm_xe, Implement ttm_lru_walk_for_evict() using the guarded LRU iteration
Date: Sat, 14 Jun 2025 02:39:38 +0800	[thread overview]
Message-ID: <202506140238.KCnSVmrU-lkp@intel.com> (raw)
In-Reply-To: <20250613151824.178650-4-thomas.hellstrom@linux.intel.com>

Hi Thomas,

kernel test robot noticed the following build warnings:

[auto build test WARNING on drm-xe/drm-xe-next]
[also build test WARNING on linus/master v6.16-rc1 next-20250613]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Thomas-Hellstr-m/drm-ttm-Use-a-struct-for-the-common-part-of-struct-ttm_lru_walk-and-struct-ttm_bo_lru_cursor/20250613-232106
base:   https://gitlab.freedesktop.org/drm/xe/kernel.git drm-xe-next
patch link:    https://lore.kernel.org/r/20250613151824.178650-4-thomas.hellstrom%40linux.intel.com
patch subject: [PATCH 3/3] drm/ttm, drm_xe, Implement ttm_lru_walk_for_evict() using the guarded LRU iteration
config: i386-buildonly-randconfig-005-20250613 (https://download.01.org/0day-ci/archive/20250614/202506140238.KCnSVmrU-lkp@intel.com/config)
compiler: clang version 20.1.2 (https://github.com/llvm/llvm-project 58df0ef89dd64126512e4ee27b4ac3fd8ddf6247)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250614/202506140238.KCnSVmrU-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/202506140238.KCnSVmrU-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/gpu/drm/ttm/ttm_bo_util.c:965:7: warning: variable 'ret' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
     965 |                 if (!bo_locked)
         |                     ^~~~~~~~~~
   drivers/gpu/drm/ttm/ttm_bo_util.c:975:8: note: uninitialized use occurs here
     975 |                 if (!ret && bo->resource && bo->resource->mem_type == mem_type)
         |                      ^~~
   drivers/gpu/drm/ttm/ttm_bo_util.c:965:3: note: remove the 'if' if its condition is always true
     965 |                 if (!bo_locked)
         |                 ^~~~~~~~~~~~~~~
     966 |                         ret = ttm_lru_walk_ticketlock(arg, bo, &curs->needs_unlock);
   drivers/gpu/drm/ttm/ttm_bo_util.c:939:20: note: initialize the variable 'ret' to silence this warning
     939 |                 int mem_type, ret;
         |                                  ^
         |                                   = 0
   1 warning generated.


vim +965 drivers/gpu/drm/ttm/ttm_bo_util.c

   926	
   927	static struct ttm_buffer_object *
   928	__ttm_bo_lru_cursor_next(struct ttm_bo_lru_cursor *curs, bool first)
   929	{
   930		spinlock_t *lru_lock = &curs->res_curs.man->bdev->lru_lock;
   931		struct ttm_resource *res = NULL;
   932		struct ttm_buffer_object *bo;
   933		struct ttm_lru_walk_arg *arg = curs->arg;
   934	
   935		ttm_bo_lru_cursor_cleanup_bo(curs);
   936	
   937		spin_lock(lru_lock);
   938		for (;;) {
   939			int mem_type, ret;
   940			bool bo_locked = false;
   941	
   942			if (first) {
   943				res = ttm_resource_manager_first(&curs->res_curs);
   944				first = false;
   945			} else {
   946				res = ttm_resource_manager_next(&curs->res_curs);
   947			}
   948			if (!res)
   949				break;
   950	
   951			bo = res->bo;
   952			if (ttm_lru_walk_trylock(arg, bo, &curs->needs_unlock))
   953				bo_locked = true;
   954			else if (!arg->ticket || arg->ctx->no_wait_gpu || arg->trylock_only)
   955				continue;
   956	
   957			if (!ttm_bo_get_unless_zero(bo)) {
   958				if (curs->needs_unlock)
   959					dma_resv_unlock(bo->base.resv);
   960				continue;
   961			}
   962	
   963			mem_type = res->mem_type;
   964			spin_unlock(lru_lock);
 > 965			if (!bo_locked)
   966				ret = ttm_lru_walk_ticketlock(arg, bo, &curs->needs_unlock);
   967			/*
   968			 * Note that in between the release of the lru lock and the
   969			 * ticketlock, the bo may have switched resource,
   970			 * and also memory type, since the resource may have been
   971			 * freed and allocated again with a different memory type.
   972			 * In that case, just skip it.
   973			 */
   974			curs->bo = bo;
   975			if (!ret && bo->resource && bo->resource->mem_type == mem_type)
   976				return bo;
   977	
   978			ttm_bo_lru_cursor_cleanup_bo(curs);
   979			if (ret)
   980				return ERR_PTR(ret);
   981	
   982			spin_lock(lru_lock);
   983		}
   984	
   985		spin_unlock(lru_lock);
   986		return res ? bo : NULL;
   987	}
   988	

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

  reply	other threads:[~2025-06-13 18:40 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-13 15:18 [PATCH 0/3] drm/ttm, drm/xe: Consolidate the Buffer Object LRU walks Thomas Hellström
2025-06-13 15:18 ` [PATCH 1/3] drm/ttm: Use a struct for the common part of struct ttm_lru_walk and struct ttm_bo_lru_cursor Thomas Hellström
2025-06-16 13:04   ` Christian König
2025-06-13 15:18 ` [PATCH 2/3] drm/ttm, drm/xe: Modify the struct ttm_bo_lru_walk_cursor initialization Thomas Hellström
2025-06-16 13:15   ` Christian König
2025-06-13 15:18 ` [PATCH 3/3] drm/ttm, drm_xe, Implement ttm_lru_walk_for_evict() using the guarded LRU iteration Thomas Hellström
2025-06-13 18:39   ` kernel test robot [this message]
2025-06-16 13:23   ` Christian König
2025-06-16 15:29     ` Thomas Hellström
2025-06-18 17:43   ` Dan Carpenter
2025-06-13 17:15 ` ✗ CI.checkpatch: warning for drm/ttm, drm/xe: Consolidate the Buffer Object LRU walks Patchwork
2025-06-13 17:16 ` ✓ CI.KUnit: success " Patchwork
2025-06-13 18:19 ` ✓ Xe.CI.BAT: " Patchwork
2025-06-15 14:51 ` ✓ Xe.CI.Full: " Patchwork

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=202506140238.KCnSVmrU-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=airlied@gmail.com \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=llvm@lists.linux.dev \
    --cc=matthew.auld@intel.com \
    --cc=matthew.brost@intel.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=thomas.hellstrom@linux.intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox