CC: [email protected]
In-Reply-To: <[email protected]>
References: <[email protected]>
TO: Yu Zhao <[email protected]>
TO: [email protected]
CC: Alex Shi <[email protected]>
CC: Andi Kleen <[email protected]>
CC: Andrew Morton <[email protected]>
CC: Linux Memory Management List <[email protected]>
CC: Benjamin Manes <[email protected]>
CC: Dave Chinner <[email protected]>
CC: Dave Hansen <[email protected]>
CC: Hillf Danton <[email protected]>
CC: Jens Axboe <[email protected]>

Hi Yu,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on tip/x86/core]
[also build test WARNING on cgroup/for-next tip/x86/mm fuse/for-next 
tip/perf/core tip/sched/core linus/master v5.12-rc7]
[cannot apply to hnaz-linux-mm/master next-20210413]
[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/Yu-Zhao/Multigenerational-LRU-Framework/20210413-145844
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
99cb64de36d5c9397a664808b92943e35bdce25e
:::::: branch date: 11 hours ago
:::::: commit date: 11 hours ago
compiler: h8300-linux-gcc (GCC) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>


cppcheck possible warnings: (new ones prefixed by >>, may not real problems)

   mm/vmscan.c:4108:22: warning: Local variable kswapd shadows outer function 
[shadowFunction]
    struct task_struct *kswapd = NODE_DATA(nid)->kswapd;
                        ^
   mm/vmscan.c:3910:12: note: Shadowed declaration
   static int kswapd(void *p)
              ^
   mm/vmscan.c:4108:22: note: Shadow variable
    struct task_struct *kswapd = NODE_DATA(nid)->kswapd;
                        ^
   mm/vmscan.c:5458:7: warning: Identical inner 'if' condition is always true. 
[identicalInnerCondition]
     if (!args)
         ^
   mm/vmscan.c:5433:15: note: 'alloc' is assigned value '!args' here.
    bool alloc = !args;
                 ^
   mm/vmscan.c:5456:6: note: outer condition: alloc
    if (alloc) {
        ^
   mm/vmscan.c:5458:7: note: identical inner condition: !args
     if (!args)
         ^
>> mm/vmscan.c:4710:12: warning: Possible null pointer dereference: args 
>> [nullPointer]
    int nid = args->node_id;
              ^
   mm/vmscan.c:5945:55: note: Calling function 'walk_mm_list', 5th argument 
'NULL' value is 0
    return walk_mm_list(lruvec, max_seq, sc, swappiness, NULL) ? nr_to_scan : 0;
                                                         ^
   mm/vmscan.c:5469:22: note: Calling function 'get_next_mm', 1st argument 
'args' value is 0
     last = get_next_mm(args, swappiness, &mm);
                        ^
   mm/vmscan.c:4801:32: note: Calling function 'reset_mm_stats', 3rd argument 
'args' value is 0
    reset_mm_stats(mm_list, last, args);
                                  ^
   mm/vmscan.c:4710:12: note: Null pointer dereference
    int nid = args->node_id;
              ^
   mm/vmscan.c:4711:32: warning: Possible null pointer dereference: args 
[nullPointer]
    int sid = sid_from_seq_or_gen(args->max_seq);
                                  ^
   mm/vmscan.c:5945:55: note: Calling function 'walk_mm_list', 5th argument 
'NULL' value is 0
    return walk_mm_list(lruvec, max_seq, sc, swappiness, NULL) ? nr_to_scan : 0;
                                                         ^
   mm/vmscan.c:5469:22: note: Calling function 'get_next_mm', 1st argument 
'args' value is 0
     last = get_next_mm(args, swappiness, &mm);
                        ^
   mm/vmscan.c:4801:32: note: Calling function 'reset_mm_stats', 3rd argument 
'args' value is 0
    reset_mm_stats(mm_list, last, args);
                                  ^
   mm/vmscan.c:4711:32: note: Null pointer dereference
    int sid = sid_from_seq_or_gen(args->max_seq);
                                  ^
   mm/vmscan.c:4724:28: warning: Possible null pointer dereference: args 
[nullPointer]
    sid = sid_from_seq_or_gen(args->max_seq + 1);
                              ^
   mm/vmscan.c:5945:55: note: Calling function 'walk_mm_list', 5th argument 
'NULL' value is 0
    return walk_mm_list(lruvec, max_seq, sc, swappiness, NULL) ? nr_to_scan : 0;
                                                         ^
   mm/vmscan.c:5469:22: note: Calling function 'get_next_mm', 1st argument 
'args' value is 0
     last = get_next_mm(args, swappiness, &mm);
                        ^
   mm/vmscan.c:4801:32: note: Calling function 'reset_mm_stats', 3rd argument 
'args' value is 0
    reset_mm_stats(mm_list, last, args);
                                  ^
   mm/vmscan.c:4724:28: note: Null pointer dereference
    sid = sid_from_seq_or_gen(args->max_seq + 1);
                              ^
   mm/vmscan.c:4756:12: warning: Possible null pointer dereference: args 
[nullPointer]
    int nid = args->node_id;
              ^
   mm/vmscan.c:5945:55: note: Calling function 'walk_mm_list', 5th argument 
'NULL' value is 0
    return walk_mm_list(lruvec, max_seq, sc, swappiness, NULL) ? nr_to_scan : 0;
                                                         ^
   mm/vmscan.c:5469:22: note: Calling function 'get_next_mm', 1st argument 
'args' value is 0
     last = get_next_mm(args, swappiness, &mm);
                        ^
   mm/vmscan.c:4756:12: note: Null pointer dereference
    int nid = args->node_id;
              ^
   mm/vmscan.c:4757:48: warning: Possible null pointer dereference: args 
[nullPointer]
    struct lru_gen_mm_list *mm_list = get_mm_list(args->memcg);
                                                  ^
   mm/vmscan.c:5945:55: note: Calling function 'walk_mm_list', 5th argument 
'NULL' value is 0
    return walk_mm_list(lruvec, max_seq, sc, swappiness, NULL) ? nr_to_scan : 0;
                                                         ^
   mm/vmscan.c:5469:22: note: Calling function 'get_next_mm', 1st argument 
'args' value is 0
     last = get_next_mm(args, swappiness, &mm);
                        ^
   mm/vmscan.c:4757:48: note: Null pointer dereference
    struct lru_gen_mm_list *mm_list = get_mm_list(args->memcg);
                                                  ^
   mm/vmscan.c:4766:12: warning: Possible null pointer dereference: args 
[nullPointer]
    VM_BUG_ON(args->max_seq > mm_list->nodes[nid].cur_seq + 1);
              ^
   mm/vmscan.c:5945:55: note: Calling function 'walk_mm_list', 5th argument 
'NULL' value is 0
    return walk_mm_list(lruvec, max_seq, sc, swappiness, NULL) ? nr_to_scan : 0;
                                                         ^
   mm/vmscan.c:5469:22: note: Calling function 'get_next_mm', 1st argument 
'args' value is 0
     last = get_next_mm(args, swappiness, &mm);
                        ^
   mm/vmscan.c:4766:12: note: Null pointer dereference
    VM_BUG_ON(args->max_seq > mm_list->nodes[nid].cur_seq + 1);
              ^
   mm/vmscan.c:4767:21: warning: Possible null pointer dereference: args 
[nullPointer]
    VM_BUG_ON(*iter && args->max_seq < mm_list->nodes[nid].cur_seq);
                       ^
   mm/vmscan.c:5945:55: note: Calling function 'walk_mm_list', 5th argument 
'NULL' value is 0
    return walk_mm_list(lruvec, max_seq, sc, swappiness, NULL) ? nr_to_scan : 0;
                                                         ^
   mm/vmscan.c:5469:22: note: Calling function 'get_next_mm', 1st argument 
'args' value is 0
     last = get_next_mm(args, swappiness, &mm);
                        ^
   mm/vmscan.c:4767:21: note: Null pointer dereference
    VM_BUG_ON(*iter && args->max_seq < mm_list->nodes[nid].cur_seq);
                       ^
   mm/vmscan.c:4770:6: warning: Possible null pointer dereference: args 
[nullPointer]
    if (args->max_seq <= mm_list->nodes[nid].cur_seq) {
        ^
   mm/vmscan.c:5945:55: note: Calling function 'walk_mm_list', 5th argument 
'NULL' value is 0
    return walk_mm_list(lruvec, max_seq, sc, swappiness, NULL) ? nr_to_scan : 0;
                                                         ^
   mm/vmscan.c:5469:22: note: Calling function 'get_next_mm', 1st argument 
'args' value is 0
     last = get_next_mm(args, swappiness, &mm);

vim +4710 mm/vmscan.c

46b27b9e9608eb Yu Zhao 2021-04-13  4705  
46b27b9e9608eb Yu Zhao 2021-04-13  4706  static void reset_mm_stats(struct 
lru_gen_mm_list *mm_list, bool last,
46b27b9e9608eb Yu Zhao 2021-04-13  4707                            struct 
mm_walk_args *args)
46b27b9e9608eb Yu Zhao 2021-04-13  4708  {
46b27b9e9608eb Yu Zhao 2021-04-13  4709         int i;
46b27b9e9608eb Yu Zhao 2021-04-13 @4710         int nid = args->node_id;
46b27b9e9608eb Yu Zhao 2021-04-13  4711         int sid = 
sid_from_seq_or_gen(args->max_seq);
46b27b9e9608eb Yu Zhao 2021-04-13  4712  
46b27b9e9608eb Yu Zhao 2021-04-13  4713         
lockdep_assert_held(&mm_list->lock);
46b27b9e9608eb Yu Zhao 2021-04-13  4714  
46b27b9e9608eb Yu Zhao 2021-04-13  4715         for (i = 0; i < NR_MM_STATS; 
i++) {
46b27b9e9608eb Yu Zhao 2021-04-13  4716                 
WRITE_ONCE(mm_list->nodes[nid].stats[sid][i],
46b27b9e9608eb Yu Zhao 2021-04-13  4717                            
mm_list->nodes[nid].stats[sid][i] + args->mm_stats[i]);
46b27b9e9608eb Yu Zhao 2021-04-13  4718                 args->mm_stats[i] = 0;
46b27b9e9608eb Yu Zhao 2021-04-13  4719         }
46b27b9e9608eb Yu Zhao 2021-04-13  4720  
46b27b9e9608eb Yu Zhao 2021-04-13  4721         if (!last || NR_STAT_GENS == 1)
46b27b9e9608eb Yu Zhao 2021-04-13  4722                 return;
46b27b9e9608eb Yu Zhao 2021-04-13  4723  
46b27b9e9608eb Yu Zhao 2021-04-13  4724         sid = 
sid_from_seq_or_gen(args->max_seq + 1);
46b27b9e9608eb Yu Zhao 2021-04-13  4725         for (i = 0; i < NR_MM_STATS; 
i++)
46b27b9e9608eb Yu Zhao 2021-04-13  4726                 
WRITE_ONCE(mm_list->nodes[nid].stats[sid][i], 0);
46b27b9e9608eb Yu Zhao 2021-04-13  4727  }
46b27b9e9608eb Yu Zhao 2021-04-13  4728  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]
_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to