[PATCH 1/3] drm/ttm: move swapout logic around v2

kernel test robot lkp at intel.com
Thu Mar 18 15:08:09 UTC 2021


Hi "Christian,

I love your patch! Yet something to improve:

[auto build test ERROR on drm-tip/drm-tip]
[also build test ERROR on next-20210318]
[cannot apply to drm-intel/for-linux-next drm-exynos/exynos-drm-next tegra-drm/drm/tegra/for-next linus/master drm/drm-next v5.12-rc3]
[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-v2/20210318-204848
base:   git://anongit.freedesktop.org/drm/drm-tip drm-tip
config: i386-randconfig-m021-20210318 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
        # https://github.com/0day-ci/linux/commit/a454d56ea061b53d24a62a700743e4508dd6c9b1
        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-v2/20210318-204848
        git checkout a454d56ea061b53d24a62a700743e4508dd6c9b1
        # save the attached .config to linux build tree
        make W=1 ARCH=i386 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp at intel.com>

All errors (new ones prefixed by >>):

>> drivers/gpu/drm/ttm/ttm_device.c:109:5: error: conflicting types for 'ttm_global_swapout'
     109 | int ttm_global_swapout(struct ttm_operation_ctx *ctx, gfp_t gfp_flags)
         |     ^~~~~~~~~~~~~~~~~~
   In file included from drivers/gpu/drm/ttm/ttm_device.c:32:
   include/drm/ttm/ttm_device.h:300:6: note: previous declaration of 'ttm_global_swapout' was here
     300 | long ttm_global_swapout(struct ttm_operation_ctx *ctx, gfp_t gfp_flags);
         |      ^~~~~~~~~~~~~~~~~~
   In file included from include/linux/linkage.h:7,
                    from include/linux/kernel.h:7,
                    from include/asm-generic/bug.h:20,
                    from arch/x86/include/asm/bug.h:93,
                    from include/linux/bug.h:5,
                    from include/linux/mmdebug.h:5,
                    from include/linux/mm.h:9,
                    from drivers/gpu/drm/ttm/ttm_device.c:30:
   drivers/gpu/drm/ttm/ttm_device.c:132:15: error: conflicting types for 'ttm_global_swapout'
     132 | EXPORT_SYMBOL(ttm_global_swapout);
         |               ^~~~~~~~~~~~~~~~~~
   include/linux/export.h:98:21: note: in definition of macro '___EXPORT_SYMBOL'
      98 |  extern typeof(sym) sym;       \
         |                     ^~~
   include/linux/export.h:155:34: note: in expansion of macro '__EXPORT_SYMBOL'
     155 | #define _EXPORT_SYMBOL(sym, sec) __EXPORT_SYMBOL(sym, sec, "")
         |                                  ^~~~~~~~~~~~~~~
   include/linux/export.h:158:29: note: in expansion of macro '_EXPORT_SYMBOL'
     158 | #define EXPORT_SYMBOL(sym)  _EXPORT_SYMBOL(sym, "")
         |                             ^~~~~~~~~~~~~~
   drivers/gpu/drm/ttm/ttm_device.c:132:1: note: in expansion of macro 'EXPORT_SYMBOL'
     132 | EXPORT_SYMBOL(ttm_global_swapout);
         | ^~~~~~~~~~~~~
   In file included from drivers/gpu/drm/ttm/ttm_device.c:32:
   include/drm/ttm/ttm_device.h:300:6: note: previous declaration of 'ttm_global_swapout' was here
     300 | long ttm_global_swapout(struct ttm_operation_ctx *ctx, gfp_t gfp_flags);
         |      ^~~~~~~~~~~~~~~~~~


vim +/ttm_global_swapout +109 drivers/gpu/drm/ttm/ttm_device.c

   104	
   105	/**
   106	 * A buffer object shrink method that tries to swap out the first
   107	 * buffer object on the global::swap_lru list.
   108	 */
 > 109	int ttm_global_swapout(struct ttm_operation_ctx *ctx, gfp_t gfp_flags)
   110	{
   111		struct ttm_global *glob = &ttm_glob;
   112		struct ttm_buffer_object *bo;
   113		unsigned i;
   114		int ret;
   115	
   116		spin_lock(&glob->lru_lock);
   117		for (i = 0; i < TTM_MAX_BO_PRIORITY; ++i) {
   118			list_for_each_entry(bo, &glob->swap_lru[i], swap) {
   119				uint32_t num_pages = bo->ttm->num_pages;
   120	
   121				ret = ttm_bo_swapout(bo, ctx, gfp_flags);
   122				/* ttm_bo_swapout has dropped the lru_lock */
   123				if (!ret)
   124					return num_pages;
   125				if (ret != -EBUSY)
   126					return ret;
   127			}
   128		}
   129		spin_unlock(&glob->lru_lock);
   130		return 0;
   131	}
   132	EXPORT_SYMBOL(ttm_global_swapout);
   133	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 37450 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20210318/f62c88be/attachment-0001.gz>


More information about the dri-devel mailing list