linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V1 1/2] mm/damon/dbgfs: Modify Damon dbfs interface dependency in Kconfig
@ 2021-11-20 17:27 Xin Hao
  2021-11-20 17:27 ` [PATCH V1 2/2] mm/damon: move damon_rand definition into damon.h Xin Hao
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Xin Hao @ 2021-11-20 17:27 UTC (permalink / raw)
  To: sj; +Cc: xhao, akpm, linux-mm, linux-kernel

If you want to support "DAMON_DBGFS" in config file, it only depends on
any one of "DAMON_VADDR" and "DAMON_PADDR".

Signed-off-by: Xin Hao <xhao@linux.alibaba.com>
---
 mm/damon/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/damon/Kconfig b/mm/damon/Kconfig
index 5bcf05851ad0..971ffc496596 100644
--- a/mm/damon/Kconfig
+++ b/mm/damon/Kconfig
@@ -54,7 +54,7 @@ config DAMON_VADDR_KUNIT_TEST
 
 config DAMON_DBGFS
 	bool "DAMON debugfs interface"
-	depends on DAMON_VADDR && DAMON_PADDR && DEBUG_FS
+	depends on DAMON_VADDR || DAMON_PADDR && DEBUG_FS
 	help
 	  This builds the debugfs interface for DAMON.  The user space admins
 	  can use the interface for arbitrary data access monitoring.
-- 
2.31.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH V1 2/2] mm/damon: move damon_rand definition into damon.h
  2021-11-20 17:27 [PATCH V1 1/2] mm/damon/dbgfs: Modify Damon dbfs interface dependency in Kconfig Xin Hao
@ 2021-11-20 17:27 ` Xin Hao
  2021-11-21 11:33   ` SeongJae Park
  2021-11-21 11:24 ` [PATCH V1 1/2] mm/damon/dbgfs: Modify Damon dbfs interface dependency in Kconfig SeongJae Park
  2021-11-26  3:51 ` kernel test robot
  2 siblings, 1 reply; 7+ messages in thread
From: Xin Hao @ 2021-11-20 17:27 UTC (permalink / raw)
  To: sj; +Cc: xhao, akpm, linux-mm, linux-kernel

damon_rand() is called in three files:damon/core.c, damon/
paddr.c, damon/vaddr.c, i think there is no need to redefine
this twice, So move it to damon.h will be a good choice.

Signed-off-by: Xin Hao <xhao@linux.alibaba.com>
---
 include/linux/damon.h   | 4 ++++
 mm/damon/core.c         | 4 ----
 mm/damon/prmtv-common.h | 4 ----
 3 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/include/linux/damon.h b/include/linux/damon.h
index 8a73e825e0d5..8706b17a9acf 100644
--- a/include/linux/damon.h
+++ b/include/linux/damon.h
@@ -11,12 +11,16 @@
 #include <linux/mutex.h>
 #include <linux/time64.h>
 #include <linux/types.h>
+#include <linux/random.h>
 
 /* Minimal region size.  Every damon_region is aligned by this. */
 #define DAMON_MIN_REGION	PAGE_SIZE
 /* Max priority score for DAMON-based operation schemes */
 #define DAMOS_MAX_SCORE		(99)
 
+/* Get a random number in [l, r) */
+#define damon_rand(l, r) (l + prandom_u32_max(r - l))
+
 /**
  * struct damon_addr_range - Represents an address region of [@start, @end).
  * @start:	Start address of the region (inclusive).
diff --git a/mm/damon/core.c b/mm/damon/core.c
index 4d2c3a0c7c8a..bdec32ef78c0 100644
--- a/mm/damon/core.c
+++ b/mm/damon/core.c
@@ -11,7 +11,6 @@
 #include <linux/delay.h>
 #include <linux/kthread.h>
 #include <linux/mm.h>
-#include <linux/random.h>
 #include <linux/slab.h>
 #include <linux/string.h>
 
@@ -23,9 +22,6 @@
 #define DAMON_MIN_REGION 1
 #endif
 
-/* Get a random number in [l, r) */
-#define damon_rand(l, r) (l + prandom_u32_max(r - l))
-
 static DEFINE_MUTEX(damon_lock);
 static int nr_running_ctxs;
 
diff --git a/mm/damon/prmtv-common.h b/mm/damon/prmtv-common.h
index 61f27037603e..e790cb5f8fe0 100644
--- a/mm/damon/prmtv-common.h
+++ b/mm/damon/prmtv-common.h
@@ -6,10 +6,6 @@
  */
 
 #include <linux/damon.h>
-#include <linux/random.h>
-
-/* Get a random number in [l, r) */
-#define damon_rand(l, r) (l + prandom_u32_max(r - l))
 
 struct page *damon_get_page(unsigned long pfn);
 
-- 
2.31.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH V1 1/2] mm/damon/dbgfs: Modify Damon dbfs interface dependency in Kconfig
  2021-11-20 17:27 [PATCH V1 1/2] mm/damon/dbgfs: Modify Damon dbfs interface dependency in Kconfig Xin Hao
  2021-11-20 17:27 ` [PATCH V1 2/2] mm/damon: move damon_rand definition into damon.h Xin Hao
@ 2021-11-21 11:24 ` SeongJae Park
  2021-11-21 13:19   ` Xin Hao
  2021-11-26  3:51 ` kernel test robot
  2 siblings, 1 reply; 7+ messages in thread
From: SeongJae Park @ 2021-11-21 11:24 UTC (permalink / raw)
  To: Xin Hao; +Cc: sj, akpm, linux-mm, linux-kernel

Hi Xin,

On Sun, 21 Nov 2021 01:27:53 +0800 Xin Hao <xhao@linux.alibaba.com> wrote:

> If you want to support "DAMON_DBGFS" in config file, it only depends on
> any one of "DAMON_VADDR" and "DAMON_PADDR".

This is not true.  DAMON_DBGFS really depends on both.

This patch even makes the build fails with some configs.

      CC      mm/damon/dbgfs.o
    linux/mm/damon/dbgfs.c: In function ‘dbgfs_target_ids_write’:
    linux/mm/damon/dbgfs.c:409:3: error: implicit declaration of function ‘damon_pa_set_primitives’; did you mean ‘damon_va_set_primitives’? [-Werror=implicit-function-declaration]
       damon_pa_set_primitives(ctx);
       ^~~~~~~~~~~~~~~~~~~~~~~
       damon_va_set_primitives
    cc1: some warnings being treated as errors


Thanks,
SJ

> 
> Signed-off-by: Xin Hao <xhao@linux.alibaba.com>
> ---
>  mm/damon/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/damon/Kconfig b/mm/damon/Kconfig
> index 5bcf05851ad0..971ffc496596 100644
> --- a/mm/damon/Kconfig
> +++ b/mm/damon/Kconfig
> @@ -54,7 +54,7 @@ config DAMON_VADDR_KUNIT_TEST
>  
>  config DAMON_DBGFS
>  	bool "DAMON debugfs interface"
> -	depends on DAMON_VADDR && DAMON_PADDR && DEBUG_FS
> +	depends on DAMON_VADDR || DAMON_PADDR && DEBUG_FS
>  	help
>  	  This builds the debugfs interface for DAMON.  The user space admins
>  	  can use the interface for arbitrary data access monitoring.
> -- 
> 2.31.0
> 
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH V1 2/2] mm/damon: move damon_rand definition into damon.h
  2021-11-20 17:27 ` [PATCH V1 2/2] mm/damon: move damon_rand definition into damon.h Xin Hao
@ 2021-11-21 11:33   ` SeongJae Park
  2021-11-21 13:20     ` Xin Hao
  0 siblings, 1 reply; 7+ messages in thread
From: SeongJae Park @ 2021-11-21 11:33 UTC (permalink / raw)
  To: Xin Hao; +Cc: sj, akpm, linux-mm, linux-kernel

Hi Xin,


On Sun, 21 Nov 2021 01:27:54 +0800 Xin Hao <xhao@linux.alibaba.com> wrote:

> damon_rand() is called in three files:damon/core.c, damon/
> paddr.c, damon/vaddr.c, i think there is no need to redefine
> this twice, So move it to damon.h will be a good choice.

Good finding.  Could you please append '()' after 'damon_rand' in the title
(s/damon_rand definition/damon_rand() definition)?

> 
> Signed-off-by: Xin Hao <xhao@linux.alibaba.com>

After doing that, you could add

Reviewed-by: SeongJae Park <sj@kernel.org>


Thanks,
SJ

> ---
>  include/linux/damon.h   | 4 ++++
>  mm/damon/core.c         | 4 ----
>  mm/damon/prmtv-common.h | 4 ----
>  3 files changed, 4 insertions(+), 8 deletions(-)
> 
> diff --git a/include/linux/damon.h b/include/linux/damon.h
> index 8a73e825e0d5..8706b17a9acf 100644
> --- a/include/linux/damon.h
> +++ b/include/linux/damon.h
> @@ -11,12 +11,16 @@
>  #include <linux/mutex.h>
>  #include <linux/time64.h>
>  #include <linux/types.h>
> +#include <linux/random.h>
>  
>  /* Minimal region size.  Every damon_region is aligned by this. */
>  #define DAMON_MIN_REGION	PAGE_SIZE
>  /* Max priority score for DAMON-based operation schemes */
>  #define DAMOS_MAX_SCORE		(99)
>  
> +/* Get a random number in [l, r) */
> +#define damon_rand(l, r) (l + prandom_u32_max(r - l))
> +
>  /**
>   * struct damon_addr_range - Represents an address region of [@start, @end).
>   * @start:	Start address of the region (inclusive).
> diff --git a/mm/damon/core.c b/mm/damon/core.c
> index 4d2c3a0c7c8a..bdec32ef78c0 100644
> --- a/mm/damon/core.c
> +++ b/mm/damon/core.c
> @@ -11,7 +11,6 @@
>  #include <linux/delay.h>
>  #include <linux/kthread.h>
>  #include <linux/mm.h>
> -#include <linux/random.h>
>  #include <linux/slab.h>
>  #include <linux/string.h>
>  
> @@ -23,9 +22,6 @@
>  #define DAMON_MIN_REGION 1
>  #endif
>  
> -/* Get a random number in [l, r) */
> -#define damon_rand(l, r) (l + prandom_u32_max(r - l))
> -
>  static DEFINE_MUTEX(damon_lock);
>  static int nr_running_ctxs;
>  
> diff --git a/mm/damon/prmtv-common.h b/mm/damon/prmtv-common.h
> index 61f27037603e..e790cb5f8fe0 100644
> --- a/mm/damon/prmtv-common.h
> +++ b/mm/damon/prmtv-common.h
> @@ -6,10 +6,6 @@
>   */
>  
>  #include <linux/damon.h>
> -#include <linux/random.h>
> -
> -/* Get a random number in [l, r) */
> -#define damon_rand(l, r) (l + prandom_u32_max(r - l))
>  
>  struct page *damon_get_page(unsigned long pfn);
>  
> -- 
> 2.31.0
> 
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH V1 1/2] mm/damon/dbgfs: Modify Damon dbfs interface dependency in Kconfig
  2021-11-21 11:24 ` [PATCH V1 1/2] mm/damon/dbgfs: Modify Damon dbfs interface dependency in Kconfig SeongJae Park
@ 2021-11-21 13:19   ` Xin Hao
  0 siblings, 0 replies; 7+ messages in thread
From: Xin Hao @ 2021-11-21 13:19 UTC (permalink / raw)
  To: SeongJae Park; +Cc: akpm, linux-mm, linux-kernel

Hi Park,

On 11/21/21 7:24 PM, SeongJae Park wrote:
> Hi Xin,
>
> On Sun, 21 Nov 2021 01:27:53 +0800 Xin Hao <xhao@linux.alibaba.com> wrote:
>
>> If you want to support "DAMON_DBGFS" in config file, it only depends on
>> any one of "DAMON_VADDR" and "DAMON_PADDR".
> This is not true.  DAMON_DBGFS really depends on both.
>
> This patch even makes the build fails with some configs.
>
>        CC      mm/damon/dbgfs.o
>      linux/mm/damon/dbgfs.c: In function ‘dbgfs_target_ids_write’:
>      linux/mm/damon/dbgfs.c:409:3: error: implicit declaration of function ‘damon_pa_set_primitives’; did you mean ‘damon_va_set_primitives’? [-Werror=implicit-function-declaration]
>         damon_pa_set_primitives(ctx);
>         ^~~~~~~~~~~~~~~~~~~~~~~
>         damon_va_set_primitives
>      cc1: some warnings being treated as errors

That is my fault,  i have found a solution, and i will send a v2 patch 
to solve it,  i I think DAMON_VADDR and DAMON_PADDR

must be decoupled,the kconfig must support it, becasue sometimes i don't 
want to use damon paddr function, just only need to include

DAMON_VADDR, therefore, it is not necessary to include damon/paddr.c 
during compile time.

>
>
> Thanks,
> SJ
>
>> Signed-off-by: Xin Hao <xhao@linux.alibaba.com>
>> ---
>>   mm/damon/Kconfig | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/mm/damon/Kconfig b/mm/damon/Kconfig
>> index 5bcf05851ad0..971ffc496596 100644
>> --- a/mm/damon/Kconfig
>> +++ b/mm/damon/Kconfig
>> @@ -54,7 +54,7 @@ config DAMON_VADDR_KUNIT_TEST
>>   
>>   config DAMON_DBGFS
>>   	bool "DAMON debugfs interface"
>> -	depends on DAMON_VADDR && DAMON_PADDR && DEBUG_FS
>> +	depends on DAMON_VADDR || DAMON_PADDR && DEBUG_FS
>>   	help
>>   	  This builds the debugfs interface for DAMON.  The user space admins
>>   	  can use the interface for arbitrary data access monitoring.
>> -- 
>> 2.31.0
>>
>>
-- 
Best Regards!
Xin Hao


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH V1 2/2] mm/damon: move damon_rand definition into damon.h
  2021-11-21 11:33   ` SeongJae Park
@ 2021-11-21 13:20     ` Xin Hao
  0 siblings, 0 replies; 7+ messages in thread
From: Xin Hao @ 2021-11-21 13:20 UTC (permalink / raw)
  To: SeongJae Park; +Cc: akpm, linux-mm, linux-kernel

Hi Park:

