Thread (1 message) 1 message, 1 author, 2021-10-18

Re: [RFC 2/3] mm/vmalloc: add support for __GFP_NOFAIL

From: kernel test robot <hidden>
Date: 2021-10-18 16:24:54
Also in: oe-kbuild-all

Hi Michal,

[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on ceph-client/for-linus]
[also build test WARNING on v5.15-rc6]
[cannot apply to hnaz-mm/master next-20211018]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Michal-Hocko/extend-vmalloc-support-for-constrained-allocations/20211018-194834
base:   https://github.com/ceph/ceph-client.git for-linus
config: hexagon-randconfig-r041-20211018 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project d245f2e8597bfb52c34810a328d42b990e4af1a4)
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
        # https://github.com/0day-ci/linux/commit/ff0475c921959da4fd8e7d29e5a06739a1c52386
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Michal-Hocko/extend-vmalloc-support-for-constrained-allocations/20211018-194834
        git checkout ff0475c921959da4fd8e7d29e5a06739a1c52386
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=hexagon 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <redacted>

All warnings (new ones prefixed by >>):
quoted
mm/vmalloc.c:3037:16: warning: use of logical '&&' with constant operand [-Wconstant-logical-operand]
                   if (gfp_mask && __GFP_NOFAIL)
                                ^  ~~~~~~~~~~~~
   mm/vmalloc.c:3037:16: note: use '&' for a bitwise operation
                   if (gfp_mask && __GFP_NOFAIL)
                                ^~
                                &
   mm/vmalloc.c:3037:16: note: remove constant to silence this warning
                   if (gfp_mask && __GFP_NOFAIL)
                               ~^~~~~~~~~~~~~~~
   mm/vmalloc.c:781:1: warning: unused function 'compute_subtree_max_size' [-Wunused-function]
   compute_subtree_max_size(struct vmap_area *va)
   ^
   2 warnings generated.


vim +3037 mm/vmalloc.c

  2967	
  2968	/**
  2969	 * __vmalloc_node_range - allocate virtually contiguous memory
  2970	 * @size:		  allocation size
  2971	 * @align:		  desired alignment
  2972	 * @start:		  vm area range start
  2973	 * @end:		  vm area range end
  2974	 * @gfp_mask:		  flags for the page level allocator
  2975	 * @prot:		  protection mask for the allocated pages
  2976	 * @vm_flags:		  additional vm area flags (e.g. %VM_NO_GUARD)
  2977	 * @node:		  node to use for allocation or NUMA_NO_NODE
  2978	 * @caller:		  caller's return address
  2979	 *
  2980	 * Allocate enough pages to cover @size from the page level
  2981	 * allocator with @gfp_mask flags.  Map them into contiguous
  2982	 * kernel virtual space, using a pagetable protection of @prot.
  2983	 *
  2984	 * Return: the address of the area or %NULL on failure
  2985	 */
  2986	void *__vmalloc_node_range(unsigned long size, unsigned long align,
  2987				unsigned long start, unsigned long end, gfp_t gfp_mask,
  2988				pgprot_t prot, unsigned long vm_flags, int node,
  2989				const void *caller)
  2990	{
  2991		struct vm_struct *area;
  2992		void *addr;
  2993		unsigned long real_size = size;
  2994		unsigned long real_align = align;
  2995		unsigned int shift = PAGE_SHIFT;
  2996	
  2997		if (WARN_ON_ONCE(!size))
  2998			return NULL;
  2999	
  3000		if ((size >> PAGE_SHIFT) > totalram_pages()) {
  3001			warn_alloc(gfp_mask, NULL,
  3002				"vmalloc error: size %lu, exceeds total pages",
  3003				real_size);
  3004			return NULL;
  3005		}
  3006	
  3007		if (vmap_allow_huge && !(vm_flags & VM_NO_HUGE_VMAP)) {
  3008			unsigned long size_per_node;
  3009	
  3010			/*
  3011			 * Try huge pages. Only try for PAGE_KERNEL allocations,
  3012			 * others like modules don't yet expect huge pages in
  3013			 * their allocations due to apply_to_page_range not
  3014			 * supporting them.
  3015			 */
  3016	
  3017			size_per_node = size;
  3018			if (node == NUMA_NO_NODE)
  3019				size_per_node /= num_online_nodes();
  3020			if (arch_vmap_pmd_supported(prot) && size_per_node >= PMD_SIZE)
  3021				shift = PMD_SHIFT;
  3022			else
  3023				shift = arch_vmap_pte_supported_shift(size_per_node);
  3024	
  3025			align = max(real_align, 1UL << shift);
  3026			size = ALIGN(real_size, 1UL << shift);
  3027		}
  3028	
  3029	again:
  3030		area = __get_vm_area_node(real_size, align, shift, VM_ALLOC |
  3031					  VM_UNINITIALIZED | vm_flags, start, end, node,
  3032					  gfp_mask, caller);
  3033		if (!area) {
  3034			warn_alloc(gfp_mask, NULL,
  3035				"vmalloc error: size %lu, vm_struct allocation failed",
  3036				real_size);
3037			if (gfp_mask && __GFP_NOFAIL)
  3038				goto again;
  3039			goto fail;
  3040		}
  3041	
  3042		addr = __vmalloc_area_node(area, gfp_mask, prot, shift, node);
  3043		if (!addr)
  3044			goto fail;
  3045	
  3046		/*
  3047		 * In this function, newly allocated vm_struct has VM_UNINITIALIZED
  3048		 * flag. It means that vm_struct is not fully initialized.
  3049		 * Now, it is fully initialized, so remove this flag here.
  3050		 */
  3051		clear_vm_uninitialized_flag(area);
  3052	
  3053		size = PAGE_ALIGN(size);
  3054		kmemleak_vmalloc(area, size, gfp_mask);
  3055	
  3056		return addr;
  3057	
  3058	fail:
  3059		if (shift > PAGE_SHIFT) {
  3060			shift = PAGE_SHIFT;
  3061			align = real_align;
  3062			size = real_size;
  3063			goto again;
  3064		}
  3065	
  3066		return NULL;
  3067	}
  3068	

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

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help