CC: [email protected] BCC: [email protected] In-Reply-To: <[email protected]> References: <[email protected]> TO: Dmitry Osipenko <[email protected]> TO: David Airlie <[email protected]> TO: Gerd Hoffmann <[email protected]> TO: Gurchetan Singh <[email protected]> TO: "Chia-I Wu" <[email protected]> TO: Daniel Vetter <[email protected]> TO: Daniel Almeida <[email protected]> TO: Gert Wollny <[email protected]> TO: Gustavo Padovan <[email protected]> TO: Daniel Stone <[email protected]> TO: Tomeu Vizoso <[email protected]> TO: Maarten Lankhorst <[email protected]> TO: Maxime Ripard <[email protected]> TO: Thomas Zimmermann <[email protected]> TO: Rob Herring <[email protected]> TO: Steven Price <[email protected]> TO: Alyssa Rosenzweig <[email protected]> TO: Rob Clark <[email protected]> TO: Emil Velikov <[email protected]> TO: Robin Murphy <[email protected]> TO: Qiang Yu <[email protected]> TO: Sumit Semwal <[email protected]> TO: "Christian König" <[email protected]> TO: "Pan, Xinhui" <[email protected]> TO: Thierry Reding <[email protected]> TO: Tomasz Figa <[email protected]> TO: Marek Szyprowski <[email protected]> TO: Mauro Carvalho Chehab <[email protected]> CC: [email protected] TO: Alex Deucher <[email protected]> TO: Jani Nikula <[email protected]>
Hi Dmitry, I love your patch! Perhaps something to improve: [auto build test WARNING on linus/master] [also build test WARNING on next-20220527] [cannot apply to drm/drm-next media-tree/master drm-intel/for-linux-next v5.18] [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/intel-lab-lkp/linux/commits/Dmitry-Osipenko/Add-generic-memory-shrinker-to-VirtIO-GPU-and-Panfrost-DRM-drivers/20220527-075717 base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git cdeffe87f790dfd1baa193020411ce9a538446d7 :::::: branch date: 14 hours ago :::::: commit date: 14 hours ago config: i386-randconfig-m021 (https://download.01.org/0day-ci/archive/20220527/[email protected]/config) compiler: gcc-11 (Debian 11.3.0-1) 11.3.0 If you fix the issue, kindly add following tag where applicable Reported-by: kernel test robot <[email protected]> Reported-by: Dan Carpenter <[email protected]> New smatch warnings: drivers/gpu/drm/drm_gem_shmem_helper.c:226 drm_gem_shmem_set_evictable() warn: inconsistent returns 'shmem->base.resv'. drivers/gpu/drm/drm_gem_shmem_helper.c:253 drm_gem_shmem_set_purgeable() warn: inconsistent returns 'shmem->base.resv'. drivers/gpu/drm/drm_gem_shmem_helper.c:703 drm_gem_shmem_fault() error: we previously assumed 'shmem->pages' could be null (see line 694) Old smatch warnings: include/drm/drm_vma_manager.h:225 drm_vma_node_unmap() warn: should 'drm_vma_node_size(node) << 12' be a 64 bit type? vim +226 drivers/gpu/drm/drm_gem_shmem_helper.c 2194a63a818db7 Noralf Trønnes 2019-03-12 204 875fd932de880a Dmitry Osipenko 2022-05-27 205 /** 875fd932de880a Dmitry Osipenko 2022-05-27 206 * drm_gem_shmem_set_evictable() - Make GEM evictable by memory shrinker 875fd932de880a Dmitry Osipenko 2022-05-27 207 * @shmem: shmem GEM object 875fd932de880a Dmitry Osipenko 2022-05-27 208 * 875fd932de880a Dmitry Osipenko 2022-05-27 209 * Tell memory shrinker that this GEM can be evicted. Initially eviction is 875fd932de880a Dmitry Osipenko 2022-05-27 210 * disabled for all GEMs. If GEM was purged, then -ENOMEM is returned. 875fd932de880a Dmitry Osipenko 2022-05-27 211 * 875fd932de880a Dmitry Osipenko 2022-05-27 212 * Returns: 875fd932de880a Dmitry Osipenko 2022-05-27 213 * 0 on success or a negative error code on failure. 875fd932de880a Dmitry Osipenko 2022-05-27 214 */ 875fd932de880a Dmitry Osipenko 2022-05-27 215 int drm_gem_shmem_set_evictable(struct drm_gem_shmem_object *shmem) 875fd932de880a Dmitry Osipenko 2022-05-27 216 { 875fd932de880a Dmitry Osipenko 2022-05-27 217 dma_resv_lock(shmem->base.resv, NULL); 875fd932de880a Dmitry Osipenko 2022-05-27 218 875fd932de880a Dmitry Osipenko 2022-05-27 219 if (shmem->madv < 0) 875fd932de880a Dmitry Osipenko 2022-05-27 220 return -ENOMEM; 875fd932de880a Dmitry Osipenko 2022-05-27 221 875fd932de880a Dmitry Osipenko 2022-05-27 222 shmem->eviction_enabled = true; 875fd932de880a Dmitry Osipenko 2022-05-27 223 875fd932de880a Dmitry Osipenko 2022-05-27 224 dma_resv_unlock(shmem->base.resv); 875fd932de880a Dmitry Osipenko 2022-05-27 225 875fd932de880a Dmitry Osipenko 2022-05-27 @226 return 0; 875fd932de880a Dmitry Osipenko 2022-05-27 227 } 875fd932de880a Dmitry Osipenko 2022-05-27 228 EXPORT_SYMBOL_GPL(drm_gem_shmem_set_evictable); 875fd932de880a Dmitry Osipenko 2022-05-27 229 875fd932de880a Dmitry Osipenko 2022-05-27 230 /** 875fd932de880a Dmitry Osipenko 2022-05-27 231 * drm_gem_shmem_set_purgeable() - Make GEM purgeable by memory shrinker 875fd932de880a Dmitry Osipenko 2022-05-27 232 * @shmem: shmem GEM object 875fd932de880a Dmitry Osipenko 2022-05-27 233 * 875fd932de880a Dmitry Osipenko 2022-05-27 234 * Tell memory shrinker that this GEM can be purged. Initially purging is 875fd932de880a Dmitry Osipenko 2022-05-27 235 * disabled for all GEMs. If GEM was purged, then -ENOMEM is returned. 875fd932de880a Dmitry Osipenko 2022-05-27 236 * 875fd932de880a Dmitry Osipenko 2022-05-27 237 * Returns: 875fd932de880a Dmitry Osipenko 2022-05-27 238 * 0 on success or a negative error code on failure. 875fd932de880a Dmitry Osipenko 2022-05-27 239 */ 875fd932de880a Dmitry Osipenko 2022-05-27 240 int drm_gem_shmem_set_purgeable(struct drm_gem_shmem_object *shmem) 875fd932de880a Dmitry Osipenko 2022-05-27 241 { 875fd932de880a Dmitry Osipenko 2022-05-27 242 dma_resv_lock(shmem->base.resv, NULL); 875fd932de880a Dmitry Osipenko 2022-05-27 243 875fd932de880a Dmitry Osipenko 2022-05-27 244 if (shmem->madv < 0) 875fd932de880a Dmitry Osipenko 2022-05-27 245 return -ENOMEM; 875fd932de880a Dmitry Osipenko 2022-05-27 246 875fd932de880a Dmitry Osipenko 2022-05-27 247 shmem->purge_enabled = true; 875fd932de880a Dmitry Osipenko 2022-05-27 248 875fd932de880a Dmitry Osipenko 2022-05-27 249 drm_gem_shmem_update_pages_state(shmem); 875fd932de880a Dmitry Osipenko 2022-05-27 250 875fd932de880a Dmitry Osipenko 2022-05-27 251 dma_resv_unlock(shmem->base.resv); 875fd932de880a Dmitry Osipenko 2022-05-27 252 875fd932de880a Dmitry Osipenko 2022-05-27 @253 return 0; 875fd932de880a Dmitry Osipenko 2022-05-27 254 } 875fd932de880a Dmitry Osipenko 2022-05-27 255 EXPORT_SYMBOL_GPL(drm_gem_shmem_set_purgeable); 875fd932de880a Dmitry Osipenko 2022-05-27 256 -- 0-DAY CI Kernel Test Service https://01.org/lkp _______________________________________________ kbuild mailing list -- [email protected] To unsubscribe send an email to [email protected]
