From: kernel test robot <lkp@intel.com>
To: Yu Zhao <yuzhao@google.com>, linux-mm@kvack.org
Cc: kbuild-all@lists.01.org, Alex Shi <alexs@kernel.org>,
Andi Kleen <ak@linux.intel.com>,
Andrew Morton <akpm@linux-foundation.org>,
Linux Memory Management List <linux-mm@kvack.org>,
Benjamin Manes <ben.manes@gmail.com>,
Dave Chinner <david@fromorbit.com>,
Dave Hansen <dave.hansen@linux.intel.com>,
Hillf Danton <hdanton@sina.com>, Jens Axboe <axboe@kernel.dk>
Subject: Re: [PATCH v2 14/16] mm: multigenerational lru: user interface
Date: Wed, 14 Apr 2021 06:39:15 +0800 [thread overview]
Message-ID: <202104140636.BHTZxlS1-lkp@intel.com> (raw)
In-Reply-To: <20210413065633.2782273-15-yuzhao@google.com>
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
compiler: h8300-linux-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
cppcheck possible warnings: (new ones prefixed by >>, may not real problems)
mm/vmscan.c:4110:22: warning: Local variable kswapd shadows outer function [shadowFunction]
struct task_struct *kswapd = NODE_DATA(nid)->kswapd;
^
mm/vmscan.c:3912:12: note: Shadowed declaration
static int kswapd(void *p)
^
mm/vmscan.c:4110:22: note: Shadow variable
struct task_struct *kswapd = NODE_DATA(nid)->kswapd;
^
mm/vmscan.c:5460:7: warning: Identical inner 'if' condition is always true. [identicalInnerCondition]
if (!args)
^
mm/vmscan.c:5435:15: note: 'alloc' is assigned value '!args' here.
bool alloc = !args;
^
mm/vmscan.c:5458:6: note: outer condition: alloc
if (alloc) {
^
mm/vmscan.c:5460:7: note: identical inner condition: !args
if (!args)
^
>> mm/vmscan.c:6613:7: warning: %u in format string (no. 2) requires 'unsigned int *' but the argument type is 'signed int *'. [invalidScanfArgType_int]
n = sscanf(cur, "%c %u %u %lu %n %u %n %lu %n", &cmd, &memcg_id, &nid,
^
mm/vmscan.c:6613:7: warning: %u in format string (no. 3) requires 'unsigned int *' but the argument type is 'signed int *'. [invalidScanfArgType_int]
n = sscanf(cur, "%c %u %u %lu %n %u %n %lu %n", &cmd, &memcg_id, &nid,
^
mm/vmscan.c:6613:7: warning: %u in format string (no. 6) requires 'unsigned int *' but the argument type is 'signed int *'. [invalidScanfArgType_int]
n = sscanf(cur, "%c %u %u %lu %n %u %n %lu %n", &cmd, &memcg_id, &nid,
^
mm/vmscan.c:4712:12: warning: Possible null pointer dereference: args [nullPointer]
int nid = args->node_id;
^
mm/vmscan.c:5947: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:5471:22: note: Calling function 'get_next_mm', 1st argument 'args' value is 0
last = get_next_mm(args, swappiness, &mm);
^
mm/vmscan.c:4803:32: note: Calling function 'reset_mm_stats', 3rd argument 'args' value is 0
reset_mm_stats(mm_list, last, args);
^
mm/vmscan.c:4712:12: note: Null pointer dereference
int nid = args->node_id;
^
mm/vmscan.c:4713:32: warning: Possible null pointer dereference: args [nullPointer]
int sid = sid_from_seq_or_gen(args->max_seq);
^
mm/vmscan.c:5947: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:5471:22: note: Calling function 'get_next_mm', 1st argument 'args' value is 0
last = get_next_mm(args, swappiness, &mm);
^
mm/vmscan.c:4803:32: note: Calling function 'reset_mm_stats', 3rd argument 'args' value is 0
reset_mm_stats(mm_list, last, args);
^
mm/vmscan.c:4713:32: note: Null pointer dereference
int sid = sid_from_seq_or_gen(args->max_seq);
^
mm/vmscan.c:4726:28: warning: Possible null pointer dereference: args [nullPointer]
sid = sid_from_seq_or_gen(args->max_seq + 1);
^
mm/vmscan.c:5947: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:5471:22: note: Calling function 'get_next_mm', 1st argument 'args' value is 0
last = get_next_mm(args, swappiness, &mm);
^
mm/vmscan.c:4803:32: note: Calling function 'reset_mm_stats', 3rd argument 'args' value is 0
reset_mm_stats(mm_list, last, args);
^
mm/vmscan.c:4726:28: note: Null pointer dereference
sid = sid_from_seq_or_gen(args->max_seq + 1);
^
mm/vmscan.c:4758:12: warning: Possible null pointer dereference: args [nullPointer]
int nid = args->node_id;
^
mm/vmscan.c:5947: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:5471:22: note: Calling function 'get_next_mm', 1st argument 'args' value is 0
last = get_next_mm(args, swappiness, &mm);
^
mm/vmscan.c:4758:12: note: Null pointer dereference
int nid = args->node_id;
^
mm/vmscan.c:4759:48: warning: Possible null pointer dereference: args [nullPointer]
struct lru_gen_mm_list *mm_list = get_mm_list(args->memcg);
^
mm/vmscan.c:5947: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:5471:22: note: Calling function 'get_next_mm', 1st argument 'args' value is 0
last = get_next_mm(args, swappiness, &mm);
^
mm/vmscan.c:4759:48: note: Null pointer dereference
struct lru_gen_mm_list *mm_list = get_mm_list(args->memcg);
^
mm/vmscan.c:4768:12: warning: Possible null pointer dereference: args [nullPointer]
VM_BUG_ON(args->max_seq > mm_list->nodes[nid].cur_seq + 1);
^
mm/vmscan.c:5947: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:5471:22: note: Calling function 'get_next_mm', 1st argument 'args' value is 0
last = get_next_mm(args, swappiness, &mm);
^
mm/vmscan.c:4768:12: note: Null pointer dereference
VM_BUG_ON(args->max_seq > mm_list->nodes[nid].cur_seq + 1);
^
mm/vmscan.c:4769:21: warning: Possible null pointer dereference: args [nullPointer]
VM_BUG_ON(*iter && args->max_seq < mm_list->nodes[nid].cur_seq);
^
mm/vmscan.c:5947: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:5471:22: note: Calling function 'get_next_mm', 1st argument 'args' value is 0
last = get_next_mm(args, swappiness, &mm);
^
mm/vmscan.c:4769:21: note: Null pointer dereference
VM_BUG_ON(*iter && args->max_seq < mm_list->nodes[nid].cur_seq);
vim +6613 mm/vmscan.c
6579
6580 static ssize_t lru_gen_seq_write(struct file *file, const char __user *src,
6581 size_t len, loff_t *pos)
6582 {
6583 void *buf;
6584 char *cur, *next;
6585 int err = 0;
6586
6587 buf = kvmalloc(len + 1, GFP_USER);
6588 if (!buf)
6589 return -ENOMEM;
6590
6591 if (copy_from_user(buf, src, len)) {
6592 kvfree(buf);
6593 return -EFAULT;
6594 }
6595
6596 next = buf;
6597 next[len] = '\0';
6598
6599 while ((cur = strsep(&next, ",;\n"))) {
6600 int n;
6601 int end;
6602 char cmd;
6603 int memcg_id;
6604 int nid;
6605 unsigned long seq;
6606 int swappiness = -1;
6607 unsigned long nr_to_reclaim = -1;
6608
6609 cur = skip_spaces(cur);
6610 if (!*cur)
6611 continue;
6612
> 6613 n = sscanf(cur, "%c %u %u %lu %n %u %n %lu %n", &cmd, &memcg_id, &nid,
6614 &seq, &end, &swappiness, &end, &nr_to_reclaim, &end);
6615 if (n < 4 || cur[end]) {
6616 err = -EINVAL;
6617 break;
6618 }
6619
6620 err = advance_seq(cmd, memcg_id, nid, seq, swappiness, nr_to_reclaim);
6621 if (err)
6622 break;
6623 }
6624
6625 kvfree(buf);
6626
6627 return err ? : len;
6628 }
6629
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
next prev parent reply other threads:[~2021-04-13 22:39 UTC|newest]
Thread overview: 61+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-13 6:56 [PATCH v2 00/16] Multigenerational LRU Framework Yu Zhao
2021-04-13 6:56 ` [PATCH v2 01/16] include/linux/memcontrol.h: do not warn in page_memcg_rcu() if !CONFIG_MEMCG Yu Zhao
2021-04-13 6:56 ` [PATCH v2 02/16] include/linux/nodemask.h: define next_memory_node() if !CONFIG_NUMA Yu Zhao
2021-04-13 6:56 ` [PATCH v2 03/16] include/linux/huge_mm.h: define is_huge_zero_pmd() if !CONFIG_TRANSPARENT_HUGEPAGE Yu Zhao
2021-04-13 6:56 ` [PATCH v2 04/16] include/linux/cgroup.h: export cgroup_mutex Yu Zhao
2021-04-13 6:56 ` [PATCH v2 05/16] mm/swap.c: export activate_page() Yu Zhao
2021-04-13 6:56 ` [PATCH v2 06/16] mm, x86: support the access bit on non-leaf PMD entries Yu Zhao
2021-04-13 6:56 ` [PATCH v2 07/16] mm/vmscan.c: refactor shrink_node() Yu Zhao
2021-04-13 6:56 ` [PATCH v2 08/16] mm: multigenerational lru: groundwork Yu Zhao
2021-04-13 6:56 ` [PATCH v2 09/16] mm: multigenerational lru: activation Yu Zhao
2021-04-13 6:56 ` [PATCH v2 10/16] mm: multigenerational lru: mm_struct list Yu Zhao
2021-04-14 14:36 ` Matthew Wilcox
2021-04-13 6:56 ` [PATCH v2 11/16] mm: multigenerational lru: aging Yu Zhao
2021-04-13 6:56 ` [PATCH v2 12/16] mm: multigenerational lru: eviction Yu Zhao
2021-04-13 6:56 ` [PATCH v2 13/16] mm: multigenerational lru: page reclaim Yu Zhao
2021-04-13 6:56 ` [PATCH v2 14/16] mm: multigenerational lru: user interface Yu Zhao
2021-04-13 22:39 ` kernel test robot [this message]
2021-04-13 6:56 ` [PATCH v2 15/16] mm: multigenerational lru: Kconfig Yu Zhao
2021-04-13 16:19 ` kernel test robot
2021-04-14 4:54 ` kernel test robot
2021-04-13 6:56 ` [PATCH v2 16/16] mm: multigenerational lru: documentation Yu Zhao
2021-04-13 7:51 ` [PATCH v2 00/16] Multigenerational LRU Framework SeongJae Park
2021-04-13 16:13 ` Jens Axboe
2021-04-13 16:42 ` SeongJae Park
2021-04-13 23:14 ` Dave Chinner
2021-04-14 2:29 ` Rik van Riel
2021-04-14 4:13 ` Yu Zhao
2021-04-14 6:15 ` Huang, Ying
2021-04-14 7:58 ` Yu Zhao
2021-04-14 8:27 ` Huang, Ying
2021-04-14 13:51 ` Rik van Riel
2021-04-14 15:56 ` Andi Kleen
2021-04-14 15:58 ` [page-reclaim] " Shakeel Butt
2021-04-14 18:45 ` Yu Zhao
2021-04-14 15:51 ` Andi Kleen
2021-04-14 15:58 ` Rik van Riel
2021-04-14 19:14 ` Yu Zhao
2021-04-14 19:41 ` Rik van Riel
2021-04-14 20:08 ` Yu Zhao
2021-04-14 19:04 ` Yu Zhao
2021-04-15 3:00 ` Andi Kleen
2021-04-15 7:13 ` Yu Zhao
2021-04-15 8:19 ` Huang, Ying
2021-04-15 9:57 ` Michel Lespinasse
2021-04-24 2:33 ` Yu Zhao
2021-04-24 3:30 ` Andi Kleen
2021-04-24 4:16 ` Yu Zhao
2021-04-14 3:40 ` Yu Zhao
2021-04-14 4:50 ` Dave Chinner
2021-04-14 7:16 ` Yu Zhao
2021-04-14 10:00 ` Yu Zhao
2021-04-15 1:36 ` Dave Chinner
2021-04-24 21:21 ` Yu Zhao
2021-04-14 14:43 ` Jens Axboe
2021-04-14 19:42 ` Yu Zhao
2021-04-15 1:21 ` Dave Chinner
2021-04-14 17:43 ` Johannes Weiner
2021-04-27 10:35 ` Yu Zhao
2021-04-29 23:46 ` Konstantin Kharlamov
2021-04-30 6:37 ` Konstantin Kharlamov
2021-04-30 19:31 ` Yu Zhao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202104140636.BHTZxlS1-lkp@intel.com \
--to=lkp@intel.com \
--cc=ak@linux.intel.com \
--cc=akpm@linux-foundation.org \
--cc=alexs@kernel.org \
--cc=axboe@kernel.dk \
--cc=ben.manes@gmail.com \
--cc=dave.hansen@linux.intel.com \
--cc=david@fromorbit.com \
--cc=hdanton@sina.com \
--cc=kbuild-all@lists.01.org \
--cc=linux-mm@kvack.org \
--cc=yuzhao@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox