Re: [PATCH v8 6/8] drm/i915/ttm: move shrinker management into adjust_lru

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Matthew,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on drm-tip/drm-tip]
[also build test WARNING on next-20211012]
[cannot apply to drm-intel/for-linux-next drm-exynos/exynos-drm-next tegra-drm/drm/tegra/for-next airlied/drm-next v5.15-rc5]
[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]

url:    https://github.com/0day-ci/linux/commits/Matthew-Auld/drm-i915-gem-Break-out-some-shmem-backend-utils/20211011-230443
base:   git://anongit.freedesktop.org/drm/drm-tip drm-tip
config: i386-randconfig-c001-20211012 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project c3dcf39554dbea780d6cb7e12239451ba47a2668)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/43578548b98c603bc1bd2840b3e50bfde8bf0772
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Matthew-Auld/drm-i915-gem-Break-out-some-shmem-backend-utils/20211011-230443
        git checkout 43578548b98c603bc1bd2840b3e50bfde8bf0772
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=i386 clang-analyzer

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>


clang-analyzer warnings: (new ones prefixed by >>)

>> drivers/gpu/drm/i915/gem/i915_gem_ttm.c:865:23: warning: Value stored to 'i915_tt' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
                   struct i915_ttm_tt *i915_tt =
                                       ^~~~~~~

vim +/i915_tt +865 drivers/gpu/drm/i915/gem/i915_gem_ttm.c

213d5092776345a Thomas Hellström 2021-06-10  819
b6e913e19c54edd Thomas Hellström 2021-06-29  820  static int __i915_ttm_get_pages(struct drm_i915_gem_object *obj,
b6e913e19c54edd Thomas Hellström 2021-06-29  821  				struct ttm_placement *placement)
213d5092776345a Thomas Hellström 2021-06-10  822  {
213d5092776345a Thomas Hellström 2021-06-10  823  	struct ttm_buffer_object *bo = i915_gem_to_ttm(obj);
213d5092776345a Thomas Hellström 2021-06-10  824  	struct ttm_operation_ctx ctx = {
213d5092776345a Thomas Hellström 2021-06-10  825  		.interruptible = true,
213d5092776345a Thomas Hellström 2021-06-10  826  		.no_wait_gpu = false,
213d5092776345a Thomas Hellström 2021-06-10  827  	};
213d5092776345a Thomas Hellström 2021-06-10  828  	struct sg_table *st;
b07a6483839a838 Thomas Hellström 2021-06-18  829  	int real_num_busy;
213d5092776345a Thomas Hellström 2021-06-10  830  	int ret;
213d5092776345a Thomas Hellström 2021-06-10  831
b07a6483839a838 Thomas Hellström 2021-06-18  832  	/* First try only the requested placement. No eviction. */
b6e913e19c54edd Thomas Hellström 2021-06-29  833  	real_num_busy = fetch_and_zero(&placement->num_busy_placement);
b6e913e19c54edd Thomas Hellström 2021-06-29  834  	ret = ttm_bo_validate(bo, placement, &ctx);
b07a6483839a838 Thomas Hellström 2021-06-18  835  	if (ret) {
b07a6483839a838 Thomas Hellström 2021-06-18  836  		ret = i915_ttm_err_to_gem(ret);
b07a6483839a838 Thomas Hellström 2021-06-18  837  		/*
b07a6483839a838 Thomas Hellström 2021-06-18  838  		 * Anything that wants to restart the operation gets to
b07a6483839a838 Thomas Hellström 2021-06-18  839  		 * do that.
b07a6483839a838 Thomas Hellström 2021-06-18  840  		 */
b07a6483839a838 Thomas Hellström 2021-06-18  841  		if (ret == -EDEADLK || ret == -EINTR || ret == -ERESTARTSYS ||
b07a6483839a838 Thomas Hellström 2021-06-18  842  		    ret == -EAGAIN)
b07a6483839a838 Thomas Hellström 2021-06-18  843  			return ret;
b07a6483839a838 Thomas Hellström 2021-06-18  844
b07a6483839a838 Thomas Hellström 2021-06-18  845  		/*
b07a6483839a838 Thomas Hellström 2021-06-18  846  		 * If the initial attempt fails, allow all accepted placements,
b07a6483839a838 Thomas Hellström 2021-06-18  847  		 * evicting if necessary.
b07a6483839a838 Thomas Hellström 2021-06-18  848  		 */
b6e913e19c54edd Thomas Hellström 2021-06-29  849  		placement->num_busy_placement = real_num_busy;
b6e913e19c54edd Thomas Hellström 2021-06-29  850  		ret = ttm_bo_validate(bo, placement, &ctx);
213d5092776345a Thomas Hellström 2021-06-10  851  		if (ret)
b07a6483839a838 Thomas Hellström 2021-06-18  852  			return i915_ttm_err_to_gem(ret);
b07a6483839a838 Thomas Hellström 2021-06-18  853  	}
213d5092776345a Thomas Hellström 2021-06-10  854
3c2b8f326e7f73d Thomas Hellström 2021-06-24  855  	if (bo->ttm && !ttm_tt_is_populated(bo->ttm)) {
3c2b8f326e7f73d Thomas Hellström 2021-06-24  856  		ret = ttm_tt_populate(bo->bdev, bo->ttm, &ctx);
3c2b8f326e7f73d Thomas Hellström 2021-06-24  857  		if (ret)
3c2b8f326e7f73d Thomas Hellström 2021-06-24  858  			return ret;
3c2b8f326e7f73d Thomas Hellström 2021-06-24  859
3c2b8f326e7f73d Thomas Hellström 2021-06-24  860  		i915_ttm_adjust_domains_after_move(obj);
3c2b8f326e7f73d Thomas Hellström 2021-06-24  861  		i915_ttm_adjust_gem_after_move(obj);
3c2b8f326e7f73d Thomas Hellström 2021-06-24  862  	}
3c2b8f326e7f73d Thomas Hellström 2021-06-24  863
75e382850b7ea51 Jason Ekstrand   2021-07-23  864  	if (!i915_gem_object_has_pages(obj)) {
3ffdf7a46488d57 Matthew Auld     2021-10-11 @865  		struct i915_ttm_tt *i915_tt =
3ffdf7a46488d57 Matthew Auld     2021-10-11  866  			container_of(bo->ttm, typeof(*i915_tt), ttm);
3ffdf7a46488d57 Matthew Auld     2021-10-11  867
213d5092776345a Thomas Hellström 2021-06-10  868  		/* Object either has a page vector or is an iomem object */
213d5092776345a Thomas Hellström 2021-06-10  869  		st = bo->ttm ? i915_ttm_tt_get_st(bo->ttm) : obj->ttm.cached_io_st;
213d5092776345a Thomas Hellström 2021-06-10  870  		if (IS_ERR(st))
213d5092776345a Thomas Hellström 2021-06-10  871  			return PTR_ERR(st);
213d5092776345a Thomas Hellström 2021-06-10  872
213d5092776345a Thomas Hellström 2021-06-10  873  		__i915_gem_object_set_pages(obj, st, i915_sg_dma_sizes(st->sgl));
75e382850b7ea51 Jason Ekstrand   2021-07-23  874  	}
213d5092776345a Thomas Hellström 2021-06-10  875
43578548b98c603 Matthew Auld     2021-10-11  876  	i915_ttm_adjust_lru(obj);
213d5092776345a Thomas Hellström 2021-06-10  877  	return ret;
213d5092776345a Thomas Hellström 2021-06-10  878  }
213d5092776345a Thomas Hellström 2021-06-10  879

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux