virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH v11 05/10] drm/shmem-helper: Add memory shrinker
       [not found] <20230227060219.904986-6-dmitry.osipenko@collabora.com>
@ 2023-02-27  8:25 ` kernel test robot
  2023-02-27  8:56 ` kernel test robot
  1 sibling, 0 replies; 2+ messages in thread
From: kernel test robot @ 2023-02-27  8:25 UTC (permalink / raw)
  To: Dmitry Osipenko, David Airlie, Gerd Hoffmann, Gurchetan Singh,
	Chia-I Wu, Daniel Vetter, Daniel Almeida, Gustavo Padovan,
	Daniel Stone, Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	Sumit Semwal, Christian König, Qiang Yu, Steven Price,
	Alyssa Rosenzweig, Rob Herring
  Cc: llvm, linux-kernel, dri-devel, virtualization, oe-kbuild-all,
	kernel

Hi Dmitry,

I love your patch! Yet something to improve:

[auto build test ERROR on drm-misc/drm-misc-next]
[cannot apply to drm/drm-next drm-intel/for-linux-next drm-intel/for-linux-next-fixes drm-tip/drm-tip linus/master v6.2 next-20230227]
[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/Dmitry-Osipenko/drm-shmem-helper-Factor-out-pages-alloc-release-from-drm_gem_shmem_get-put_pages/20230227-140619
base:   git://anongit.freedesktop.org/drm/drm-misc drm-misc-next
patch link:    https://lore.kernel.org/r/20230227060219.904986-6-dmitry.osipenko%40collabora.com
patch subject: [PATCH v11 05/10] drm/shmem-helper: Add memory shrinker
config: riscv-randconfig-r006-20230227 (https://download.01.org/0day-ci/archive/20230227/202302271624.aEDOT0UV-lkp@intel.com/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project db89896bbbd2251fff457699635acbbedeead27f)
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
        # install riscv cross compiling tool for clang build
        # apt-get install binutils-riscv64-linux-gnu
        # https://github.com/intel-lab-lkp/linux/commit/c4d106484ddbebccf4219dacbc2a9975909f4c2a
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Dmitry-Osipenko/drm-shmem-helper-Factor-out-pages-alloc-release-from-drm_gem_shmem_get-put_pages/20230227-140619
        git checkout c4d106484ddbebccf4219dacbc2a9975909f4c2a
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=riscv olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=riscv SHELL=/bin/bash drivers/gpu/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202302271624.aEDOT0UV-lkp@intel.com/

All errors (new ones prefixed by >>):

   drivers/gpu/drm/drm_gem_shmem_helper.c:832:18: warning: no previous prototype for function 'drm_gem_shmem_get_pages_sgt_locked' [-Wmissing-prototypes]
   struct sg_table *drm_gem_shmem_get_pages_sgt_locked(struct drm_gem_shmem_object *shmem)
                    ^
   drivers/gpu/drm/drm_gem_shmem_helper.c:832:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   struct sg_table *drm_gem_shmem_get_pages_sgt_locked(struct drm_gem_shmem_object *shmem)
   ^
   static 
>> drivers/gpu/drm/drm_gem_shmem_helper.c:1016:7: error: too many arguments to function call, expected 3, have 4
                                     drm_gem_shmem_shrinker_purge);
                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/drm/drm_gem.h:489:15: note: 'drm_gem_lru_scan' declared here
   unsigned long drm_gem_lru_scan(struct drm_gem_lru *lru, unsigned nr_to_scan,
                 ^
   drivers/gpu/drm/drm_gem_shmem_helper.c:1022:8: error: too many arguments to function call, expected 3, have 4
                                             drm_gem_shmem_shrinker_evict);
                                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/drm/drm_gem.h:489:15: note: 'drm_gem_lru_scan' declared here
   unsigned long drm_gem_lru_scan(struct drm_gem_lru *lru, unsigned nr_to_scan,
                 ^
   1 warning and 2 errors generated.


vim +1016 drivers/gpu/drm/drm_gem_shmem_helper.c

  1001	
  1002	static unsigned long
  1003	drm_gem_shmem_shrinker_scan_objects(struct shrinker *shrinker,
  1004					    struct shrink_control *sc)
  1005	{
  1006		struct drm_gem_shmem_shrinker *shmem_shrinker;
  1007		unsigned long nr_to_scan = sc->nr_to_scan;
  1008		unsigned long remaining = 0;
  1009		unsigned long freed = 0;
  1010	
  1011		shmem_shrinker = to_drm_gem_shmem_shrinker(shrinker);
  1012	
  1013		/* purge as many objects as we can */
  1014		freed += drm_gem_lru_scan(&shmem_shrinker->lru_evictable,
  1015					  nr_to_scan, &remaining,
> 1016					  drm_gem_shmem_shrinker_purge);
  1017	
  1018		/* evict as many objects as we can */
  1019		if (freed < nr_to_scan)
  1020			freed += drm_gem_lru_scan(&shmem_shrinker->lru_evictable,
  1021						  nr_to_scan - freed, &remaining,
  1022						  drm_gem_shmem_shrinker_evict);
  1023	
  1024		return (freed > 0 && remaining > 0) ? freed : SHRINK_STOP;
  1025	}
  1026	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v11 05/10] drm/shmem-helper: Add memory shrinker
       [not found] <20230227060219.904986-6-dmitry.osipenko@collabora.com>
  2023-02-27  8:25 ` [PATCH v11 05/10] drm/shmem-helper: Add memory shrinker kernel test robot
@ 2023-02-27  8:56 ` kernel test robot
  1 sibling, 0 replies; 2+ messages in thread
From: kernel test robot @ 2023-02-27  8:56 UTC (permalink / raw)
  To: Dmitry Osipenko, David Airlie, Gerd Hoffmann, Gurchetan Singh,
	Chia-I Wu, Daniel Vetter, Daniel Almeida, Gustavo Padovan,
	Daniel Stone, Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	Sumit Semwal, Christian König, Qiang Yu, Steven Price,
	Alyssa Rosenzweig, Rob Herring
  Cc: kernel, virtualization, linux-kernel, dri-devel, oe-kbuild-all

Hi Dmitry,

I love your patch! Perhaps something to improve:

[auto build test WARNING on drm-misc/drm-misc-next]
[cannot apply to drm/drm-next drm-intel/for-linux-next drm-intel/for-linux-next-fixes drm-tip/drm-tip linus/master v6.2 next-20230227]
[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/Dmitry-Osipenko/drm-shmem-helper-Factor-out-pages-alloc-release-from-drm_gem_shmem_get-put_pages/20230227-140619
base:   git://anongit.freedesktop.org/drm/drm-misc drm-misc-next
patch link:    https://lore.kernel.org/r/20230227060219.904986-6-dmitry.osipenko%40collabora.com
patch subject: [PATCH v11 05/10] drm/shmem-helper: Add memory shrinker
config: s390-allyesconfig (https://download.01.org/0day-ci/archive/20230227/202302271639.sq28B3aR-lkp@intel.com/config)
compiler: s390-linux-gcc (GCC) 12.1.0
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/intel-lab-lkp/linux/commit/c4d106484ddbebccf4219dacbc2a9975909f4c2a
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Dmitry-Osipenko/drm-shmem-helper-Factor-out-pages-alloc-release-from-drm_gem_shmem_get-put_pages/20230227-140619
        git checkout c4d106484ddbebccf4219dacbc2a9975909f4c2a
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=s390 olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=s390 SHELL=/bin/bash drivers/gpu/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202302271639.sq28B3aR-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/gpu/drm/drm_gem_shmem_helper.c:832:18: warning: no previous prototype for 'drm_gem_shmem_get_pages_sgt_locked' [-Wmissing-prototypes]
     832 | struct sg_table *drm_gem_shmem_get_pages_sgt_locked(struct drm_gem_shmem_object *shmem)
         |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/drm_gem_shmem_helper.c: In function 'drm_gem_shmem_shrinker_scan_objects':
   drivers/gpu/drm/drm_gem_shmem_helper.c:1015:47: error: passing argument 3 of 'drm_gem_lru_scan' from incompatible pointer type [-Werror=incompatible-pointer-types]
    1015 |                                   nr_to_scan, &remaining,
         |                                               ^~~~~~~~~~
         |                                               |
         |                                               long unsigned int *
   In file included from include/drm/drm_gem_shmem_helper.h:12,
                    from drivers/gpu/drm/drm_gem_shmem_helper.c:22:
   include/drm/drm_gem.h:490:39: note: expected 'bool (*)(struct drm_gem_object *)' {aka '_Bool (*)(struct drm_gem_object *)'} but argument is of type 'long unsigned int *'
     490 |                                bool (*shrink)(struct drm_gem_object *obj));
         |                                ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/drm_gem_shmem_helper.c:1014:18: error: too many arguments to function 'drm_gem_lru_scan'
    1014 |         freed += drm_gem_lru_scan(&shmem_shrinker->lru_evictable,
         |                  ^~~~~~~~~~~~~~~~
   include/drm/drm_gem.h:489:15: note: declared here
     489 | unsigned long drm_gem_lru_scan(struct drm_gem_lru *lru, unsigned nr_to_scan,
         |               ^~~~~~~~~~~~~~~~
   drivers/gpu/drm/drm_gem_shmem_helper.c:1021:63: error: passing argument 3 of 'drm_gem_lru_scan' from incompatible pointer type [-Werror=incompatible-pointer-types]
    1021 |                                           nr_to_scan - freed, &remaining,
         |                                                               ^~~~~~~~~~
         |                                                               |
         |                                                               long unsigned int *
   include/drm/drm_gem.h:490:39: note: expected 'bool (*)(struct drm_gem_object *)' {aka '_Bool (*)(struct drm_gem_object *)'} but argument is of type 'long unsigned int *'
     490 |                                bool (*shrink)(struct drm_gem_object *obj));
         |                                ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/drm_gem_shmem_helper.c:1020:26: error: too many arguments to function 'drm_gem_lru_scan'
    1020 |                 freed += drm_gem_lru_scan(&shmem_shrinker->lru_evictable,
         |                          ^~~~~~~~~~~~~~~~
   include/drm/drm_gem.h:489:15: note: declared here
     489 | unsigned long drm_gem_lru_scan(struct drm_gem_lru *lru, unsigned nr_to_scan,
         |               ^~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors


vim +/drm_gem_shmem_get_pages_sgt_locked +832 drivers/gpu/drm/drm_gem_shmem_helper.c

   831	
 > 832	struct sg_table *drm_gem_shmem_get_pages_sgt_locked(struct drm_gem_shmem_object *shmem)
   833	{
   834		struct drm_gem_object *obj = &shmem->base;
   835		int ret;
   836		struct sg_table *sgt;
   837	
   838		if (shmem->sgt)
   839			return shmem->sgt;
   840	
   841		drm_WARN_ON(obj->dev, obj->import_attach);
   842	
   843		ret = drm_gem_shmem_get_pages(shmem);
   844		if (ret)
   845			return ERR_PTR(ret);
   846	
   847		sgt = drm_gem_shmem_get_sg_table(shmem);
   848		if (IS_ERR(sgt)) {
   849			ret = PTR_ERR(sgt);
   850			goto err_put_pages;
   851		}
   852		/* Map the pages for use by the h/w. */
   853		ret = dma_map_sgtable(obj->dev->dev, sgt, DMA_BIDIRECTIONAL, 0);
   854		if (ret)
   855			goto err_free_sgt;
   856	
   857		shmem->sgt = sgt;
   858	
   859		drm_gem_shmem_update_pages_state(shmem);
   860	
   861		return sgt;
   862	
   863	err_free_sgt:
   864		sg_free_table(sgt);
   865		kfree(sgt);
   866	err_put_pages:
   867		drm_gem_shmem_put_pages(shmem);
   868		return ERR_PTR(ret);
   869	}
   870	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-02-27  8:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20230227060219.904986-6-dmitry.osipenko@collabora.com>
2023-02-27  8:25 ` [PATCH v11 05/10] drm/shmem-helper: Add memory shrinker kernel test robot
2023-02-27  8:56 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).