Re: [PATCH 10/34] drm/amdkfd: svm range eviction and restore

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

 



Hi Felix,

I love your patch! Perhaps something to improve:

[auto build test WARNING on next-20210331]
[cannot apply to drm-intel/for-linux-next drm-tip/drm-tip drm-exynos/exynos-drm-next tegra-drm/drm/tegra/for-next linus/master drm/drm-next v5.12-rc5 v5.12-rc4 v5.12-rc3 v5.12-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/Felix-Kuehling/Add-HMM-based-SVM-memory-manager-to-KFD-v3/20210401-122712
base:    7a43c78d0573e0bbbb0456b033e2b9a895b89464
config: x86_64-randconfig-a011-20210401 (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/07dfb6a9dad338dae38a3a840ce14f77e7498b1f
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Felix-Kuehling/Add-HMM-based-SVM-memory-manager-to-KFD-v3/20210401-122712
        git checkout 07dfb6a9dad338dae38a3a840ce14f77e7498b1f
        # save the attached .config to linux build tree
        make W=1 ARCH=x86_64 

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

All warnings (new ones prefixed by >>):

   drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_svm.c:170:6: warning: no previous prototype for 'svm_range_dma_unmap' [-Wmissing-prototypes]
     170 | void svm_range_dma_unmap(struct device *dev, dma_addr_t *dma_addr,
         |      ^~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_svm.c:603:6: warning: no previous prototype for 'svm_range_add_child' [-Wmissing-prototypes]
     603 | void svm_range_add_child(struct svm_range *prange, struct mm_struct *mm,
         |      ^~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_svm.c:799:5: warning: no previous prototype for 'svm_range_reserve_bos' [-Wmissing-prototypes]
     799 | int svm_range_reserve_bos(struct svm_validate_context *ctx)
         |     ^~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_svm.c:853:6: warning: no previous prototype for 'svm_range_unreserve_bos' [-Wmissing-prototypes]
     853 | void svm_range_unreserve_bos(struct svm_validate_context *ctx)
         |      ^~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_svm.c: In function 'svm_range_evict':
>> drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_svm.c:1071:6: warning: variable 'invalid' set but not used [-Wunused-but-set-variable]
    1071 |  int invalid, evicted_ranges;
         |      ^~~~~~~
   drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_svm.c: At top level:
   drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_svm.c:1094:19: warning: no previous prototype for 'svm_range_clone' [-Wmissing-prototypes]
    1094 | struct svm_range *svm_range_clone(struct svm_range *old)
         |                   ^~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_svm.c:1349:1: warning: no previous prototype for 'svm_range_add_list_work' [-Wmissing-prototypes]
    1349 | svm_range_add_list_work(struct svm_range_list *svms, struct svm_range *prange,
         | ^~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_svm.c:1371:6: warning: no previous prototype for 'schedule_deferred_list_work' [-Wmissing-prototypes]
    1371 | void schedule_deferred_list_work(struct svm_range_list *svms)
         |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +/invalid +1071 drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_svm.c

  1054	
  1055	/**
  1056	 * svm_range_evict - evict svm range
  1057	 *
  1058	 * Stop all queues of the process to ensure GPU doesn't access the memory, then
  1059	 * return to let CPU evict the buffer and proceed CPU pagetable update.
  1060	 *
  1061	 * Don't need use lock to sync cpu pagetable invalidation with GPU execution.
  1062	 * If invalidation happens while restore work is running, restore work will
  1063	 * restart to ensure to get the latest CPU pages mapping to GPU, then start
  1064	 * the queues.
  1065	 */
  1066	static int
  1067	svm_range_evict(struct svm_range *prange, struct mm_struct *mm,
  1068			unsigned long start, unsigned long last)
  1069	{
  1070		struct svm_range_list *svms = prange->svms;
> 1071		int invalid, evicted_ranges;
  1072		int r = 0;
  1073	
  1074		invalid = atomic_inc_return(&prange->invalid);
  1075		evicted_ranges = atomic_inc_return(&svms->evicted_ranges);
  1076		if (evicted_ranges != 1)
  1077			return r;
  1078	
  1079		pr_debug("evicting svms 0x%p range [0x%lx 0x%lx]\n",
  1080			 prange->svms, prange->start, prange->last);
  1081	
  1082		/* First eviction, stop the queues */
  1083		r = kgd2kfd_quiesce_mm(mm);
  1084		if (r)
  1085			pr_debug("failed to quiesce KFD\n");
  1086	
  1087		pr_debug("schedule to restore svm %p ranges\n", svms);
  1088		schedule_delayed_work(&svms->restore_work,
  1089			msecs_to_jiffies(AMDGPU_SVM_RANGE_RESTORE_DELAY_MS));
  1090	
  1091		return r;
  1092	}
  1093	

---
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