On 11/21/21 7:33 PM, SeongJae Park wrote:
> Hi Xin,
>
>
> On Sun, 21 Nov 2021 01:27:54 +0800 Xin Hao <xhao@linux.alibaba.com> wrote:
>
>> damon_rand() is called in three files:damon/core.c, damon/
>> paddr.c, damon/vaddr.c, i think there is no need to redefine
>> this twice, So move it to damon.h will be a good choice.
> Good finding.  Could you please append '()' after 'damon_rand' in the title
> (s/damon_rand definition/damon_rand() definition)?
Ok i will do;
>
>> Signed-off-by: Xin Hao <xhao@linux.alibaba.com>
> After doing that, you could add
>
> Reviewed-by: SeongJae Park <sj@kernel.org>
>
>
> Thanks,
> SJ
>
>> ---
>>   include/linux/damon.h   | 4 ++++
>>   mm/damon/core.c         | 4 ----
>>   mm/damon/prmtv-common.h | 4 ----
>>   3 files changed, 4 insertions(+), 8 deletions(-)
>>
>> diff --git a/include/linux/damon.h b/include/linux/damon.h
>> index 8a73e825e0d5..8706b17a9acf 100644
>> --- a/include/linux/damon.h
>> +++ b/include/linux/damon.h
>> @@ -11,12 +11,16 @@
>>   #include <linux/mutex.h>
>>   #include <linux/time64.h>
>>   #include <linux/types.h>
>> +#include <linux/random.h>
>>   
>>   /* Minimal region size.  Every damon_region is aligned by this. */
>>   #define DAMON_MIN_REGION	PAGE_SIZE
>>   /* Max priority score for DAMON-based operation schemes */
>>   #define DAMOS_MAX_SCORE		(99)
>>   
>> +/* Get a random number in [l, r) */
>> +#define damon_rand(l, r) (l + prandom_u32_max(r - l))
>> +
>>   /**
>>    * struct damon_addr_range - Represents an address region of [@start, @end).
>>    * @start:	Start address of the region (inclusive).
>> diff --git a/mm/damon/core.c b/mm/damon/core.c
>> index 4d2c3a0c7c8a..bdec32ef78c0 100644
>> --- a/mm/damon/core.c
>> +++ b/mm/damon/core.c
>> @@ -11,7 +11,6 @@
>>   #include <linux/delay.h>
>>   #include <linux/kthread.h>
>>   #include <linux/mm.h>
>> -#include <linux/random.h>
>>   #include <linux/slab.h>
>>   #include <linux/string.h>
>>   
>> @@ -23,9 +22,6 @@
>>   #define DAMON_MIN_REGION 1
>>   #endif
>>   
>> -/* Get a random number in [l, r) */
>> -#define damon_rand(l, r) (l + prandom_u32_max(r - l))
>> -
>>   static DEFINE_MUTEX(damon_lock);
>>   static int nr_running_ctxs;
>>   
>> diff --git a/mm/damon/prmtv-common.h b/mm/damon/prmtv-common.h
>> index 61f27037603e..e790cb5f8fe0 100644
>> --- a/mm/damon/prmtv-common.h
>> +++ b/mm/damon/prmtv-common.h
>> @@ -6,10 +6,6 @@
>>    */
>>   
>>   #include <linux/damon.h>
>> -#include <linux/random.h>
>> -
>> -/* Get a random number in [l, r) */
>> -#define damon_rand(l, r) (l + prandom_u32_max(r - l))
>>   
>>   struct page *damon_get_page(unsigned long pfn);
>>   
>> -- 
>> 2.31.0
>>
>>
-- 
Best Regards!
Xin Hao


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH V1 1/2] mm/damon/dbgfs: Modify Damon dbfs interface dependency in Kconfig
  2021-11-20 17:27 [PATCH V1 1/2] mm/damon/dbgfs: Modify Damon dbfs interface dependency in Kconfig Xin Hao
  2021-11-20 17:27 ` [PATCH V1 2/2] mm/damon: move damon_rand definition into damon.h Xin Hao
  2021-11-21 11:24 ` [PATCH V1 1/2] mm/damon/dbgfs: Modify Damon dbfs interface dependency in Kconfig SeongJae Park
