Re: [PATCH 2/3] drm/ttm: remove swap LRU

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

 



Hi "Christian,

I love your patch! Perhaps something to improve:

[auto build test WARNING on drm-tip/drm-tip]
[cannot apply to drm-intel/for-linux-next tegra-drm/drm/tegra/for-next linus/master drm-exynos/exynos-drm-next drm/drm-next v5.11-rc7 next-20210125]
[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/Christian-K-nig/drm-ttm-move-swapout-logic-around/20210210-232812
base:   git://anongit.freedesktop.org/drm/drm-tip drm-tip
config: x86_64-randconfig-s021-20210209 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.3-215-g0fb77bb6-dirty
        # https://github.com/0day-ci/linux/commit/d37e3072dc32c7f8466e8b9983bb3667e733fd61
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Christian-K-nig/drm-ttm-move-swapout-logic-around/20210210-232812
        git checkout d37e3072dc32c7f8466e8b9983bb3667e733fd61
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=x86_64 

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


"sparse warnings: (new ones prefixed by >>)"
   drivers/gpu/drm/ttm/ttm_device.c:42:1: sparse: sparse: symbol 'ttm_global_mutex' was not declared. Should it be static?
   drivers/gpu/drm/ttm/ttm_device.c:43:10: sparse: sparse: symbol 'ttm_glob_use_count' was not declared. Should it be static?
>> drivers/gpu/drm/ttm/ttm_device.c:125:6: sparse: sparse: context imbalance in 'ttm_device_swapout' - wrong count at exit

vim +/ttm_device_swapout +125 drivers/gpu/drm/ttm/ttm_device.c

d37e3072dc32c7 Christian König 2021-02-10  124  
d37e3072dc32c7 Christian König 2021-02-10 @125  long ttm_device_swapout(struct ttm_device *bdev, struct ttm_operation_ctx *ctx,
d37e3072dc32c7 Christian König 2021-02-10  126  			gfp_t gfp_flags)
d37e3072dc32c7 Christian König 2021-02-10  127  {
d37e3072dc32c7 Christian König 2021-02-10  128  	struct ttm_global *glob = &ttm_glob;
d37e3072dc32c7 Christian König 2021-02-10  129  	struct ttm_resource_manager *man;
22b09b650f7486 Christian König 2021-02-10  130  	struct ttm_buffer_object *bo;
d37e3072dc32c7 Christian König 2021-02-10  131  	unsigned i, j;
22b09b650f7486 Christian König 2021-02-10  132  	int ret;
22b09b650f7486 Christian König 2021-02-10  133  
22b09b650f7486 Christian König 2021-02-10  134  	spin_lock(&glob->lru_lock);
d37e3072dc32c7 Christian König 2021-02-10  135  	for (i = TTM_PL_SYSTEM; i < TTM_NUM_MEM_TYPES; ++i) {
d37e3072dc32c7 Christian König 2021-02-10  136  		man = ttm_manager_type(bdev, i);
d37e3072dc32c7 Christian König 2021-02-10  137  		if (!man || !man->use_tt)
d37e3072dc32c7 Christian König 2021-02-10  138  			continue;
d37e3072dc32c7 Christian König 2021-02-10  139  
d37e3072dc32c7 Christian König 2021-02-10  140  		for (j = 0; j < TTM_MAX_BO_PRIORITY; ++j) {
d37e3072dc32c7 Christian König 2021-02-10  141  			list_for_each_entry(bo, &man->lru[j], lru) {
d37e3072dc32c7 Christian König 2021-02-10  142  				long num_pages = bo->ttm->num_pages;
d37e3072dc32c7 Christian König 2021-02-10  143  
d37e3072dc32c7 Christian König 2021-02-10  144  				if (!bo->ttm ||
d37e3072dc32c7 Christian König 2021-02-10  145  				    bo->ttm->page_flags & TTM_PAGE_FLAG_SG ||
d37e3072dc32c7 Christian König 2021-02-10  146  				    bo->ttm->page_flags & TTM_PAGE_FLAG_SWAPPED)
d37e3072dc32c7 Christian König 2021-02-10  147  					continue;
22b09b650f7486 Christian König 2021-02-10  148  
22b09b650f7486 Christian König 2021-02-10  149  				ret = ttm_bo_swapout(bo, ctx, gfp_flags);
22b09b650f7486 Christian König 2021-02-10  150  				/* ttm_bo_swapout has dropped the lru_lock */
22b09b650f7486 Christian König 2021-02-10  151  				if (!ret)
22b09b650f7486 Christian König 2021-02-10  152  					return num_pages;
22b09b650f7486 Christian König 2021-02-10  153  				if (ret != -EBUSY)
22b09b650f7486 Christian König 2021-02-10  154  					return ret;
22b09b650f7486 Christian König 2021-02-10  155  			}
22b09b650f7486 Christian König 2021-02-10  156  		}
d37e3072dc32c7 Christian König 2021-02-10  157  	}
22b09b650f7486 Christian König 2021-02-10  158  	spin_unlock(&glob->lru_lock);
22b09b650f7486 Christian König 2021-02-10  159  	return 0;
22b09b650f7486 Christian König 2021-02-10  160  }
d37e3072dc32c7 Christian König 2021-02-10  161  EXPORT_SYMBOL(ttm_device_swapout);
22b09b650f7486 Christian König 2021-02-10  162  

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

Attachment: .config.gz
Description: application/gzip

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[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