From: kernel test robot <lkp@intel.com>
To: Xin Hao <xhao@linux.alibaba.com>, sjpark@amazon.de
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org,
xhao@linux.alibaba.com, akpm@linux-foundation.org,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/damon/dbgfs: add region_stat interface
Date: Wed, 13 Oct 2021 01:16:21 +0800 [thread overview]
Message-ID: <202110130145.WhgfjXoM-lkp@intel.com> (raw)
In-Reply-To: <20211012054948.90381-1-xhao@linux.alibaba.com>
[-- Attachment #1: Type: text/plain, Size: 3625 bytes --]
Hi Xin,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on v5.15-rc5]
[cannot apply to hnaz-mm/master next-20211012]
[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/Xin-Hao/mm-damon-dbgfs-add-region_stat-interface/20211012-135023
base: 64570fbc14f8d7cb3fe3995f20e26bc25ce4b2cc
config: arm64-randconfig-r014-20211012 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project c3dcf39554dbea780d6cb7e12239451ba47a2668)
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 arm64 cross compiling tool for clang build
# apt-get install binutils-aarch64-linux-gnu
# https://github.com/0day-ci/linux/commit/256bdd48bd7719684cd8adbbda8a9df3dc9c1008
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Xin-Hao/mm-damon-dbgfs-add-region_stat-interface/20211012-135023
git checkout 256bdd48bd7719684cd8adbbda8a9df3dc9c1008
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=arm64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> mm/damon/dbgfs.c:311:3: warning: variable 'len' is uninitialized when used here [-Wuninitialized]
len += simple_read_from_buffer(buf, count, ppos, kbuf, written);
^~~
mm/damon/dbgfs.c:275:13: note: initialize the variable 'len' to silence this warning
ssize_t len;
^
= 0
1 warning generated.
vim +/len +311 mm/damon/dbgfs.c
268
269 static ssize_t dbgfs_region_stat_read(struct file *file,
270 char __user *buf, size_t count, loff_t *ppos)
271 {
272 struct damon_ctx *ctx = file->private_data;
273 struct damon_target *t;
274 char *kbuf;
275 ssize_t len;
276 int id, rc, written = 0;
277
278 kbuf = kmalloc(count, GFP_KERNEL);
279 if (!kbuf)
280 return -ENOMEM;
281
282 mutex_lock(&ctx->kdamond_lock);
283 damon_for_each_target(t, ctx) {
284 struct damon_region *r;
285
286 if (targetid_is_pid(ctx))
287 id = (int)pid_vnr((struct pid *)t->id);
288
289 rc = scnprintf(&kbuf[written], count - written,
290 "last_aggregation=%lld.%lds\ntarget_id=%d\nnr_regions=%u\n",
291 ctx->last_aggregation.tv_sec,
292 ctx->last_aggregation.tv_nsec / 1000000,
293 id, t->nr_regions);
294 if (!rc)
295 goto out;
296
297 written += rc;
298
299 damon_for_each_region(r, t) {
300 rc = scnprintf(&kbuf[written], count - written,
301 "%lx-%lx(%lu KiB): %u\n",
302 r->ar.start, r->ar.end,
303 (r->ar.end - r->ar.start) >> 10,
304 r->nr_accesses);
305 if (!rc)
306 goto out;
307
308 written += rc;
309 }
310
> 311 len += simple_read_from_buffer(buf, count, ppos, kbuf, written);
312 }
313
314 out:
315 mutex_unlock(&ctx->kdamond_lock);
316 kfree(kbuf);
317 return len;
318 }
319
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 44811 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH] mm/damon/dbgfs: add region_stat interface
Date: Wed, 13 Oct 2021 01:16:21 +0800 [thread overview]
Message-ID: <202110130145.WhgfjXoM-lkp@intel.com> (raw)
In-Reply-To: <20211012054948.90381-1-xhao@linux.alibaba.com>
[-- Attachment #1: Type: text/plain, Size: 3726 bytes --]
Hi Xin,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on v5.15-rc5]
[cannot apply to hnaz-mm/master next-20211012]
[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/Xin-Hao/mm-damon-dbgfs-add-region_stat-interface/20211012-135023
base: 64570fbc14f8d7cb3fe3995f20e26bc25ce4b2cc
config: arm64-randconfig-r014-20211012 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project c3dcf39554dbea780d6cb7e12239451ba47a2668)
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 arm64 cross compiling tool for clang build
# apt-get install binutils-aarch64-linux-gnu
# https://github.com/0day-ci/linux/commit/256bdd48bd7719684cd8adbbda8a9df3dc9c1008
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Xin-Hao/mm-damon-dbgfs-add-region_stat-interface/20211012-135023
git checkout 256bdd48bd7719684cd8adbbda8a9df3dc9c1008
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=arm64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> mm/damon/dbgfs.c:311:3: warning: variable 'len' is uninitialized when used here [-Wuninitialized]
len += simple_read_from_buffer(buf, count, ppos, kbuf, written);
^~~
mm/damon/dbgfs.c:275:13: note: initialize the variable 'len' to silence this warning
ssize_t len;
^
= 0
1 warning generated.
vim +/len +311 mm/damon/dbgfs.c
268
269 static ssize_t dbgfs_region_stat_read(struct file *file,
270 char __user *buf, size_t count, loff_t *ppos)
271 {
272 struct damon_ctx *ctx = file->private_data;
273 struct damon_target *t;
274 char *kbuf;
275 ssize_t len;
276 int id, rc, written = 0;
277
278 kbuf = kmalloc(count, GFP_KERNEL);
279 if (!kbuf)
280 return -ENOMEM;
281
282 mutex_lock(&ctx->kdamond_lock);
283 damon_for_each_target(t, ctx) {
284 struct damon_region *r;
285
286 if (targetid_is_pid(ctx))
287 id = (int)pid_vnr((struct pid *)t->id);
288
289 rc = scnprintf(&kbuf[written], count - written,
290 "last_aggregation=%lld.%lds\ntarget_id=%d\nnr_regions=%u\n",
291 ctx->last_aggregation.tv_sec,
292 ctx->last_aggregation.tv_nsec / 1000000,
293 id, t->nr_regions);
294 if (!rc)
295 goto out;
296
297 written += rc;
298
299 damon_for_each_region(r, t) {
300 rc = scnprintf(&kbuf[written], count - written,
301 "%lx-%lx(%lu KiB): %u\n",
302 r->ar.start, r->ar.end,
303 (r->ar.end - r->ar.start) >> 10,
304 r->nr_accesses);
305 if (!rc)
306 goto out;
307
308 written += rc;
309 }
310
> 311 len += simple_read_from_buffer(buf, count, ppos, kbuf, written);
312 }
313
314 out:
315 mutex_unlock(&ctx->kdamond_lock);
316 kfree(kbuf);
317 return len;
318 }
319
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 44811 bytes --]
next prev parent reply other threads:[~2021-10-12 17:19 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-12 5:49 [PATCH] mm/damon/dbgfs: add region_stat interface Xin Hao
2021-10-12 7:11 ` SeongJae Park
2021-10-12 7:57 ` Xin Hao
2021-10-12 9:37 ` SeongJae Park
2021-10-12 17:16 ` kernel test robot [this message]
2021-10-12 17:16 ` kernel test robot
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=202110130145.WhgfjXoM-lkp@intel.com \
--to=lkp@intel.com \
--cc=akpm@linux-foundation.org \
--cc=kbuild-all@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=llvm@lists.linux.dev \
--cc=sjpark@amazon.de \
--cc=xhao@linux.alibaba.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.