From: kernel test robot <lkp@intel.com> To: Michal Hocko <mhocko@kernel.org> Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org Subject: Re: [RFC 2/3] mm/vmalloc: add support for __GFP_NOFAIL Date: Tue, 19 Oct 2021 00:24:54 +0800 [thread overview] Message-ID: <202110190030.QQ4iy4Tn-lkp@intel.com> (raw) In-Reply-To: <20211018114712.9802-3-mhocko@kernel.org> [-- Attachment #1: Type: text/plain, Size: 5886 bytes --] 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 <lkp@intel.com> All warnings (new ones prefixed by >>): >> 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 [-- Attachment #2: .config.gz --] [-- Type: application/gzip, Size: 31826 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com> To: kbuild-all@lists.01.org Subject: Re: [RFC 2/3] mm/vmalloc: add support for __GFP_NOFAIL Date: Tue, 19 Oct 2021 00:24:54 +0800 [thread overview] Message-ID: <202110190030.QQ4iy4Tn-lkp@intel.com> (raw) In-Reply-To: <20211018114712.9802-3-mhocko@kernel.org> [-- Attachment #1: Type: text/plain, Size: 6041 bytes --] 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 <lkp@intel.com> All warnings (new ones prefixed by >>): >> 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(a)lists.01.org [-- Attachment #2: config.gz --] [-- Type: application/gzip, Size: 31826 bytes --]
next prev parent reply other threads:[~2021-10-18 16:25 UTC|newest] Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-10-18 11:47 [RFC 0/3] extend vmalloc support for constrained allocations Michal Hocko 2021-10-18 11:47 ` [RFC 1/3] mm/vmalloc: alloc GFP_NO{FS,IO} for vmalloc Michal Hocko 2021-10-19 0:44 ` NeilBrown 2021-10-19 6:59 ` Michal Hocko 2021-10-18 11:47 ` [RFC 2/3] mm/vmalloc: add support for __GFP_NOFAIL Michal Hocko 2021-10-18 16:24 ` kernel test robot [this message] 2021-10-18 16:24 ` kernel test robot 2021-10-18 16:48 ` Michal Hocko 2021-10-18 18:15 ` kernel test robot 2021-10-18 18:15 ` kernel test robot 2021-10-19 11:06 ` Uladzislau Rezki 2021-10-19 11:52 ` Michal Hocko 2021-10-19 19:46 ` Uladzislau Rezki 2021-10-20 8:25 ` Michal Hocko 2021-10-20 9:18 ` Michal Hocko 2021-10-20 13:54 ` Uladzislau Rezki 2021-10-20 14:06 ` Michal Hocko 2021-10-20 14:29 ` Uladzislau Rezki 2021-10-20 14:53 ` Michal Hocko 2021-10-20 15:00 ` Uladzislau Rezki 2021-10-20 19:24 ` Uladzislau Rezki 2021-10-21 8:56 ` Michal Hocko 2021-10-21 10:13 ` NeilBrown 2021-10-21 10:27 ` Michal Hocko 2021-10-21 10:40 ` Uladzislau Rezki 2021-10-21 22:49 ` NeilBrown 2021-10-22 8:18 ` Michal Hocko 2021-10-25 9:48 ` Uladzislau Rezki 2021-10-25 11:20 ` Michal Hocko 2021-10-25 14:30 ` Uladzislau Rezki 2021-10-25 14:56 ` Michal Hocko 2021-10-25 23:50 ` NeilBrown 2021-10-26 7:16 ` Michal Hocko 2021-10-26 10:24 ` NeilBrown 2021-10-26 14:25 ` Uladzislau Rezki 2021-10-26 14:43 ` Michal Hocko 2021-10-26 15:40 ` Uladzislau Rezki 2021-10-20 8:25 ` [PATCH] mm/vmalloc: be more explicit about supported gfp flags Michal Hocko 2021-10-18 11:47 ` [RFC 3/3] mm: allow !GFP_KERNEL allocations for kvmalloc Michal Hocko
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=202110190030.QQ4iy4Tn-lkp@intel.com \ --to=lkp@intel.com \ --cc=kbuild-all@lists.01.org \ --cc=llvm@lists.linux.dev \ --cc=mhocko@kernel.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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.