* [linyunsheng:page_frag_cache_v5 14/14] mm/page_frag_cache.c:291:24: warning: variable 'remaining' is uninitialized when used here
@ 2024-05-18 15:45 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-05-18 15:45 UTC (permalink / raw)
To: Yunsheng Lin; +Cc: llvm, oe-kbuild-all
tree: https://github.com/gestionlin/linux.git page_frag_cache_v5
head: e6543161a8d13e28e244803a755a007021b9dea7
commit: e6543161a8d13e28e244803a755a007021b9dea7 [14/14] add alloc_pg api and refactor alloc_va api
config: arm-clps711x_defconfig (https://download.01.org/0day-ci/archive/20240518/202405182348.NZ2WqUhQ-lkp@intel.com/config)
compiler: clang version 19.0.0git (https://github.com/llvm/llvm-project fa9b1be45088dce1e4b602d451f118128b94237b)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240518/202405182348.NZ2WqUhQ-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/202405182348.NZ2WqUhQ-lkp@intel.com/
All warnings (new ones prefixed by >>):
In file included from mm/page_frag_cache.c:17:
In file included from include/linux/mm.h:2210:
include/linux/vmstat.h:522:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
522 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
| ~~~~~~~~~~~ ^ ~~~
mm/page_frag_cache.c:289:15: warning: unused variable 'page' [-Wunused-variable]
289 | struct page *page;
| ^~~~
>> mm/page_frag_cache.c:291:24: warning: variable 'remaining' is uninitialized when used here [-Wuninitialized]
291 | if (unlikely(fragsz > remaining)) {
| ^~~~~~~~~
include/linux/compiler.h:77:42: note: expanded from macro 'unlikely'
77 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
mm/page_frag_cache.c:288:24: note: initialize the variable 'remaining' to silence this warning
288 | unsigned int remaining;
| ^
| = 0
3 warnings generated.
vim +/remaining +291 mm/page_frag_cache.c
269
270 /**
271 * __page_frag_alloc_va_align() - Alloc a page fragment with aligning
272 * requirement.
273 * @nc: page_frag cache from which to allocate
274 * @fragsz: the requested fragment size
275 * @gfp_mask: the allocation gfp to use when cache need to be refilled
276 * @align_mask: the requested aligning requirement for the 'va'
277 *
278 * Get a page fragment from page_frag cache with aligning requirement.
279 *
280 * Return:
281 * Return va of the page fragment, otherwise return NULL.
282 */
283 void *__page_frag_alloc_va_align(struct page_frag_cache *nc,
284 unsigned int fragsz, gfp_t gfp_mask,
285 unsigned int align_mask)
286 {
287 struct encoded_va *encoded_va;
288 unsigned int remaining;
289 struct page *page;
290
> 291 if (unlikely(fragsz > remaining)) {
292 /* fragsz is not supposed to be bigger than PAGE_SIZE as we are
293 * allowing order 3 page allocation to fail easily under low
294 * memory condition.
295 */
296 if (WARN_ON_ONCE(fragsz > PAGE_SIZE) ||
297 unlikely(!page_frag_cache_refill(nc, gfp_mask)))
298 return NULL;
299 }
300
301 encoded_va = nc->encoded_va;
302 remaining = nc->remaining & align_mask;
303 nc->remaining = remaining - fragsz;
304 nc->pagecnt_bias--;
305
306 return encoded_page_address(encoded_va) +
307 __page_frag_cache_page_offset(encoded_va, remaining);
308 }
309 EXPORT_SYMBOL(__page_frag_alloc_va_align);
310
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-05-18 15:47 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-18 15:45 [linyunsheng:page_frag_cache_v5 14/14] mm/page_frag_cache.c:291:24: warning: variable 'remaining' is uninitialized when used here 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