* [PATCH] mm/damon/sysfs: fix pid leak under fvaddr ops use case
@ 2022-05-03 22:05 SeongJae Park
2022-05-04 2:53 ` kernel test robot
0 siblings, 1 reply; 5+ messages in thread
From: SeongJae Park @ 2022-05-03 22:05 UTC (permalink / raw)
To: akpm; +Cc: damon, linux-mm, linux-kernel, SeongJae Park
Commit c83136469313 ("mm/damon/sysfs: support fixed virtual address
ranges monitoring") in 'mm-unstable' does not put the monitoring target
pid when fvaddr ops is used. This commit fixes it to put pid properly.
Andrew, please merge this into the 'mm-unstable' commit
("mm/damon/sysfs: support fixed virtual address ranges monitoring").
Fixes: c83136469313 ("mm/damon/sysfs: support fixed virtual address ranges monitoring")
Signed-off-by: SeongJae Park <sj@kernel.org>
---
mm/damon/sysfs.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/mm/damon/sysfs.c b/mm/damon/sysfs.c
index 767ab8c33e4d..f753bb405101 100644
--- a/mm/damon/sysfs.c
+++ b/mm/damon/sysfs.c
@@ -2086,7 +2086,8 @@ static void damon_sysfs_destroy_targets(struct damon_ctx *ctx)
struct damon_target *t, *next;
damon_for_each_target_safe(t, next, ctx) {
- if (ctx->ops.id == DAMON_OPS_VADDR)
+ if (ctx->ops.id == DAMON_OPS_VADDR ||
+ ctx->ops.id == DAMON_OPS_FVADDR)
put_pid(t->pid);
damon_destroy_target(t);
}
@@ -2204,7 +2205,7 @@ static void damon_sysfs_before_terminate(struct damon_ctx *ctx)
{
struct damon_target *t, *next;
- if (ctx->ops.id != DAMON_OPS_VADDR)
+ if (ctx->ops.id != DAMON_OPS_VADDR && ctx->ops.id != DAMON_OPS_FVADDR)
return;
mutex_lock(&ctx->kdamond_lock);
--
2.25.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] mm/damon/sysfs: fix pid leak under fvaddr ops use case
2022-05-03 22:05 [PATCH] mm/damon/sysfs: fix pid leak under fvaddr ops use case SeongJae Park
@ 2022-05-04 2:53 ` kernel test robot
2022-05-04 17:16 ` SeongJae Park
0 siblings, 1 reply; 5+ messages in thread
From: kernel test robot @ 2022-05-04 2:53 UTC (permalink / raw)
To: SeongJae Park; +Cc: llvm, kbuild-all
Hi SeongJae,
I love your patch! Yet something to improve:
[auto build test ERROR on hnaz-mm/master]
url: https://github.com/intel-lab-lkp/linux/commits/SeongJae-Park/mm-damon-sysfs-fix-pid-leak-under-fvaddr-ops-use-case/20220504-060657
base: https://github.com/hnaz/linux-mm master
config: hexagon-randconfig-r045-20220501 (https://download.01.org/0day-ci/archive/20220504/202205041011.jv6vuDe4-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 363b3a645a1e30011cc8da624f13dac5fd915628)
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
# https://github.com/intel-lab-lkp/linux/commit/60cfe4571b04ef4ca2e34793fbad737bb43dc0c6
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review SeongJae-Park/mm-damon-sysfs-fix-pid-leak-under-fvaddr-ops-use-case/20220504-060657
git checkout 60cfe4571b04ef4ca2e34793fbad737bb43dc0c6
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash mm/damon/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
>> mm/damon/sysfs.c:2089:20: error: use of undeclared identifier 'DAMON_OPS_FVADDR'; did you mean 'DAMON_OPS_VADDR'?
ctx->ops.id == DAMON_OPS_FVADDR)
^~~~~~~~~~~~~~~~
DAMON_OPS_VADDR
include/linux/damon.h:267:2: note: 'DAMON_OPS_VADDR' declared here
DAMON_OPS_VADDR,
^
mm/damon/sysfs.c:2206:55: error: use of undeclared identifier 'DAMON_OPS_FVADDR'; did you mean 'DAMON_OPS_VADDR'?
if (ctx->ops.id != DAMON_OPS_VADDR && ctx->ops.id != DAMON_OPS_FVADDR)
^~~~~~~~~~~~~~~~
DAMON_OPS_VADDR
include/linux/damon.h:267:2: note: 'DAMON_OPS_VADDR' declared here
DAMON_OPS_VADDR,
^
2 errors generated.
vim +2089 mm/damon/sysfs.c
2082
2083 static void damon_sysfs_destroy_targets(struct damon_ctx *ctx)
2084 {
2085 struct damon_target *t, *next;
2086
2087 damon_for_each_target_safe(t, next, ctx) {
2088 if (ctx->ops.id == DAMON_OPS_VADDR ||
> 2089 ctx->ops.id == DAMON_OPS_FVADDR)
2090 put_pid(t->pid);
2091 damon_destroy_target(t);
2092 }
2093 }
2094
--
0-DAY CI Kernel Test Service
https://01.org/lkp
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH] mm/damon/sysfs: fix pid leak under fvaddr ops use case
2022-05-04 2:53 ` kernel test robot
@ 2022-05-04 17:16 ` SeongJae Park
0 siblings, 0 replies; 5+ messages in thread
From: SeongJae Park @ 2022-05-04 17:16 UTC (permalink / raw)
To: kernel test robot; +Cc: SeongJae Park, llvm, kbuild-all
On Wed, 4 May 2022 10:53:47 +0800 kernel test robot <lkp@intel.com> wrote:
> Hi SeongJae,
>
> I love your patch! Yet something to improve:
>
> [auto build test ERROR on hnaz-mm/master]
This patch is on top of mm-unstable branch of akpm's mm tree. More
specifically, this patch depends on a commit[1] on the tree. So, this error
shouldn't occur on top of the tree.
If I'm missing something, please let me know.
[0] git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
[1] https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git/commit/?h=mm-unstable&id=cb52aff4ed86a5992309bc7efc228303a7dc084d
Thanks,
SJ
>
> url: https://github.com/intel-lab-lkp/linux/commits/SeongJae-Park/mm-dam=
> on-sysfs-fix-pid-leak-under-fvaddr-ops-use-case/20220504-060657
> base: https://github.com/hnaz/linux-mm master
> config: hexagon-randconfig-r045-20220501 (https://download.01.org/0day-ci/a=
> rchive/20220504/202205041011.jv6vuDe4-lkp@intel.com/config)
> compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 363b3a=
> 645a1e30011cc8da624f13dac5fd915628)
> reproduce (this is a W=3D1 build):
> wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/=
> make.cross -O ~/bin/make.cross
> chmod +x ~/bin/make.cross
> # https://github.com/intel-lab-lkp/linux/commit/60cfe4571b04ef4ca2e=
> 34793fbad737bb43dc0c6
> git remote add linux-review https://github.com/intel-lab-lkp/linux
> git fetch --no-tags linux-review SeongJae-Park/mm-damon-sysfs-fix-p=
> id-leak-under-fvaddr-ops-use-case/20220504-060657
> git checkout 60cfe4571b04ef4ca2e34793fbad737bb43dc0c6
> # save the config file
> mkdir build_dir && cp config build_dir/.config
> COMPILER_INSTALL_PATH=3D$HOME/0day COMPILER=3Dclang make.cross W=3D=
> 1 O=3Dbuild_dir ARCH=3Dhexagon SHELL=3D/bin/bash mm/damon/
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
>
> All errors (new ones prefixed by >>):
>
> >> mm/damon/sysfs.c:2089:20: error: use of undeclared identifier 'DAMON_OPS=
> _FVADDR'; did you mean 'DAMON_OPS_VADDR'?
> ctx->ops.id =3D=3D DAMON_OPS_FVADDR)
> ^~~~~~~~~~~~~~~~
> DAMON_OPS_VADDR
> include/linux/damon.h:267:2: note: 'DAMON_OPS_VADDR' declared here
> DAMON_OPS_VADDR,
> ^
> mm/damon/sysfs.c:2206:55: error: use of undeclared identifier 'DAMON_OPS=
> _FVADDR'; did you mean 'DAMON_OPS_VADDR'?
> if (ctx->ops.id !=3D DAMON_OPS_VADDR && ctx->ops.id !=3D DAMON_O=
> PS_FVADDR)
> ^~~~~~~~~~~=
> ~~~~~
> DAMON_OPS_V=
> ADDR
> include/linux/damon.h:267:2: note: 'DAMON_OPS_VADDR' declared here
> DAMON_OPS_VADDR,
> ^
> 2 errors generated.
>
>
> vim +2089 mm/damon/sysfs.c
>
> 2082
> 2083 static void damon_sysfs_destroy_targets(struct damon_ctx *ctx)
> 2084 {
> 2085 struct damon_target *t, *next;
> 2086
> 2087 damon_for_each_target_safe(t, next, ctx) {
> 2088 if (ctx->ops.id =3D=3D DAMON_OPS_VADDR ||
> > 2089 ctx->ops.id =3D=3D DAMON_OPS_FVADDR=
> )
> 2090 put_pid(t->pid);
> 2091 damon_destroy_target(t);
> 2092 }
> 2093 }
> 2094
>
> --
> 0-DAY CI Kernel Test Service
> https://01.org/lkp
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mm/damon/sysfs: fix pid leak under fvaddr ops use case
@ 2022-05-04 17:16 ` SeongJae Park
0 siblings, 0 replies; 5+ messages in thread
From: SeongJae Park @ 2022-05-04 17:16 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 3709 bytes --]
On Wed, 4 May 2022 10:53:47 +0800 kernel test robot <lkp@intel.com> wrote:
> Hi SeongJae,
>
> I love your patch! Yet something to improve:
>
> [auto build test ERROR on hnaz-mm/master]
This patch is on top of mm-unstable branch of akpm's mm tree. More
specifically, this patch depends on a commit[1] on the tree. So, this error
shouldn't occur on top of the tree.
If I'm missing something, please let me know.
[0] git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
[1] https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git/commit/?h=mm-unstable&id=cb52aff4ed86a5992309bc7efc228303a7dc084d
Thanks,
SJ
>
> url: https://github.com/intel-lab-lkp/linux/commits/SeongJae-Park/mm-dam=
> on-sysfs-fix-pid-leak-under-fvaddr-ops-use-case/20220504-060657
> base: https://github.com/hnaz/linux-mm master
> config: hexagon-randconfig-r045-20220501 (https://download.01.org/0day-ci/a=
> rchive/20220504/202205041011.jv6vuDe4-lkp(a)intel.com/config)
> compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 363b3a=
> 645a1e30011cc8da624f13dac5fd915628)
> reproduce (this is a W=3D1 build):
> wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/=
> make.cross -O ~/bin/make.cross
> chmod +x ~/bin/make.cross
> # https://github.com/intel-lab-lkp/linux/commit/60cfe4571b04ef4ca2e=
> 34793fbad737bb43dc0c6
> git remote add linux-review https://github.com/intel-lab-lkp/linux
> git fetch --no-tags linux-review SeongJae-Park/mm-damon-sysfs-fix-p=
> id-leak-under-fvaddr-ops-use-case/20220504-060657
> git checkout 60cfe4571b04ef4ca2e34793fbad737bb43dc0c6
> # save the config file
> mkdir build_dir && cp config build_dir/.config
> COMPILER_INSTALL_PATH=3D$HOME/0day COMPILER=3Dclang make.cross W=3D=
> 1 O=3Dbuild_dir ARCH=3Dhexagon SHELL=3D/bin/bash mm/damon/
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
>
> All errors (new ones prefixed by >>):
>
> >> mm/damon/sysfs.c:2089:20: error: use of undeclared identifier 'DAMON_OPS=
> _FVADDR'; did you mean 'DAMON_OPS_VADDR'?
> ctx->ops.id =3D=3D DAMON_OPS_FVADDR)
> ^~~~~~~~~~~~~~~~
> DAMON_OPS_VADDR
> include/linux/damon.h:267:2: note: 'DAMON_OPS_VADDR' declared here
> DAMON_OPS_VADDR,
> ^
> mm/damon/sysfs.c:2206:55: error: use of undeclared identifier 'DAMON_OPS=
> _FVADDR'; did you mean 'DAMON_OPS_VADDR'?
> if (ctx->ops.id !=3D DAMON_OPS_VADDR && ctx->ops.id !=3D DAMON_O=
> PS_FVADDR)
> ^~~~~~~~~~~=
> ~~~~~
> DAMON_OPS_V=
> ADDR
> include/linux/damon.h:267:2: note: 'DAMON_OPS_VADDR' declared here
> DAMON_OPS_VADDR,
> ^
> 2 errors generated.
>
>
> vim +2089 mm/damon/sysfs.c
>
> 2082
> 2083 static void damon_sysfs_destroy_targets(struct damon_ctx *ctx)
> 2084 {
> 2085 struct damon_target *t, *next;
> 2086
> 2087 damon_for_each_target_safe(t, next, ctx) {
> 2088 if (ctx->ops.id =3D=3D DAMON_OPS_VADDR ||
> > 2089 ctx->ops.id =3D=3D DAMON_OPS_FVADDR=
> )
> 2090 put_pid(t->pid);
> 2091 damon_destroy_target(t);
> 2092 }
> 2093 }
> 2094
>
> --
> 0-DAY CI Kernel Test Service
> https://01.org/lkp
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [kbuild-all] Re: [PATCH] mm/damon/sysfs: fix pid leak under fvaddr ops use case
2022-05-04 17:16 ` SeongJae Park
(?)
@ 2022-05-06 8:19 ` Chen, Rong A
-1 siblings, 0 replies; 5+ messages in thread
From: Chen, Rong A @ 2022-05-06 8:19 UTC (permalink / raw)
To: SeongJae Park, kernel test robot; +Cc: llvm, kbuild-all
On 5/5/2022 1:16 AM, SeongJae Park wrote:
> On Wed, 4 May 2022 10:53:47 +0800 kernel test robot <lkp@intel.com> wrote:
>
>> Hi SeongJae,
>>
>> I love your patch! Yet something to improve:
>>
>> [auto build test ERROR on hnaz-mm/master]
>
> This patch is on top of mm-unstable branch of akpm's mm tree. More
> specifically, this patch depends on a commit[1] on the tree. So, this error
> shouldn't occur on top of the tree.
Hi SJ,
Thanks for your feedback, it's helpful to improve our system.
Best Regards,
Rong Chen
>
> If I'm missing something, please let me know.
>
> [0] git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
> [1] https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git/commit/?h=mm-unstable&id=cb52aff4ed86a5992309bc7efc228303a7dc084d
>
>
> Thanks,
> SJ
>
>>
>> url: https://github.com/intel-lab-lkp/linux/commits/SeongJae-Park/mm-dam=
>> on-sysfs-fix-pid-leak-under-fvaddr-ops-use-case/20220504-060657
>> base: https://github.com/hnaz/linux-mm master
>> config: hexagon-randconfig-r045-20220501 (https://download.01.org/0day-ci/a=
>> rchive/20220504/202205041011.jv6vuDe4-lkp@intel.com/config)
>> compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 363b3a=
>> 645a1e30011cc8da624f13dac5fd915628)
>> reproduce (this is a W=3D1 build):
>> wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/=
>> make.cross -O ~/bin/make.cross
>> chmod +x ~/bin/make.cross
>> # https://github.com/intel-lab-lkp/linux/commit/60cfe4571b04ef4ca2e=
>> 34793fbad737bb43dc0c6
>> git remote add linux-review https://github.com/intel-lab-lkp/linux
>> git fetch --no-tags linux-review SeongJae-Park/mm-damon-sysfs-fix-p=
>> id-leak-under-fvaddr-ops-use-case/20220504-060657
>> git checkout 60cfe4571b04ef4ca2e34793fbad737bb43dc0c6
>> # save the config file
>> mkdir build_dir && cp config build_dir/.config
>> COMPILER_INSTALL_PATH=3D$HOME/0day COMPILER=3Dclang make.cross W=3D=
>> 1 O=3Dbuild_dir ARCH=3Dhexagon SHELL=3D/bin/bash mm/damon/
>>
>> If you fix the issue, kindly add following tag as appropriate
>> Reported-by: kernel test robot <lkp@intel.com>
>>
>> All errors (new ones prefixed by >>):
>>
>>>> mm/damon/sysfs.c:2089:20: error: use of undeclared identifier 'DAMON_OPS=
>> _FVADDR'; did you mean 'DAMON_OPS_VADDR'?
>> ctx->ops.id =3D=3D DAMON_OPS_FVADDR)
>> ^~~~~~~~~~~~~~~~
>> DAMON_OPS_VADDR
>> include/linux/damon.h:267:2: note: 'DAMON_OPS_VADDR' declared here
>> DAMON_OPS_VADDR,
>> ^
>> mm/damon/sysfs.c:2206:55: error: use of undeclared identifier 'DAMON_OPS=
>> _FVADDR'; did you mean 'DAMON_OPS_VADDR'?
>> if (ctx->ops.id !=3D DAMON_OPS_VADDR && ctx->ops.id !=3D DAMON_O=
>> PS_FVADDR)
>> ^~~~~~~~~~~=
>> ~~~~~
>> DAMON_OPS_V=
>> ADDR
>> include/linux/damon.h:267:2: note: 'DAMON_OPS_VADDR' declared here
>> DAMON_OPS_VADDR,
>> ^
>> 2 errors generated.
>>
>>
>> vim +2089 mm/damon/sysfs.c
>>
>> 2082
>> 2083 static void damon_sysfs_destroy_targets(struct damon_ctx *ctx)
>> 2084 {
>> 2085 struct damon_target *t, *next;
>> 2086
>> 2087 damon_for_each_target_safe(t, next, ctx) {
>> 2088 if (ctx->ops.id =3D=3D DAMON_OPS_VADDR ||
>>> 2089 ctx->ops.id =3D=3D DAMON_OPS_FVADDR=
>> )
>> 2090 put_pid(t->pid);
>> 2091 damon_destroy_target(t);
>> 2092 }
>> 2093 }
>> 2094
>>
>> --
>> 0-DAY CI Kernel Test Service
>> https://01.org/lkp
>>
> _______________________________________________
> kbuild-all mailing list -- kbuild-all@lists.01.org
> To unsubscribe send an email to kbuild-all-leave@lists.01.org
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-05-06 8:19 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-03 22:05 [PATCH] mm/damon/sysfs: fix pid leak under fvaddr ops use case SeongJae Park
2022-05-04 2:53 ` kernel test robot
2022-05-04 17:16 ` SeongJae Park
2022-05-04 17:16 ` SeongJae Park
2022-05-06 8:19 ` [kbuild-all] " Chen, Rong A
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.