Skip to contentSkip to conversation

kernel/fork.c:400:30: warning: implicit conversion from enumeration type 'enum memcg_stat_item' to different enumeration type 'enum node_stat_item'

PATCH Nick Desaulniers 2 participants 2 messages Jan 6, 2020 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 202001050316.ZKXmkO5U%[email protected]

#1 lore raw

Roman,
Apologies if it was already reported (working backwards through emails missed during the holidays), but this warning looks legit. Can you please take a look?

Quoted 66 lines · kbuild test robot

CC: kbuild-all(a)lists.01.org
BCC: philip.li(a)intel.com
TO: Roman Gushchin <[email protected]>

tree:   https://github.com/rgushchin/linux.git new_slab.1.1
head:   0ec79f1847c5e618cc4bcbb22f9de91df63b764c
commit: 2a337eb3936ece98e0f1b8eaf1e13b6557b0fcc5 [3/23] mm: fork: fix kernel_stack memcg stats for various stack implementations
config: arm64-defconfig (attached as .config)
compiler: clang version 10.0.0 (git://gitmirror/llvm_project 320b43c39f0eb636c84815ce463893b21befdc8f)

reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
git checkout 2a337eb3936ece98e0f1b8eaf1e13b6557b0fcc5
# save the attached .config to linux build tree
make.cross ARCH=arm64

If you fix the issue, kindly add following tag

All warnings (new ones prefixed by >>):

Quoted 1 line
Quoted 1 line

kernel/fork.c:400:30: warning: implicit conversion from enumeration type 'enum memcg_stat_item' to different enumeration type 'enum node_stat_item' [-Wenum-conversion]

                   mod_memcg_obj_state(stack, MEMCG_KERNEL_STACK_KB,
                   ~~~~~~~~~~~~~~~~~~~        ^~~~~~~~~~~~~~~~~~~~~

1 warning generated.

vim +400 kernel/fork.c

   372
   373  static void account_kernel_stack(struct task_struct *tsk, int account)
   374  {
   375          void *stack = task_stack_page(tsk);
   376          struct vm_struct *vm = task_stack_vm_area(tsk);
   377
   378          BUILD_BUG_ON(IS_ENABLED(CONFIG_VMAP_STACK) && PAGE_SIZE % 1024 != 0);
   379
   380          if (vm) {
   381                  int i;
   382
   383                  BUG_ON(vm->nr_pages != THREAD_SIZE / PAGE_SIZE);
   384
   385                  for (i = 0; i < THREAD_SIZE / PAGE_SIZE; i++) {
   386                          mod_zone_page_state(page_zone(vm->pages[i]),
   387                                              NR_KERNEL_STACK_KB,
   388                                              PAGE_SIZE / 1024 * account);
   389                  }
   390          } else {
   391                  /*
   392                   * All stack pages are in the same zone and belong to the
   393                   * same memcg.
   394                   */
   395                  struct page *first_page = virt_to_page(stack);
   396
   397                  mod_zone_page_state(page_zone(first_page), NR_KERNEL_STACK_KB,
   398                                      THREAD_SIZE / 1024 * account);
   399
Quoted 1 line

400 mod_memcg_obj_state(stack, MEMCG_KERNEL_STACK_KB,

   401                                      account * (THREAD_SIZE / 1024));
   402          }
   403  }
   404

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org Intel Corporation

Signature · 2 lines
Thanks,
~Nick Desaulniers
#2 lore raw
Quoted 4 lines · Nick Desaulniers

Roman,
Apologies if it was already reported (working backwards through emails missed during the holidays), but this warning looks legit. Can you please take a look?

Hello, Nick!

I'll definitely take a look, however it's my private repo, so I really didn't expect that anyone except me will be noticed. Maybe something has been changed on the lkp side. Sorry for bothering.

Thanks!