Re: [Intel-gfx] [PATCH 2/2] drm/i915/gem: Almagamate clflushes on freeze
Hi Chris, Thank you for the patch! Yet something to improve: [auto build test ERROR on drm-intel/for-linux-next] [also build test ERROR on drm-tip/drm-tip v5.11-rc2 next-20210104] [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/Chris-Wilson/drm-i915-gem-Almagamate-clflushes-on-suspend/20210104-220329 base: git://anongit.freedesktop.org/drm-intel for-linux-next config: x86_64-randconfig-a004-20210105 (attached as .config) compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 98cd1c33e3c2c3cfee36fb0fea3285fda06224d3) 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 x86_64 cross compiling tool for clang build # apt-get install binutils-x86-64-linux-gnu # https://github.com/0day-ci/linux/commit/54314b2c3991bf37b7a6bf3b35eee4179a5e908a git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Chris-Wilson/drm-i915-gem-Almagamate-clflushes-on-suspend/20210104-220329 git checkout 54314b2c3991bf37b7a6bf3b35eee4179a5e908a # save the attached .config to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All errors (new ones prefixed by >>): >> drivers/gpu/drm/i915/i915_gem.c:1286:2: error: implicit declaration of >> function 'wbinvd_on_all_cpus' [-Werror,-Wimplicit-function-declaration] wbinvd_on_all_cpus(); ^ 1 error generated. vim +/wbinvd_on_all_cpus +1286 drivers/gpu/drm/i915/i915_gem.c 1261 1262 int i915_gem_freeze_late(struct drm_i915_private *i915) 1263 { 1264 struct drm_i915_gem_object *obj; 1265 intel_wakeref_t wakeref; 1266 1267 /* 1268 * Called just before we write the hibernation image. 1269 * 1270 * We need to update the domain tracking to reflect that the CPU 1271 * will be accessing all the pages to create and restore from the 1272 * hibernation, and so upon restoration those pages will be in the 1273 * CPU domain. 1274 * 1275 * To make sure the hibernation image contains the latest state, 1276 * we update that state just before writing out the image. 1277 * 1278 * To try and reduce the hibernation image, we manually shrink 1279 * the objects as well, see i915_gem_freeze() 1280 */ 1281 1282 with_intel_runtime_pm(&i915->runtime_pm, wakeref) 1283 i915_gem_shrink(i915, -1UL, NULL, ~0); 1284 i915_gem_drain_freed_objects(i915); 1285 > 1286 wbinvd_on_all_cpus(); 1287 list_for_each_entry(obj, &i915->mm.shrink_list, mm.link) 1288 __start_cpu_write(obj); 1289 1290 return 0; 1291 } 1292 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-...@lists.01.org .config.gz Description: application/gzip ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH 2/2] drm/i915/gem: Almagamate clflushes on freeze
When flushing objects larger than the CPU cache it is preferrable to use a single wbinvd() rather than overlapping clflush(). At runtime, we avoid wbinvd() due to its system-wide latencies, but during singlethreaded suspend, no one will observe the imposed latency and we can opt for the faster wbinvd to clear all objects in a single hit. Signed-off-by: Chris Wilson --- drivers/gpu/drm/i915/i915_gem.c | 16 +--- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 17a4636ee542..21194ebfc31e 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -1277,19 +1277,13 @@ int i915_gem_freeze_late(struct drm_i915_private *i915) * the objects as well, see i915_gem_freeze() */ - wakeref = intel_runtime_pm_get(&i915->runtime_pm); - - i915_gem_shrink(i915, -1UL, NULL, ~0); + with_intel_runtime_pm(&i915->runtime_pm, wakeref) + i915_gem_shrink(i915, -1UL, NULL, ~0); i915_gem_drain_freed_objects(i915); - list_for_each_entry(obj, &i915->mm.shrink_list, mm.link) { - i915_gem_object_lock(obj, NULL); - drm_WARN_ON(&i915->drm, - i915_gem_object_set_to_cpu_domain(obj, true)); - i915_gem_object_unlock(obj); - } - - intel_runtime_pm_put(&i915->runtime_pm, wakeref); + wbinvd_on_all_cpus(); + list_for_each_entry(obj, &i915->mm.shrink_list, mm.link) + __start_cpu_write(obj); return 0; } -- 2.20.1 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx