* Re: [PATCH v3 11/15] drm/shmem-helper: Add generic memory shrinker
[not found] <20220411215937.281655-12-dmitry.osipenko@collabora.com>
@ 2022-04-12 3:35 ` kernel test robot
2022-04-12 7:25 ` kernel test robot
2022-04-12 7:25 ` kernel test robot
2 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2022-04-12 3:35 UTC (permalink / raw)
To: Dmitry Osipenko, David Airlie, Gerd Hoffmann, Gurchetan Singh,
Chia-I Wu, Daniel Vetter, Daniel Almeida, Gert Wollny,
Tomeu Vizoso, Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
Rob Herring, Steven Price, Alyssa Rosenzweig, Rob Clark
Cc: kbuild-all, linux-kernel, dri-devel, virtualization,
Gustavo Padovan, Dmitry Osipenko
Hi Dmitry,
I love your patch! Perhaps something to improve:
[auto build test WARNING on next-20220411]
[cannot apply to drm/drm-next v5.18-rc2 v5.18-rc1 v5.17 v5.18-rc2]
[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/20220412-060325
base: d12d7e1cfe38e0c36d28c7a9fbbc436ad0d17c14
config: arc-buildonly-randconfig-r002-20220411 (https://download.01.org/0day-ci/archive/20220412/202204121135.zXHzC28U-lkp@intel.com/config)
compiler: arc-elf-gcc (GCC) 11.2.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/683ba8a9d72ba7770a61a9266a2b33949f3874f2
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Dmitry-Osipenko/Add-generic-memory-shrinker-to-VirtIO-GPU-and-Panfrost-DRM-drivers/20220412-060325
git checkout 683ba8a9d72ba7770a61a9266a2b33949f3874f2
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arc SHELL=/bin/bash drivers/gpu/drm/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
drivers/gpu/drm/drm_gem_shmem_helper.c: In function 'drm_gem_shmem_shrinker_run_objects_scan':
>> drivers/gpu/drm/drm_gem_shmem_helper.c:1358:56: warning: implicit conversion from 'enum <anonymous>' to 'enum dma_resv_usage' [-Wenum-conversion]
1358 | if (!dma_resv_test_signaled(obj->resv, true))
| ^~~~
vim +1358 drivers/gpu/drm/drm_gem_shmem_helper.c
1299
1300 static unsigned long
1301 drm_gem_shmem_shrinker_run_objects_scan(struct shrinker *shrinker,
1302 unsigned long nr_to_scan,
1303 bool *lock_contention,
1304 bool evict)
1305 {
1306 struct drm_gem_shmem_shrinker *gem_shrinker = to_drm_shrinker(shrinker);
1307 struct drm_gem_shmem_object *shmem;
1308 struct list_head still_in_list;
1309 struct drm_gem_object *obj;
1310 unsigned long freed = 0;
1311 struct list_head *lru;
1312 size_t page_count;
1313
1314 INIT_LIST_HEAD(&still_in_list);
1315
1316 mutex_lock(&gem_shrinker->lock);
1317
1318 if (evict)
1319 lru = &gem_shrinker->lru_evictable;
1320 else
1321 lru = &gem_shrinker->lru_purgeable;
1322
1323 while (freed < nr_to_scan) {
1324 shmem = list_first_entry_or_null(lru, typeof(*shmem), madv_list);
1325 if (!shmem)
1326 break;
1327
1328 obj = &shmem->base;
1329 page_count = obj->size >> PAGE_SHIFT;
1330 list_move_tail(&shmem->madv_list, &still_in_list);
1331
1332 if (evict && get_nr_swap_pages() < page_count)
1333 continue;
1334
1335 /*
1336 * If it's in the process of being freed, gem_object->free()
1337 * may be blocked on lock waiting to remove it. So just
1338 * skip it.
1339 */
1340 if (!kref_get_unless_zero(&obj->refcount))
1341 continue;
1342
1343 mutex_unlock(&gem_shrinker->lock);
1344
1345 /* prevent racing with job-submission code paths */
1346 if (!dma_resv_trylock(obj->resv)) {
1347 *lock_contention |= true;
1348 goto shrinker_lock;
1349 }
1350
1351 /* prevent racing with the dma-buf exporting */
1352 if (!mutex_trylock(&gem_shrinker->dev->object_name_lock)) {
1353 *lock_contention |= true;
1354 goto resv_unlock;
1355 }
1356
1357 /* check whether h/w uses this object */
> 1358 if (!dma_resv_test_signaled(obj->resv, true))
1359 goto object_name_unlock;
1360
1361 /* GEM may've become unpurgeable while shrinker was unlocked */
1362 if (evict) {
1363 if (!drm_gem_shmem_is_evictable(shmem))
1364 goto object_name_unlock;
1365 } else {
1366 if (!drm_gem_shmem_is_purgeable(shmem))
1367 goto object_name_unlock;
1368 }
1369
1370 if (evict)
1371 freed += obj->funcs->evict(obj);
1372 else
1373 freed += obj->funcs->purge(obj);
1374 object_name_unlock:
1375 mutex_unlock(&gem_shrinker->dev->object_name_lock);
1376 resv_unlock:
1377 dma_resv_unlock(obj->resv);
1378 shrinker_lock:
1379 drm_gem_object_put(&shmem->base);
1380 mutex_lock(&gem_shrinker->lock);
1381 }
1382
1383 list_splice_tail(&still_in_list, lru);
1384
1385 mutex_unlock(&gem_shrinker->lock);
1386
1387 return freed;
1388 }
1389
--
0-DAY CI Kernel Test Service
https://01.org/lkp
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v3 11/15] drm/shmem-helper: Add generic memory shrinker
[not found] <20220411215937.281655-12-dmitry.osipenko@collabora.com>
2022-04-12 3:35 ` [PATCH v3 11/15] drm/shmem-helper: Add generic memory shrinker kernel test robot
@ 2022-04-12 7:25 ` kernel test robot
2022-04-12 7:25 ` kernel test robot
2 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2022-04-12 7:25 UTC (permalink / raw)
To: Dmitry Osipenko, David Airlie, Gerd Hoffmann, Gurchetan Singh,
Chia-I Wu, Daniel Vetter, Daniel Almeida, Gert Wollny,
Tomeu Vizoso, Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
Rob Herring, Steven Price, Alyssa Rosenzweig, Rob Clark
Cc: kbuild-all, llvm, linux-kernel, dri-devel, virtualization,
Gustavo Padovan, Dmitry Osipenko
Hi Dmitry,
I love your patch! Perhaps something to improve:
[auto build test WARNING on next-20220411]
[cannot apply to drm/drm-next v5.18-rc2 v5.18-rc1 v5.17 v5.18-rc2]
[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/20220412-060325
base: d12d7e1cfe38e0c36d28c7a9fbbc436ad0d17c14
config: i386-randconfig-a005-20220411 (https://download.01.org/0day-ci/archive/20220412/202204121523.qVMxOvZg-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project fe2478d44e4f7f191c43fef629ac7a23d0251e72)
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/683ba8a9d72ba7770a61a9266a2b33949f3874f2
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Dmitry-Osipenko/Add-generic-memory-shrinker-to-VirtIO-GPU-and-Panfrost-DRM-drivers/20220412-060325
git checkout 683ba8a9d72ba7770a61a9266a2b33949f3874f2
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/gpu/drm/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> drivers/gpu/drm/drm_gem_shmem_helper.c:289:11: warning: variable 'new_state' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
else if (shmem->madv < 0)
^~~~~~~~~~~~~~~
drivers/gpu/drm/drm_gem_shmem_helper.c:292:46: note: uninitialized use occurs here
drm_gem_shmem_set_pages_state_locked(shmem, new_state);
^~~~~~~~~
drivers/gpu/drm/drm_gem_shmem_helper.c:289:7: note: remove the 'if' if its condition is always true
else if (shmem->madv < 0)
^~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/drm_gem_shmem_helper.c:278:2: note: variable 'new_state' is declared here
enum drm_gem_shmem_pages_state new_state;
^
1 warning generated.
vim +289 drivers/gpu/drm/drm_gem_shmem_helper.c
273
274 static void drm_gem_shmem_update_pages_state_locked(struct drm_gem_shmem_object *shmem)
275 {
276 struct drm_gem_object *obj = &shmem->base;
277 struct drm_gem_shmem_shrinker *gem_shrinker = obj->dev->shmem_shrinker;
278 enum drm_gem_shmem_pages_state new_state;
279
280 if (!gem_shrinker || obj->import_attach)
281 return;
282
283 mutex_lock(&gem_shrinker->lock);
284
285 if (!shmem->madv)
286 new_state = DRM_GEM_SHMEM_PAGES_STATE_ACTIVE;
287 else if (shmem->madv > 0)
288 new_state = DRM_GEM_SHMEM_PAGES_STATE_PURGEABLE;
> 289 else if (shmem->madv < 0)
290 new_state = DRM_GEM_SHMEM_PAGES_STATE_PURGED;
291
292 drm_gem_shmem_set_pages_state_locked(shmem, new_state);
293
294 mutex_unlock(&gem_shrinker->lock);
295 }
296
--
0-DAY CI Kernel Test Service
https://01.org/lkp
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v3 11/15] drm/shmem-helper: Add generic memory shrinker
[not found] <20220411215937.281655-12-dmitry.osipenko@collabora.com>
2022-04-12 3:35 ` [PATCH v3 11/15] drm/shmem-helper: Add generic memory shrinker kernel test robot
2022-04-12 7:25 ` kernel test robot
@ 2022-04-12 7:25 ` kernel test robot
2 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2022-04-12 7:25 UTC (permalink / raw)
To: Dmitry Osipenko, David Airlie, Gerd Hoffmann, Gurchetan Singh,
Chia-I Wu, Daniel Vetter, Daniel Almeida, Gert Wollny,
Tomeu Vizoso, Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
Rob Herring, Steven Price, Alyssa Rosenzweig, Rob Clark
Cc: kbuild-all, llvm, linux-kernel, dri-devel, virtualization,
Gustavo Padovan, Dmitry Osipenko
Hi Dmitry,
I love your patch! Perhaps something to improve:
[auto build test WARNING on next-20220411]
[cannot apply to drm/drm-next v5.18-rc2 v5.18-rc1 v5.17 v5.18-rc2]
[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/20220412-060325
base: d12d7e1cfe38e0c36d28c7a9fbbc436ad0d17c14
config: hexagon-randconfig-r045-20220411 (https://download.01.org/0day-ci/archive/20220412/202204121504.gLR3FHQe-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project fe2478d44e4f7f191c43fef629ac7a23d0251e72)
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/683ba8a9d72ba7770a61a9266a2b33949f3874f2
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Dmitry-Osipenko/Add-generic-memory-shrinker-to-VirtIO-GPU-and-Panfrost-DRM-drivers/20220412-060325
git checkout 683ba8a9d72ba7770a61a9266a2b33949f3874f2
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash drivers/gpu/drm/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> drivers/gpu/drm/drm_gem_shmem_helper.c:289:11: warning: variable 'new_state' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
else if (shmem->madv < 0)
^~~~~~~~~~~~~~~
drivers/gpu/drm/drm_gem_shmem_helper.c:292:46: note: uninitialized use occurs here
drm_gem_shmem_set_pages_state_locked(shmem, new_state);
^~~~~~~~~
drivers/gpu/drm/drm_gem_shmem_helper.c:289:7: note: remove the 'if' if its condition is always true
else if (shmem->madv < 0)
^~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/drm_gem_shmem_helper.c:278:2: note: variable 'new_state' is declared here
enum drm_gem_shmem_pages_state new_state;
^
1 warning generated.
vim +289 drivers/gpu/drm/drm_gem_shmem_helper.c
273
274 static void drm_gem_shmem_update_pages_state_locked(struct drm_gem_shmem_object *shmem)
275 {
276 struct drm_gem_object *obj = &shmem->base;
277 struct drm_gem_shmem_shrinker *gem_shrinker = obj->dev->shmem_shrinker;
278 enum drm_gem_shmem_pages_state new_state;
279
280 if (!gem_shrinker || obj->import_attach)
281 return;
282
283 mutex_lock(&gem_shrinker->lock);
284
285 if (!shmem->madv)
286 new_state = DRM_GEM_SHMEM_PAGES_STATE_ACTIVE;
287 else if (shmem->madv > 0)
288 new_state = DRM_GEM_SHMEM_PAGES_STATE_PURGEABLE;
> 289 else if (shmem->madv < 0)
290 new_state = DRM_GEM_SHMEM_PAGES_STATE_PURGED;
291
292 drm_gem_shmem_set_pages_state_locked(shmem, new_state);
293
294 mutex_unlock(&gem_shrinker->lock);
295 }
296
--
0-DAY CI Kernel Test Service
https://01.org/lkp
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-04-12 7:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20220411215937.281655-12-dmitry.osipenko@collabora.com>
2022-04-12 3:35 ` [PATCH v3 11/15] drm/shmem-helper: Add generic memory shrinker kernel test robot
2022-04-12 7:25 ` kernel test robot
2022-04-12 7:25 ` 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).