llvm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [sj:damon/next 12/59] samples/damon/prcl.c:86:22: warning: implicit conversion from 'unsigned long' to 'unsigned int' changes value from 18446744073709551615 to 4294967295
@ 2024-11-23  7:20 kernel test robot
  2024-11-23 15:44 ` SeongJae Park
  0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2024-11-23  7:20 UTC (permalink / raw)
  To: SeongJae Park; +Cc: llvm, oe-kbuild-all

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/sj/linux.git damon/next
head:   78907e9aaa2afc17557ccada5eeafa2f4423ddcc
commit: 6a0ed0a7aac349150628bda45521200cb75006c2 [12/59] samples/damon/prcl: implement schemes setup
config: s390-allmodconfig (https://download.01.org/0day-ci/archive/20241123/202411231754.4u5u1Nwv-lkp@intel.com/config)
compiler: clang version 20.0.0git (https://github.com/llvm/llvm-project 592c0fe55f6d9a811028b5f3507be91458ab2713)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241123/202411231754.4u5u1Nwv-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202411231754.4u5u1Nwv-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from samples/damon/prcl.c:9:
   In file included from include/linux/damon.h:11:
   In file included from include/linux/memcontrol.h:21:
   In file included from include/linux/mm.h:2211:
   include/linux/vmstat.h:504:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     504 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     505 |                            item];
         |                            ~~~~
   include/linux/vmstat.h:511:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     511 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     512 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
   include/linux/vmstat.h:518:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
     518 |         return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
         |                               ~~~~~~~~~~~ ^ ~~~
   include/linux/vmstat.h:524:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     524 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     525 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
>> samples/damon/prcl.c:86:22: warning: implicit conversion from 'unsigned long' to 'unsigned int' changes value from 18446744073709551615 to 4294967295 [-Wconstant-conversion]
      80 |                         &(struct damos_access_pattern) {
         |                                                        ~
      81 |                         .min_sz_region = PAGE_SIZE,
      82 |                         .max_sz_region = ULONG_MAX,
      83 |                         .min_nr_accesses = 0,
      84 |                         .max_nr_accesses = 0,
      85 |                         .min_age_region = 50,
      86 |                         .max_age_region = ULONG_MAX},
         |                                           ^~~~~~~~~
   include/vdso/limits.h:13:20: note: expanded from macro 'ULONG_MAX'
      13 | #define ULONG_MAX       (~0UL)
         |                          ^~~~
   5 warnings generated.


vim +86 samples/damon/prcl.c

    48	
    49	static int damon_sample_prcl_start(void)
    50	{
    51		struct damon_target *target;
    52		struct damos *scheme;
    53	
    54		pr_info("start\n");
    55	
    56		ctx = damon_new_ctx();
    57		if (!ctx)
    58			return -ENOMEM;
    59		if (damon_select_ops(ctx, DAMON_OPS_VADDR)) {
    60			damon_destroy_ctx(ctx);
    61			return -EINVAL;
    62		}
    63	
    64		target = damon_new_target();
    65		if (!target) {
    66			damon_destroy_ctx(ctx);
    67			return -ENOMEM;
    68		}
    69		damon_add_target(ctx, target);
    70		target_pidp = find_get_pid(target_pid);
    71		if (!target_pidp) {
    72			damon_destroy_ctx(ctx);
    73			return -EINVAL;
    74		}
    75		target->pid = target_pidp;
    76	
    77		ctx->callback.after_aggregation = damon_sample_prcl_after_aggregate;
    78	
    79		scheme = damon_new_scheme(
    80				&(struct damos_access_pattern) {
    81				.min_sz_region = PAGE_SIZE,
    82				.max_sz_region = ULONG_MAX,
    83				.min_nr_accesses = 0,
    84				.max_nr_accesses = 0,
    85				.min_age_region = 50,
  > 86				.max_age_region = ULONG_MAX},
    87				DAMOS_PAGEOUT,
    88				0,
    89				&(struct damos_quota){},
    90				&(struct damos_watermarks){},
    91				NUMA_NO_NODE);
    92		if (!scheme) {
    93			damon_destroy_ctx(ctx);
    94			return -ENOMEM;
    95		}
    96		damon_set_schemes(ctx, &scheme, 1);
    97	
    98		return damon_start(&ctx, 1, true);
    99	}
   100	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

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

* Re: [sj:damon/next 12/59] samples/damon/prcl.c:86:22: warning: implicit conversion from 'unsigned long' to 'unsigned int' changes value from 18446744073709551615 to 4294967295
  2024-11-23  7:20 [sj:damon/next 12/59] samples/damon/prcl.c:86:22: warning: implicit conversion from 'unsigned long' to 'unsigned int' changes value from 18446744073709551615 to 4294967295 kernel test robot
@ 2024-11-23 15:44 ` SeongJae Park
  0 siblings, 0 replies; 2+ messages in thread
From: SeongJae Park @ 2024-11-23 15:44 UTC (permalink / raw)
  To: kernel test robot; +Cc: SeongJae Park, llvm, oe-kbuild-all, damon

On Sat, 23 Nov 2024 15:20:07 +0800 kernel test robot <lkp@intel.com> wrote:

> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/sj/linux.git damon/next
> head:   78907e9aaa2afc17557ccada5eeafa2f4423ddcc
> commit: 6a0ed0a7aac349150628bda45521200cb75006c2 [12/59] samples/damon/prcl: implement schemes setup
> config: s390-allmodconfig (https://download.01.org/0day-ci/archive/20241123/202411231754.4u5u1Nwv-lkp@intel.com/config)
> compiler: clang version 20.0.0git (https://github.com/llvm/llvm-project 592c0fe55f6d9a811028b5f3507be91458ab2713)
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241123/202411231754.4u5u1Nwv-lkp@intel.com/reproduce)
> 
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202411231754.4u5u1Nwv-lkp@intel.com/
> 
> All warnings (new ones prefixed by >>):
> 
[...]
> >> samples/damon/prcl.c:86:22: warning: implicit conversion from 'unsigned long' to 'unsigned int' changes value from 18446744073709551615 to 4294967295 [-Wconstant-conversion]
>       80 |                         &(struct damos_access_pattern) {
>          |                                                        ~
>       81 |                         .min_sz_region = PAGE_SIZE,
>       82 |                         .max_sz_region = ULONG_MAX,
>       83 |                         .min_nr_accesses = 0,
>       84 |                         .max_nr_accesses = 0,
>       85 |                         .min_age_region = 50,
>       86 |                         .max_age_region = ULONG_MAX},
>          |                                           ^~~~~~~~~
>    include/vdso/limits.h:13:20: note: expanded from macro 'ULONG_MAX'
>       13 | #define ULONG_MAX       (~0UL)
>          |                          ^~~~
>    5 warnings generated.

Thank you for this report!  Just pushed a fix:
https://git.kernel.org/sj/c/74b866938a402fc479938747f93b9ced3c9a1282


Thanks,
SJ

[...]

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

end of thread, other threads:[~2024-11-23 15:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-23  7:20 [sj:damon/next 12/59] samples/damon/prcl.c:86:22: warning: implicit conversion from 'unsigned long' to 'unsigned int' changes value from 18446744073709551615 to 4294967295 kernel test robot
2024-11-23 15:44 ` SeongJae Park

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).