All of lore.kernel.org
 help / color / mirror / Atom feed
* mm/percpu-stats.c:125:9: error: aggregate value used where an integer was expected
@ 2026-05-15  1:14 kernel test robot
  2026-05-15  4:41 ` Joonwon Kang
  0 siblings, 1 reply; 3+ messages in thread
From: kernel test robot @ 2026-05-15  1:14 UTC (permalink / raw)
  To: Joonwon Kang; +Cc: oe-kbuild-all, 0day robot

tree:   https://github.com/intel-lab-lkp/linux/commits/Joonwon-Kang/percpu-Do-not-trust-hint-starts-when-they-are-not-set/20260513-070153
head:   53a3f421840a59abecd38cc1be7c4f1d4516c3f1
commit: 27e83e031c0de38ffad3fe513474bff375c2a896 percpu: Introduce struct pcpu_region
date:   2 days ago
config: x86_64-randconfig-2005-20250721 (https://download.01.org/0day-ci/archive/20260515/202605150328.mn2hv1fZ-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260515/202605150328.mn2hv1fZ-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/202605150328.mn2hv1fZ-lkp@intel.com/

All errors (new ones prefixed by >>):

   mm/percpu-stats.c: In function 'chunk_map_stats':
>> mm/percpu-stats.c:125:9: error: aggregate value used where an integer was expected
     125 |         P("contig_bytes", chunk_md->contig_hint * PCPU_MIN_ALLOC_SIZE);
         |         ^


vim +125 mm/percpu-stats.c

30a5b5367ef9d5 Dennis Zhou            2017-06-19   44  
30a5b5367ef9d5 Dennis Zhou            2017-06-19   45  /*
30a5b5367ef9d5 Dennis Zhou            2017-06-19   46   * Prints out chunk state. Fragmentation is considered between
30a5b5367ef9d5 Dennis Zhou            2017-06-19   47   * the beginning of the chunk to the last allocation.
40064aeca35c5c Dennis Zhou (Facebook  2017-07-12   48)  *
40064aeca35c5c Dennis Zhou (Facebook  2017-07-12   49)  * All statistics are in bytes unless stated otherwise.
30a5b5367ef9d5 Dennis Zhou            2017-06-19   50   */
30a5b5367ef9d5 Dennis Zhou            2017-06-19   51  static void chunk_map_stats(struct seq_file *m, struct pcpu_chunk *chunk,
cd6a884d095580 Dennis Zhou (Facebook  2017-07-15   52) 			    int *buffer)
30a5b5367ef9d5 Dennis Zhou            2017-06-19   53  {
92c14cab432674 Dennis Zhou            2019-02-26   54  	struct pcpu_block_md *chunk_md = &chunk->chunk_md;
40064aeca35c5c Dennis Zhou (Facebook  2017-07-12   55) 	int i, last_alloc, as_len, start, end;
30a5b5367ef9d5 Dennis Zhou            2017-06-19   56  	int *alloc_sizes, *p;
30a5b5367ef9d5 Dennis Zhou            2017-06-19   57  	/* statistics */
30a5b5367ef9d5 Dennis Zhou            2017-06-19   58  	int sum_frag = 0, max_frag = 0;
30a5b5367ef9d5 Dennis Zhou            2017-06-19   59  	int cur_min_alloc = 0, cur_med_alloc = 0, cur_max_alloc = 0;
30a5b5367ef9d5 Dennis Zhou            2017-06-19   60  
30a5b5367ef9d5 Dennis Zhou            2017-06-19   61  	alloc_sizes = buffer;
30a5b5367ef9d5 Dennis Zhou            2017-06-19   62  
40064aeca35c5c Dennis Zhou (Facebook  2017-07-12   63) 	/*
40064aeca35c5c Dennis Zhou (Facebook  2017-07-12   64) 	 * find_last_bit returns the start value if nothing found.
40064aeca35c5c Dennis Zhou (Facebook  2017-07-12   65) 	 * Therefore, we must determine if it is a failure of find_last_bit
40064aeca35c5c Dennis Zhou (Facebook  2017-07-12   66) 	 * and set the appropriate value.
40064aeca35c5c Dennis Zhou (Facebook  2017-07-12   67) 	 */
40064aeca35c5c Dennis Zhou (Facebook  2017-07-12   68) 	last_alloc = find_last_bit(chunk->alloc_map,
40064aeca35c5c Dennis Zhou (Facebook  2017-07-12   69) 				   pcpu_chunk_map_bits(chunk) -
40064aeca35c5c Dennis Zhou (Facebook  2017-07-12   70) 				   chunk->end_offset / PCPU_MIN_ALLOC_SIZE - 1);
40064aeca35c5c Dennis Zhou (Facebook  2017-07-12   71) 	last_alloc = test_bit(last_alloc, chunk->alloc_map) ?
40064aeca35c5c Dennis Zhou (Facebook  2017-07-12   72) 		     last_alloc + 1 : 0;
40064aeca35c5c Dennis Zhou (Facebook  2017-07-12   73) 
40064aeca35c5c Dennis Zhou (Facebook  2017-07-12   74) 	as_len = 0;
2e08d20d777e99 Dennis Zhou            2017-09-27   75  	start = chunk->start_offset / PCPU_MIN_ALLOC_SIZE;
30a5b5367ef9d5 Dennis Zhou            2017-06-19   76  
30a5b5367ef9d5 Dennis Zhou            2017-06-19   77  	/*
40064aeca35c5c Dennis Zhou (Facebook  2017-07-12   78) 	 * If a bit is set in the allocation map, the bound_map identifies
40064aeca35c5c Dennis Zhou (Facebook  2017-07-12   79) 	 * where the allocation ends.  If the allocation is not set, the
40064aeca35c5c Dennis Zhou (Facebook  2017-07-12   80) 	 * bound_map does not identify free areas as it is only kept accurate
40064aeca35c5c Dennis Zhou (Facebook  2017-07-12   81) 	 * on allocation, not free.
40064aeca35c5c Dennis Zhou (Facebook  2017-07-12   82) 	 *
40064aeca35c5c Dennis Zhou (Facebook  2017-07-12   83) 	 * Positive values are allocations and negative values are free
40064aeca35c5c Dennis Zhou (Facebook  2017-07-12   84) 	 * fragments.
30a5b5367ef9d5 Dennis Zhou            2017-06-19   85  	 */
40064aeca35c5c Dennis Zhou (Facebook  2017-07-12   86) 	while (start < last_alloc) {
40064aeca35c5c Dennis Zhou (Facebook  2017-07-12   87) 		if (test_bit(start, chunk->alloc_map)) {
40064aeca35c5c Dennis Zhou (Facebook  2017-07-12   88) 			end = find_next_bit(chunk->bound_map, last_alloc,
40064aeca35c5c Dennis Zhou (Facebook  2017-07-12   89) 					    start + 1);
40064aeca35c5c Dennis Zhou (Facebook  2017-07-12   90) 			alloc_sizes[as_len] = 1;
40064aeca35c5c Dennis Zhou (Facebook  2017-07-12   91) 		} else {
40064aeca35c5c Dennis Zhou (Facebook  2017-07-12   92) 			end = find_next_bit(chunk->alloc_map, last_alloc,
40064aeca35c5c Dennis Zhou (Facebook  2017-07-12   93) 					    start + 1);
40064aeca35c5c Dennis Zhou (Facebook  2017-07-12   94) 			alloc_sizes[as_len] = -1;
40064aeca35c5c Dennis Zhou (Facebook  2017-07-12   95) 		}
40064aeca35c5c Dennis Zhou (Facebook  2017-07-12   96) 
40064aeca35c5c Dennis Zhou (Facebook  2017-07-12   97) 		alloc_sizes[as_len++] *= (end - start) * PCPU_MIN_ALLOC_SIZE;
40064aeca35c5c Dennis Zhou (Facebook  2017-07-12   98) 
40064aeca35c5c Dennis Zhou (Facebook  2017-07-12   99) 		start = end;
30a5b5367ef9d5 Dennis Zhou            2017-06-19  100  	}
30a5b5367ef9d5 Dennis Zhou            2017-06-19  101  
40064aeca35c5c Dennis Zhou (Facebook  2017-07-12  102) 	/*
40064aeca35c5c Dennis Zhou (Facebook  2017-07-12  103) 	 * The negative values are free fragments and thus sorting gives the
40064aeca35c5c Dennis Zhou (Facebook  2017-07-12  104) 	 * free fragments at the beginning in largest first order.
40064aeca35c5c Dennis Zhou (Facebook  2017-07-12  105) 	 */
40064aeca35c5c Dennis Zhou (Facebook  2017-07-12  106) 	if (as_len > 0) {
40064aeca35c5c Dennis Zhou (Facebook  2017-07-12  107) 		sort(alloc_sizes, as_len, sizeof(int), cmpint, NULL);
30a5b5367ef9d5 Dennis Zhou            2017-06-19  108  
40064aeca35c5c Dennis Zhou (Facebook  2017-07-12  109) 		/* iterate through the unallocated fragments */
30a5b5367ef9d5 Dennis Zhou            2017-06-19  110  		for (i = 0, p = alloc_sizes; *p < 0 && i < as_len; i++, p++) {
30a5b5367ef9d5 Dennis Zhou            2017-06-19  111  			sum_frag -= *p;
30a5b5367ef9d5 Dennis Zhou            2017-06-19  112  			max_frag = max(max_frag, -1 * (*p));
30a5b5367ef9d5 Dennis Zhou            2017-06-19  113  		}
30a5b5367ef9d5 Dennis Zhou            2017-06-19  114  
30a5b5367ef9d5 Dennis Zhou            2017-06-19  115  		cur_min_alloc = alloc_sizes[i];
30a5b5367ef9d5 Dennis Zhou            2017-06-19  116  		cur_med_alloc = alloc_sizes[(i + as_len - 1) / 2];
30a5b5367ef9d5 Dennis Zhou            2017-06-19  117  		cur_max_alloc = alloc_sizes[as_len - 1];
30a5b5367ef9d5 Dennis Zhou            2017-06-19  118  	}
30a5b5367ef9d5 Dennis Zhou            2017-06-19  119  
30a5b5367ef9d5 Dennis Zhou            2017-06-19  120  	P("nr_alloc", chunk->nr_alloc);
30a5b5367ef9d5 Dennis Zhou            2017-06-19  121  	P("max_alloc_size", chunk->max_alloc_size);
0cecf50cf00fbe Dennis Zhou (Facebook  2017-07-24  122) 	P("empty_pop_pages", chunk->nr_empty_pop_pages);
92c14cab432674 Dennis Zhou            2019-02-26  123  	P("first_bit", chunk_md->first_free);
40064aeca35c5c Dennis Zhou (Facebook  2017-07-12  124) 	P("free_bytes", chunk->free_bytes);
92c14cab432674 Dennis Zhou            2019-02-26 @125  	P("contig_bytes", chunk_md->contig_hint * PCPU_MIN_ALLOC_SIZE);
30a5b5367ef9d5 Dennis Zhou            2017-06-19  126  	P("sum_frag", sum_frag);
30a5b5367ef9d5 Dennis Zhou            2017-06-19  127  	P("max_frag", max_frag);
30a5b5367ef9d5 Dennis Zhou            2017-06-19  128  	P("cur_min_alloc", cur_min_alloc);
30a5b5367ef9d5 Dennis Zhou            2017-06-19  129  	P("cur_med_alloc", cur_med_alloc);
30a5b5367ef9d5 Dennis Zhou            2017-06-19  130  	P("cur_max_alloc", cur_max_alloc);
30a5b5367ef9d5 Dennis Zhou            2017-06-19  131  	seq_putc(m, '\n');
30a5b5367ef9d5 Dennis Zhou            2017-06-19  132  }
30a5b5367ef9d5 Dennis Zhou            2017-06-19  133  

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

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

end of thread, other threads:[~2026-05-15 11:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-15  1:14 mm/percpu-stats.c:125:9: error: aggregate value used where an integer was expected kernel test robot
2026-05-15  4:41 ` Joonwon Kang
2026-05-15 11:01   ` Philip Li

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.