From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A22A82DF136 for ; Wed, 15 Jul 2026 22:47:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.11 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784155665; cv=none; b=FjuJRmcr24paqiUO73ItvMkPPey3prdTZCWBfrxyaf14kEU3VEiz6TV927rJoS/TQ04PixtRKfVzEZPMO3vdbZQcfoGdhNDU/JpKPJcTNk8A4db+VJvQXbzQAFQrM0l15PuVfCzaOl1nlX9mV46lFOp6WYY7abuFFK5bk1kxymc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784155665; c=relaxed/simple; bh=rSXlqHZaldXOcfsNRHditE8xQa0i1etXpJZL7UKehVc=; h=Date:From:To:Cc:Subject:Message-ID; b=T/yG2Fr7y8Zh48aF8H0EVJ6KyMZyW8AqPI3JAYeEcVmayS9HfXp26+b+Z1DPPWVhRLCOd+xx76UswDwzKyMr16aeMYo4zIT4eVmfi9le0HzlSEZrO2crSRmChcG21bR4D8pX/eZMotWqaV2bAypdWv3fC+75Jwr1qUlHA3bGkuM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=QwgkwgSE; arc=none smtp.client-ip=192.198.163.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="QwgkwgSE" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1784155663; x=1815691663; h=date:from:to:cc:subject:message-id; bh=rSXlqHZaldXOcfsNRHditE8xQa0i1etXpJZL7UKehVc=; b=QwgkwgSEvMkrSpP2uYp3qT+ZMdIe5E2GIgr+bjxLBnSuxXVRUAl4ZiHt m5eeyQ7lqT/AOKrORj2BwdG+mbt9xy4zC+Oq5Y0NsQ4x3yonY+gVQRAv/ fWtnulBpsCTaXx7mkrXKH1fXVTsK5l/1JyK6EJj4t4Y1tBLKcxRcDJwTQ B2Rbqu+ae2E+54QJPpjdmbwbuvJ+zChUAqO+IriUCKUxHbbd9BUGA9If5 gbQvXtkbOWG1mFXGoGgU4v6gbezSqvo9LCznEyb20xdykStUzV25ypwGI IYC3HqUDsv1gpaD8ORmx99mgNkFIbVWM8EIt88hfUWrrV7K/Ikhnu8rhj w==; X-CSE-ConnectionGUID: 9Mcy2gm+TXWbA4GO69CJ+Q== X-CSE-MsgGUID: eT3ID0EuRfKoKl32lFlAPw== X-IronPort-AV: E=McAfee;i="6800,10657,11847"; a="95413839" X-IronPort-AV: E=Sophos;i="6.25,166,1779174000"; d="scan'208";a="95413839" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jul 2026 15:47:42 -0700 X-CSE-ConnectionGUID: dWxYOb3lQjWIx124Ow1KKg== X-CSE-MsgGUID: fvOG6r8sSWmhDUjXgZnzdQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.25,166,1779174000"; d="scan'208";a="255196689" Received: from igk-lkp-server01.igk.intel.com (HELO e5a8ed462067) ([10.211.93.152]) by orviesa010.jf.intel.com with ESMTP; 15 Jul 2026 15:47:40 -0700 Received: from kbuild by e5a8ed462067 with local (Exim 4.98.2) (envelope-from ) id 1wk8O9-000000004M9-3QC6; Wed, 15 Jul 2026 22:47:37 +0000 Date: Thu, 16 Jul 2026 00:46:50 +0200 From: kernel test robot To: deepakraog Cc: oe-kbuild-all@lists.linux.dev, 0day robot Subject: mm/vmalloc.c:4442:78: error: 'gfp' undeclared Message-ID: <202607160058.sr6R8chP-lkp@intel.com> User-Agent: s-nail v14.9.25 Precedence: bulk X-Mailing-List: oe-kbuild-all@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: tree: https://github.com/intel-lab-lkp/linux/commits/deepakraog/selftests-proc-expand-smaps-field-coverage-and-require-TMPFS/20260715-235653 head: d9d0f9a9456e0c39c577578411fdf41e0e54deff commit: 9d4dde17d9bbfd6739f223d0dcd79a76b445abcc mm: vrealloc: grow vm_area mappings in place date: 7 hours ago config: x86_64-rhel-9.4-bpf (https://download.01.org/0day-ci/archive/20260716/202607160058.sr6R8chP-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/20260716/202607160058.sr6R8chP-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 | Closes: https://lore.kernel.org/oe-kbuild-all/202607160058.sr6R8chP-lkp@intel.com/ All errors (new ones prefixed by >>): In file included from include/linux/vmalloc.h:5, from mm/vmalloc.c:11: mm/vmalloc.c: In function 'vrealloc_node_align_noprof': >> mm/vmalloc.c:4442:78: error: 'gfp' undeclared (first use in this function) 4442 | pages = kvmalloc_array(extra, sizeof(struct page *), gfp); | ^~~ include/linux/alloc_tag.h:253:16: note: in definition of macro 'alloc_hooks_tag' 253 | typeof(_do_alloc) _res; \ | ^~~~~~~~~ include/linux/slab.h:1359:49: note: in expansion of macro 'alloc_hooks' 1359 | #define kvmalloc_array(...) alloc_hooks(kvmalloc_array_noprof(__VA_ARGS__)) | ^~~~~~~~~~~ include/linux/slab.h:1355:49: note: in expansion of macro 'kvmalloc_array_node_noprof' 1355 | #define kvmalloc_array_noprof(...) kvmalloc_array_node_noprof(__VA_ARGS__, NUMA_NO_NODE) | ^~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/slab.h:1359:61: note: in expansion of macro 'kvmalloc_array_noprof' 1359 | #define kvmalloc_array(...) alloc_hooks(kvmalloc_array_noprof(__VA_ARGS__)) | ^~~~~~~~~~~~~~~~~~~~~ mm/vmalloc.c:4442:33: note: in expansion of macro 'kvmalloc_array' 4442 | pages = kvmalloc_array(extra, sizeof(struct page *), gfp); | ^~~~~~~~~~~~~~ mm/vmalloc.c:4442:78: note: each undeclared identifier is reported only once for each function it appears in 4442 | pages = kvmalloc_array(extra, sizeof(struct page *), gfp); | ^~~ include/linux/alloc_tag.h:253:16: note: in definition of macro 'alloc_hooks_tag' 253 | typeof(_do_alloc) _res; \ | ^~~~~~~~~ include/linux/slab.h:1359:49: note: in expansion of macro 'alloc_hooks' 1359 | #define kvmalloc_array(...) alloc_hooks(kvmalloc_array_noprof(__VA_ARGS__)) | ^~~~~~~~~~~ include/linux/slab.h:1355:49: note: in expansion of macro 'kvmalloc_array_node_noprof' 1355 | #define kvmalloc_array_noprof(...) kvmalloc_array_node_noprof(__VA_ARGS__, NUMA_NO_NODE) | ^~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/slab.h:1359:61: note: in expansion of macro 'kvmalloc_array_noprof' 1359 | #define kvmalloc_array(...) alloc_hooks(kvmalloc_array_noprof(__VA_ARGS__)) | ^~~~~~~~~~~~~~~~~~~~~ mm/vmalloc.c:4442:33: note: in expansion of macro 'kvmalloc_array' 4442 | pages = kvmalloc_array(extra, sizeof(struct page *), gfp); | ^~~~~~~~~~~~~~ >> mm/vmalloc.c:4442:31: error: assignment to 'struct page **' from 'int' makes pointer from integer without a cast [-Wint-conversion] 4442 | pages = kvmalloc_array(extra, sizeof(struct page *), gfp); | ^ vim +/gfp +4442 mm/vmalloc.c 4281 4282 /** 4283 * vrealloc_node_align - reallocate virtually contiguous memory; contents 4284 * remain unchanged 4285 * @p: object to reallocate memory for 4286 * @size: the size to reallocate 4287 * @align: requested alignment 4288 * @flags: the flags for the page level allocator 4289 * @nid: node number of the target node 4290 * 4291 * If @p is %NULL, vrealloc_XXX() behaves exactly like vmalloc_XXX(). If @size 4292 * is 0 and @p is not a %NULL pointer, the object pointed to is freed. 4293 * 4294 * If the caller wants the new memory to be on specific node *only*, 4295 * __GFP_THISNODE flag should be set, otherwise the function will try to avoid 4296 * reallocation and possibly disregard the specified @nid. 4297 * 4298 * If __GFP_ZERO logic is requested, callers must ensure that, starting with the 4299 * initial memory allocation, every subsequent call to this API for the same 4300 * memory allocation is flagged with __GFP_ZERO. Otherwise, it is possible that 4301 * __GFP_ZERO is not fully honored by this API. 4302 * 4303 * Requesting an alignment that is bigger than the alignment of the existing 4304 * allocation will fail. 4305 * 4306 * In any case, the contents of the object pointed to are preserved up to the 4307 * lesser of the new and old sizes. 4308 * 4309 * This function must not be called concurrently with itself or vfree() for the 4310 * same memory allocation. 4311 * 4312 * Return: pointer to the allocated memory; %NULL if @size is zero or in case of 4313 * failure 4314 */ 4315 void *vrealloc_node_align_noprof(const void *p, size_t size, unsigned long align, 4316 gfp_t flags, int nid) 4317 { 4318 struct vm_struct *vm = NULL; 4319 size_t alloced_size = 0; 4320 size_t old_size = 0; 4321 void *n; 4322 4323 if (!size) { 4324 vfree(p); 4325 return NULL; 4326 } 4327 4328 if (p) { 4329 vm = find_vm_area(p); 4330 if (unlikely(!vm)) { 4331 WARN(1, "Trying to vrealloc() nonexistent vm area (%p)\n", p); 4332 return NULL; 4333 } 4334 4335 alloced_size = get_vm_area_size(vm); 4336 old_size = vm->requested_size; 4337 if (WARN(alloced_size < old_size, 4338 "vrealloc() has mismatched area vs requested sizes (%p)\n", p)) 4339 return NULL; 4340 if (WARN(!IS_ALIGNED((unsigned long)p, align), 4341 "will not reallocate with a bigger alignment (0x%lx)\n", align)) 4342 return NULL; 4343 if (unlikely(flags & __GFP_THISNODE) && nid != NUMA_NO_NODE && 4344 nid != page_to_nid(vmalloc_to_page(p))) 4345 goto need_realloc; 4346 } else { 4347 /* 4348 * If p is NULL, vrealloc behaves exactly like vmalloc. 4349 * Skip the shrink and in-place grow paths. 4350 */ 4351 goto need_realloc; 4352 } 4353 4354 if (size <= old_size) { 4355 unsigned int new_nr_pages = PAGE_ALIGN(size) >> PAGE_SHIFT; 4356 4357 /* Zero out "freed" memory, potentially for future realloc. */ 4358 if (want_init_on_free() || want_init_on_alloc(flags)) 4359 memset((void *)p + size, 0, old_size - size); 4360 4361 /* 4362 * Free tail pages when shrink crosses a page boundary. 4363 * 4364 * Skip huge page allocations (page_order > 0) as partial 4365 * freeing would require splitting. 4366 * 4367 * Skip VM_FLUSH_RESET_PERMS, as direct-map permissions must 4368 * be reset before pages are returned to the allocator. 4369 * 4370 * Skip VM_USERMAP, as remap_vmalloc_range_partial() validates 4371 * mapping requests against the unchanged vm->size; freeing 4372 * tail pages would cause vmalloc_to_page() to return NULL for 4373 * the unmapped range. 4374 * 4375 * Skip if either GFP_NOFS or GFP_NOIO are used. 4376 * kmemleak_free_part() internally allocates with 4377 * GFP_KERNEL, which could trigger a recursive deadlock 4378 * if we are under filesystem or I/O reclaim. 4379 */ 4380 if (new_nr_pages < vm->nr_pages && !vm_area_page_order(vm) && 4381 !(vm->flags & (VM_FLUSH_RESET_PERMS | VM_USERMAP)) && 4382 gfp_has_io_fs(flags)) { 4383 unsigned long addr = (unsigned long)kasan_reset_tag(p); 4384 unsigned int old_nr_pages = vm->nr_pages; 4385 4386 /* 4387 * Use the node lock to synchronize with concurrent 4388 * readers (vmalloc_info_show). 4389 */ 4390 struct vmap_node *vn = addr_to_node(addr); 4391 4392 spin_lock(&vn->busy.lock); 4393 vm->nr_pages = new_nr_pages; 4394 spin_unlock(&vn->busy.lock); 4395 4396 /* Notify kmemleak of the reduced allocation size before unmapping. */ 4397 kmemleak_free_part( 4398 (void *)addr + ((unsigned long)new_nr_pages 4399 << PAGE_SHIFT), 4400 (unsigned long)(old_nr_pages - new_nr_pages) 4401 << PAGE_SHIFT); 4402 4403 vunmap_range(addr + ((unsigned long)new_nr_pages 4404 << PAGE_SHIFT), 4405 addr + ((unsigned long)old_nr_pages 4406 << PAGE_SHIFT)); 4407 4408 vm_area_free_pages(vm, new_nr_pages, old_nr_pages); 4409 } 4410 vm->requested_size = size; 4411 kasan_vrealloc(p, old_size, size); 4412 return (void *)p; 4413 } 4414 4415 /* 4416 * We already have the bytes available in the allocation; use them. 4417 */ 4418 if (size <= vm->nr_pages << PAGE_SHIFT) { 4419 /* 4420 * No need to zero memory here, as unused memory will have 4421 * already been zeroed at initial allocation time or during 4422 * realloc shrink time. 4423 */ 4424 vm->requested_size = size; 4425 kasan_vrealloc(p, old_size, size); 4426 return (void *)p; 4427 } 4428 4429 { 4430 unsigned int new_nr_pages = PAGE_ALIGN(size) >> PAGE_SHIFT; 4431 unsigned int old_nr_pages = vm->nr_pages; 4432 4433 if (new_nr_pages > old_nr_pages && !vm_area_page_order(vm) && 4434 !(vm->flags & (VM_FLUSH_RESET_PERMS | VM_USERMAP)) && 4435 gfp_has_io_fs(flags)) { 4436 unsigned int extra = new_nr_pages - old_nr_pages; 4437 unsigned long addr = (unsigned long)kasan_reset_tag(p); 4438 struct vmap_node *vn = addr_to_node(addr); 4439 struct page **pages; 4440 int ret; 4441 > 4442 pages = kvmalloc_array(extra, sizeof(struct page *), gfp); 4443 if (!pages) 4444 goto need_realloc; 4445 4446 if (vm_area_alloc_pages(vmalloc_gfp_adjust(gfp, 0), nid, 4447 0, extra, pages) != extra) { 4448 kvfree(pages); 4449 goto need_realloc; 4450 } 4451 4452 spin_lock(&vn->busy.lock); 4453 ret = vmap_pages_range(addr + ((unsigned long)old_nr_pages 4454 << PAGE_SHIFT), 4455 addr + ((unsigned long)new_nr_pages 4456 << PAGE_SHIFT), 4457 PAGE_KERNEL, pages, PAGE_SHIFT); 4458 spin_unlock(&vn->busy.lock); 4459 if (ret < 0) { 4460 free_pages_bulk(pages, extra); 4461 kvfree(pages); 4462 goto need_realloc; 4463 } 4464 4465 memcpy(&vm->pages[old_nr_pages], pages, 4466 extra * sizeof(struct page *)); 4467 kvfree(pages); 4468 vm->nr_pages = new_nr_pages; 4469 vm->requested_size = size; 4470 kasan_vrealloc(p, old_size, size); 4471 if (want_init_on_alloc(flags)) 4472 memset((void *)p + old_size, 0, size - old_size); 4473 return (void *)p; 4474 } 4475 } 4476 4477 need_realloc: 4478 /* Fall back to a fresh vm_area when in-place grow is not possible. */ 4479 n = __vmalloc_node_noprof(size, align, flags, nid, __builtin_return_address(0)); 4480 4481 if (!n) 4482 return NULL; 4483 4484 if (p) { 4485 memcpy(n, p, min(size, old_size)); 4486 vfree(p); 4487 } 4488 4489 return n; 4490 } 4491 EXPORT_SYMBOL(vrealloc_node_align_noprof); 4492 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki