Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp763512pxb; Tue, 12 Apr 2022 12:49:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZyqkZBUKVb1qTz409rSpAxG2oJ4G/WYcnrZYZIggbD2ymquDLJ/QmnfU/r7X0uj2yoLgk X-Received: by 2002:a05:6a00:a12:b0:504:e93f:2dd9 with SMTP id p18-20020a056a000a1200b00504e93f2dd9mr29948361pfh.49.1649792960465; Tue, 12 Apr 2022 12:49:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649792960; cv=none; d=google.com; s=arc-20160816; b=UaJju9285PXFRlpzY+5oWxm1gmfG0c/FRta5Kr7aopgnYhHvRb5kkN9K2g3AAruQCn gt6z025yEMZyxSJnBKJ/l/KNgX4SG31FqWDdHweFqLDz9sd2lF+mOw9x92MlJQoDgFFA JyZrj/f5IsXcNR9CUS/fzHDPieSGeauqP8l5nGwSlHIn+2j/nSkmnDrTGOz/Du+5Sw0N ARpf5T9LhN/IEql38L2MFh6BYQN3PzwBPkv7dDjyFVo5eUzAJ+5yzDdA7kAG9pvYkQGt 6UqK4tNPZagREN3Dbjo57lrq8owjQa84r4AOhmrYSZmzHS+O/481MhJ2SqPeNiztADA9 dOaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=Zy2YSMK9cDETQAvwCExQQ34bNQTPNbyqxy7icBfbOOs=; b=jiC6c/Qdpf0jkoMhsYmoC1IlEPeGyIsDL+/oruEmgLmuA8OaXiFyn74Kmc5xS5Xjc4 tc2766/gjMpkAWT52lX+tLlKr/MhmMV+pEAkbP62yoTyzaeMQtF7LxHEmOZWnIASEH0T HRmieTSF2dNaZ8/jyDnmiNYNA3OgZ84z73gdF+vvQc8kv2VzM7Tg1Evo0sSTuIDVudms 1KDU93vDf7rqwJ3a7BOABmf4ceXTXf+GDuQAhHwIcrtp/tt8lpAV87U2qTnFsQoWU4A+ PYxH1rbcajz9OLTmAeEBn87V6s6Lk+cgoqNhPVivhZRICOeoU3THoCT22zbTVvySmCYY A19g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="ZDY/xLIR"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id d17-20020a634f11000000b003816043f0adsi3377543pgb.674.2022.04.12.12.49.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 12:49:20 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="ZDY/xLIR"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1C98B6AA7F; Tue, 12 Apr 2022 12:45:02 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344660AbiDLDim (ORCPT + 99 others); Mon, 11 Apr 2022 23:38:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344575AbiDLDig (ORCPT ); Mon, 11 Apr 2022 23:38:36 -0400 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E134192B6 for ; Mon, 11 Apr 2022 20:36:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649734580; x=1681270580; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=USgLlHicqdKbRyScUUYgIH7kQzveCbYodWpEhoAeAus=; b=ZDY/xLIRuNAEhHOaZkJZfrTzxD2kV3EudVZJ9DTcFTpYjg8LxYxxHFGY wkdcM5s/1/PkWSzNVbuSXNb5SA7k4SvKcHODjN5Nv1Pr3f4J7C4KMupM0 27UZjZ1p8zEaWl7Sxd3wUqhdeOjR6htRXCXuglOxo7mAWF1jsoYHKsEQf BeGBgDZ9ncuDBDzyn3LlOJ7Ec1NdMNF6lXPsr2TotNmgN8GBWM1084JYo x43menl+WxEZZkA02Yzv9WzKCVz9mut9+CadA/Xw0l9EQAzYk4aOSvYbS y2jU58F99nwkxBaXMTMqrrYcNqXCXV38iMqtMC3KAurmBoxUMHPgdAYzr g==; X-IronPort-AV: E=McAfee;i="6400,9594,10314"; a="322713037" X-IronPort-AV: E=Sophos;i="5.90,252,1643702400"; d="scan'208";a="322713037" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Apr 2022 20:36:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,252,1643702400"; d="scan'208";a="654908588" Received: from lkp-server02.sh.intel.com (HELO d3fc50ef50de) ([10.239.97.151]) by fmsmga002.fm.intel.com with ESMTP; 11 Apr 2022 20:36:15 -0700 Received: from kbuild by d3fc50ef50de with local (Exim 4.95) (envelope-from ) id 1ne7KA-0002U5-FR; Tue, 12 Apr 2022 03:36:14 +0000 Date: Tue, 12 Apr 2022 11:35:27 +0800 From: kernel test robot 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@lists.01.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, Gustavo Padovan , dri-devel@lists.freedesktop.org, Dmitry Osipenko Subject: Re: [PATCH v3 11/15] drm/shmem-helper: Add generic memory shrinker Message-ID: <202204121135.zXHzC28U-lkp@intel.com> References: <20220411215937.281655-12-dmitry.osipenko@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220411215937.281655-12-dmitry.osipenko@collabora.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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 ' 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