Re: [PATCH 10/11] mm/zsmalloc: Handle single object charge migration in migrate_zspage
From: Joshua Hahn
Date: Thu Mar 12 2026 - 13:05:15 EST
On Thu, 12 Mar 2026 11:51:59 +0800 kernel test robot <lkp@xxxxxxxxx> wrote:
> Hi Joshua,
>
> kernel test robot noticed the following build warnings:
>
> [auto build test WARNING on axboe/for-next]
> [also build test WARNING on linus/master v7.0-rc3]
> [cannot apply to akpm-mm/mm-everything next-20260311]
> [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#_base_tree_information]
>
> url: https://github.com/intel-lab-lkp/linux/commits/Joshua-Hahn/mm-zsmalloc-Rename-zs_object_copy-to-zs_obj_copy/20260312-035531
> base: https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux.git for-next
> patch link: https://lore.kernel.org/r/20260311195153.4013476-11-joshua.hahnjy%40gmail.com
> patch subject: [PATCH 10/11] mm/zsmalloc: Handle single object charge migration in migrate_zspage
> config: x86_64-randconfig-001-20260312 (https://download.01.org/0day-ci/archive/20260312/202603121158.g93vlc2U-lkp@xxxxxxxxx/config)
> compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260312/202603121158.g93vlc2U-lkp@xxxxxxxxx/reproduce)
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@xxxxxxxxx>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202603121158.g93vlc2U-lkp@xxxxxxxxx/
>
> All warnings (new ones prefixed by >>):
>
> >> mm/zsmalloc.c:1702:6: warning: variable 's_idx' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
> 1702 | if (!cgroup_subsys_on_dfl(memory_cgrp_subsys))
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> mm/zsmalloc.c:1752:45: note: uninitialized use occurs here
> 1752 | d_zspage->objcgs[d_idx] = s_zspage->objcgs[s_idx];
> | ^~~~~
> mm/zsmalloc.c:1702:2: note: remove the 'if' if its condition is always false
> 1702 | if (!cgroup_subsys_on_dfl(memory_cgrp_subsys))
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 1703 | goto out;
> | ~~~~~~~~
> mm/zsmalloc.c:1696:20: note: initialize the variable 's_idx' to silence this warning
> 1696 | unsigned int s_idx, d_idx;
> | ^
> | = 0
> >> mm/zsmalloc.c:1702:6: warning: variable 'd_idx' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
> 1702 | if (!cgroup_subsys_on_dfl(memory_cgrp_subsys))
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> mm/zsmalloc.c:1752:19: note: uninitialized use occurs here
> 1752 | d_zspage->objcgs[d_idx] = s_zspage->objcgs[s_idx];
> | ^~~~~
> mm/zsmalloc.c:1702:2: note: remove the 'if' if its condition is always false
> 1702 | if (!cgroup_subsys_on_dfl(memory_cgrp_subsys))
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 1703 | goto out;
> | ~~~~~~~~
> mm/zsmalloc.c:1696:27: note: initialize the variable 'd_idx' to silence this warning
> 1696 | unsigned int s_idx, d_idx;
> | ^
> | = 0
> 2 warnings generated.
Hello kernel test robot,
Thank you for catching this issue! Yes, the MEMCG v1 check should be
done after I use obj_to_location to initialize the indices, so that
the objcg pointer swap works at the end.
Will make the change in the next version!
Joshua