@ 2021-11-26  3:51 ` kernel test robot
  2 siblings, 0 replies; 7+ messages in thread
From: kernel test robot @ 2021-11-26  3:51 UTC (permalink / raw)
  To: Xin Hao, sj; +Cc: llvm, kbuild-all, xhao, akpm, linux-mm, linux-kernel

Hi Xin,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on hnaz-mm/master]

url:    https://github.com/0day-ci/linux/commits/Xin-Hao/mm-damon-dbgfs-Modify-Damon-dbfs-interface-dependency-in-Kconfig/20211121-012819
base:   https://github.com/hnaz/linux-mm master
config: riscv-randconfig-c006-20211121 (https://download.01.org/0day-ci/archive/20211126/202111261116.0jysSfsO-lkp@intel.com/config)
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 riscv cross compiling tool for clang build
        # apt-get install binutils-riscv64-linux-gnu
        # https://github.com/0day-ci/linux/commit/496f4e2cc535ba7b71a6ff2b82840693d413ae02
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Xin-Hao/mm-damon-dbgfs-Modify-Damon-dbfs-interface-dependency-in-Kconfig/20211121-012819
        git checkout 496f4e2cc535ba7b71a6ff2b82840693d413ae02
        # save the config file to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=riscv 

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/dbgfs.c:409:3: error: implicit declaration of function 'damon_pa_set_primitives' [-Werror,-Wimplicit-function-declaration]
                   damon_pa_set_primitives(ctx);
                   ^
   mm/damon/dbgfs.c:409:3: note: did you mean 'damon_va_set_primitives'?
   include/linux/damon.h:476:6: note: 'damon_va_set_primitives' declared here
   void damon_va_set_primitives(struct damon_ctx *ctx);
        ^
   1 error generated.


vim +/damon_pa_set_primitives +409 mm/damon/dbgfs.c

4bc05954d00766 SeongJae Park 2021-09-07  353  
4bc05954d00766 SeongJae Park 2021-09-07  354  static ssize_t dbgfs_target_ids_write(struct file *file,
4bc05954d00766 SeongJae Park 2021-09-07  355  		const char __user *buf, size_t count, loff_t *ppos)
4bc05954d00766 SeongJae Park 2021-09-07  356  {
4bc05954d00766 SeongJae Park 2021-09-07  357  	struct damon_ctx *ctx = file->private_data;
2ba00bca84ef3f SeongJae Park 2021-10-28  358  	bool id_is_pid = true;
4bc05954d00766 SeongJae Park 2021-09-07  359  	char *kbuf, *nrs;
4bc05954d00766 SeongJae Park 2021-09-07  360  	unsigned long *targets;
4bc05954d00766 SeongJae Park 2021-09-07  361  	ssize_t nr_targets;
4f521143b7d82a Rongwei Wang  2021-10-28  362  	ssize_t ret;
4bc05954d00766 SeongJae Park 2021-09-07  363  	int i;
4bc05954d00766 SeongJae Park 2021-09-07  364  
4bc05954d00766 SeongJae Park 2021-09-07  365  	kbuf = user_input_str(buf, count, ppos);
4bc05954d00766 SeongJae Park 2021-09-07  366  	if (IS_ERR(kbuf))
4bc05954d00766 SeongJae Park 2021-09-07  367  		return PTR_ERR(kbuf);
4bc05954d00766 SeongJae Park 2021-09-07  368  
4bc05954d00766 SeongJae Park 2021-09-07  369  	nrs = kbuf;
2ba00bca84ef3f SeongJae Park 2021-10-28  370  	if (!strncmp(kbuf, "paddr\n", count)) {
2ba00bca84ef3f SeongJae Park 2021-10-28  371  		id_is_pid = false;
2ba00bca84ef3f SeongJae Park 2021-10-28  372  		/* target id is meaningless here, but we set it just for fun */
2ba00bca84ef3f SeongJae Park 2021-10-28  373  		scnprintf(kbuf, count, "42    ");
2ba00bca84ef3f SeongJae Park 2021-10-28  374  	}
4bc05954d00766 SeongJae Park 2021-09-07  375  
4f521143b7d82a Rongwei Wang  2021-10-28  376  	targets = str_to_target_ids(nrs, count, &nr_targets);
4bc05954d00766 SeongJae Park 2021-09-07  377  	if (!targets) {
4bc05954d00766 SeongJae Park 2021-09-07  378  		ret = -ENOMEM;
4bc05954d00766 SeongJae Park 2021-09-07  379  		goto out;
4bc05954d00766 SeongJae Park 2021-09-07  380  	}
4bc05954d00766 SeongJae Park 2021-09-07  381  
2ba00bca84ef3f SeongJae Park 2021-10-28  382  	if (id_is_pid) {
4bc05954d00766 SeongJae Park 2021-09-07  383  		for (i = 0; i < nr_targets; i++) {
4bc05954d00766 SeongJae Park 2021-09-07  384  			targets[i] = (unsigned long)find_get_pid(
4bc05954d00766 SeongJae Park 2021-09-07  385  					(int)targets[i]);
4bc05954d00766 SeongJae Park 2021-09-07  386  			if (!targets[i]) {
4bc05954d00766 SeongJae Park 2021-09-07  387  				dbgfs_put_pids(targets, i);
4bc05954d00766 SeongJae Park 2021-09-07  388  				ret = -EINVAL;
4bc05954d00766 SeongJae Park 2021-09-07  389  				goto free_targets_out;
4bc05954d00766 SeongJae Park 2021-09-07  390  			}
4bc05954d00766 SeongJae Park 2021-09-07  391  		}
4bc05954d00766 SeongJae Park 2021-09-07  392  	}
4bc05954d00766 SeongJae Park 2021-09-07  393  
4bc05954d00766 SeongJae Park 2021-09-07  394  	mutex_lock(&ctx->kdamond_lock);
4bc05954d00766 SeongJae Park 2021-09-07  395  	if (ctx->kdamond) {
2ba00bca84ef3f SeongJae Park 2021-10-28  396  		if (id_is_pid)
4bc05954d00766 SeongJae Park 2021-09-07  397  			dbgfs_put_pids(targets, nr_targets);
4bc05954d00766 SeongJae Park 2021-09-07  398  		ret = -EBUSY;
4bc05954d00766 SeongJae Park 2021-09-07  399  		goto unlock_out;
4bc05954d00766 SeongJae Park 2021-09-07  400  	}
4bc05954d00766 SeongJae Park 2021-09-07  401  
2ba00bca84ef3f SeongJae Park 2021-10-28  402  	/* remove targets with previously-set primitive */
2ba00bca84ef3f SeongJae Park 2021-10-28  403  	damon_set_targets(ctx, NULL, 0);
2ba00bca84ef3f SeongJae Park 2021-10-28  404  
2ba00bca84ef3f SeongJae Park 2021-10-28  405  	/* Configure the context for the address space type */
2ba00bca84ef3f SeongJae Park 2021-10-28  406  	if (id_is_pid)
2ba00bca84ef3f SeongJae Park 2021-10-28  407  		damon_va_set_primitives(ctx);
2ba00bca84ef3f SeongJae Park 2021-10-28  408  	else
2ba00bca84ef3f SeongJae Park 2021-10-28 @409  		damon_pa_set_primitives(ctx);
2ba00bca84ef3f SeongJae Park 2021-10-28  410  
4f521143b7d82a Rongwei Wang  2021-10-28  411  	ret = damon_set_targets(ctx, targets, nr_targets);
4f521143b7d82a Rongwei Wang  2021-10-28  412  	if (ret) {
2ba00bca84ef3f SeongJae Park 2021-10-28  413  		if (id_is_pid)
4bc05954d00766 SeongJae Park 2021-09-07  414  			dbgfs_put_pids(targets, nr_targets);
4f521143b7d82a Rongwei Wang  2021-10-28  415  	} else {
4f521143b7d82a Rongwei Wang  2021-10-28  416  		ret = count;
4bc05954d00766 SeongJae Park 2021-09-07  417  	}
4bc05954d00766 SeongJae Park 2021-09-07  418  
4bc05954d00766 SeongJae Park 2021-09-07  419  unlock_out:
4bc05954d00766 SeongJae Park 2021-09-07  420  	mutex_unlock(&ctx->kdamond_lock);
4bc05954d00766 SeongJae Park 2021-09-07  421  free_targets_out:
4bc05954d00766 SeongJae Park 2021-09-07  422  	kfree(targets);
4bc05954d00766 SeongJae Park 2021-09-07  423  out:
4bc05954d00766 SeongJae Park 2021-09-07  424  	kfree(kbuf);
4bc05954d00766 SeongJae Park 2021-09-07  425  	return ret;
4bc05954d00766 SeongJae Park 2021-09-07  426  }
4bc05954d00766 SeongJae Park 2021-09-07  427  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-11-26  3:54 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-20 17:27 [PATCH V1 1/2] mm/damon/dbgfs: Modify Damon dbfs interface dependency in Kconfig Xin Hao
2021-11-20 17:27 ` [PATCH V1 2/2] mm/damon: move damon_rand definition into damon.h Xin Hao
2021-11-21 11:33   ` SeongJae Park
2021-11-21 13:20     ` Xin Hao
2021-11-21 11:24 ` [PATCH V1 1/2] mm/damon/dbgfs: Modify Damon dbfs interface dependency in Kconfig SeongJae Park
2021-11-21 13:19   ` Xin Hao
2021-11-26  3:51 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).