CC: [email protected] CC: [email protected] CC: [email protected] TO: Thomas Gleixner <[email protected]> CC: Sebastian Andrzej Siewior <[email protected]>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git linux-5.15.y-rt-rebase head: 99fc770b1ba097a6c551235ff052d49d7dad1665 commit: 18acf696772631e0a5a6e758b01516e8c5140775 [79/147] mm/vmalloc: Another preempt disable region which sucks :::::: branch date: 2 days ago :::::: commit date: 2 days ago config: arm-randconfig-c002-20211001 (attached as .config) compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 962e503cc8bc411f7523cc393acae8aae425b1c4) 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 # install arm cross compiling tool for clang build # apt-get install binutils-arm-linux-gnueabi # https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git/commit/?id=18acf696772631e0a5a6e758b01516e8c5140775 git remote add rt-devel https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git git fetch --no-tags rt-devel linux-5.15.y-rt-rebase git checkout 18acf696772631e0a5a6e758b01516e8c5140775 # save the attached .config to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm clang-analyzer If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <[email protected]> clang-analyzer warnings: (new ones prefixed by >>) ^ mm/memory.c:2529:6: note: 'fn' is null if (fn) { ^ include/linux/compiler.h:56:47: note: expanded from macro 'if' #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) ^~~~ include/linux/compiler.h:58:86: note: expanded from macro '__trace_if_var' #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond)) ^~~~ include/linux/compiler.h:69:3: note: expanded from macro '__trace_if_value' (cond) ? \ ^~~~ mm/memory.c:2529:2: note: '?' condition is false if (fn) { ^ include/linux/compiler.h:56:28: note: expanded from macro 'if' #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) ^ include/linux/compiler.h:58:69: note: expanded from macro '__trace_if_var' #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond)) ^ include/linux/compiler.h:69:2: note: expanded from macro '__trace_if_value' (cond) ? \ ^ mm/memory.c:2529:2: note: Taking false branch if (fn) { ^ include/linux/compiler.h:56:23: note: expanded from macro 'if' #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) ^ mm/memory.c:2540:2: note: Loop condition is false. Exiting loop arch_leave_lazy_mmu_mode(); ^ include/linux/pgtable.h:978:36: note: expanded from macro 'arch_leave_lazy_mmu_mode' #define arch_leave_lazy_mmu_mode() do {} while (0) ^ mm/memory.c:2542:2: note: '?' condition is false if (mm != &init_mm) ^ include/linux/compiler.h:56:28: note: expanded from macro 'if' #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) ^ include/linux/compiler.h:58:31: note: expanded from macro '__trace_if_var' #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond)) ^ mm/memory.c:2542:2: note: Assuming the condition is true if (mm != &init_mm) ^ include/linux/compiler.h:56:44: note: expanded from macro 'if' #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/compiler.h:58:86: note: expanded from macro '__trace_if_var' #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond)) ~~~~~~~~~~~~~~~~~^~~~~ include/linux/compiler.h:69:3: note: expanded from macro '__trace_if_value' (cond) ? \ ^~~~ mm/memory.c:2542:2: note: '?' condition is true if (mm != &init_mm) ^ include/linux/compiler.h:56:28: note: expanded from macro 'if' #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) ^ include/linux/compiler.h:58:69: note: expanded from macro '__trace_if_var' #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond)) ^ include/linux/compiler.h:69:2: note: expanded from macro '__trace_if_value' (cond) ? \ ^ mm/memory.c:2542:2: note: Taking true branch if (mm != &init_mm) ^ include/linux/compiler.h:56:23: note: expanded from macro 'if' #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) ^ mm/memory.c:2543:3: note: 1st function call argument is an uninitialized value pte_unmap_unlock(mapped_pte, ptl); ^ include/linux/mm.h:2274:2: note: expanded from macro 'pte_unmap_unlock' spin_unlock(ptl); \ ^ ~~~ Suppressed 7 warnings (7 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 7 warnings generated. Suppressed 7 warnings (7 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 7 warnings generated. Suppressed 7 warnings (7 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 7 warnings generated. Suppressed 7 warnings (7 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 15 warnings generated. mm/vmalloc.c:580:18: warning: Value stored to 'nr' during its initialization is never read [clang-analyzer-deadcode.DeadStores] unsigned int i, nr = (end - addr) >> PAGE_SHIFT; ^~ ~~~~~~~~~~~~~~~~~~~~~~~~~~ mm/vmalloc.c:580:18: note: Value stored to 'nr' during its initialization is never read unsigned int i, nr = (end - addr) >> PAGE_SHIFT; ^~ ~~~~~~~~~~~~~~~~~~~~~~~~~~ >> mm/vmalloc.c:1921:2: warning: Value stored to 'cpu' is never read >> [clang-analyzer-deadcode.DeadStores] cpu = get_cpu_light(); ^ mm/vmalloc.c:1921:2: note: Value stored to 'cpu' is never read mm/vmalloc.c:2006:2: warning: Value stored to 'cpu' is never read [clang-analyzer-deadcode.DeadStores] cpu = get_cpu_light(); ^ mm/vmalloc.c:2006:2: note: Value stored to 'cpu' is never read mm/vmalloc.c:2012:23: warning: The result of the left shift is undefined due to shifting by '32', which is greater or equal to the width of type 'unsigned long' [clang-analyzer-core.UndefinedBinaryOperatorResult] if (vb->free < (1UL << order)) { ^ include/linux/compiler.h:56:47: note: expanded from macro 'if' #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) ^~~~ include/linux/compiler.h:58:52: note: expanded from macro '__trace_if_var' #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond)) ^~~~ mm/vmalloc.c:1993:2: note: Assuming the condition is true BUG_ON(offset_in_page(size)); ^ include/asm-generic/bug.h:65:36: note: expanded from macro 'BUG_ON' #define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0) ~~~~^~~~~~~~~~~~~~~~~~~~ include/linux/compiler.h:48:24: note: expanded from macro 'unlikely' # define unlikely(x) (__branch_check__(x, 0, __builtin_constant_p(x))) ^ include/linux/compiler.h:33:32: note: expanded from macro '__branch_check__' ______r = __builtin_expect(!!(x), expect); \ ^ include/linux/compiler.h:56:47: note: expanded from macro 'if' #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ include/linux/compiler.h:58:52: note: expanded from macro '__trace_if_var' #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond)) ^~~~ mm/vmalloc.c:1993:2: note: '?' condition is false BUG_ON(offset_in_page(size)); ^ include/asm-generic/bug.h:65:32: note: expanded from macro 'BUG_ON' #define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0) ^ include/linux/compiler.h:56:28: note: expanded from macro 'if' #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) ^ include/linux/compiler.h:58:31: note: expanded from macro '__trace_if_var' #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond)) ^ mm/vmalloc.c:1993:2: note: '?' condition is false BUG_ON(offset_in_page(size)); ^ include/asm-generic/bug.h:65:32: note: expanded from macro 'BUG_ON' #define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0) ^ include/linux/compiler.h:56:28: note: expanded from macro 'if' #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) ^ include/linux/compiler.h:58:69: note: expanded from macro '__trace_if_var' #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond)) ^ include/linux/compiler.h:69:2: note: expanded from macro '__trace_if_value' (cond) ? \ ^ mm/vmalloc.c:1993:2: note: Taking false branch BUG_ON(offset_in_page(size)); ^ include/asm-generic/bug.h:65:32: note: expanded from macro 'BUG_ON' #define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0) ^ include/linux/compiler.h:56:23: note: expanded from macro 'if' #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) ^ mm/vmalloc.c:1993:2: note: Loop condition is false. Exiting loop BUG_ON(offset_in_page(size)); ^ include/asm-generic/bug.h:65:27: note: expanded from macro 'BUG_ON' #define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0) ^ mm/vmalloc.c:1994:9: note: Assuming the condition is false BUG_ON(size > PAGE_SIZE*VMAP_MAX_ALLOC); ^ include/asm-generic/bug.h:65:45: note: expanded from macro 'BUG_ON' #define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0) ~~~~~~~~~~~~~^~~~~~~~~~~ include/linux/compiler.h:48:41: note: expanded from macro 'unlikely' # define unlikely(x) (__branch_check__(x, 0, __builtin_constant_p(x))) ^ include/linux/compiler.h:33:34: note: expanded from macro '__branch_check__' ______r = __builtin_expect(!!(x), expect); \ ^ include/linux/compiler.h:56:47: note: expanded from macro 'if' #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ include/linux/compiler.h:58:52: note: expanded from macro '__trace_if_var' #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond)) ^~~~ mm/vmalloc.c:1994:2: note: '?' condition is false BUG_ON(size > PAGE_SIZE*VMAP_MAX_ALLOC); ^ include/asm-generic/bug.h:65:32: note: expanded from macro 'BUG_ON' #define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0) ^ vim +/cpu +1921 mm/vmalloc.c cf725ce274ba02 Roman Pen 2015-04-15 1869 cf725ce274ba02 Roman Pen 2015-04-15 1870 /** cf725ce274ba02 Roman Pen 2015-04-15 1871 * new_vmap_block - allocates new vmap_block and occupies 2^order pages in this cf725ce274ba02 Roman Pen 2015-04-15 1872 * block. Of course pages number can't exceed VMAP_BBMAP_BITS cf725ce274ba02 Roman Pen 2015-04-15 1873 * @order: how many 2^order pages should be occupied in newly allocated block cf725ce274ba02 Roman Pen 2015-04-15 1874 * @gfp_mask: flags for the page level allocator cf725ce274ba02 Roman Pen 2015-04-15 1875 * a862f68a8b3600 Mike Rapoport 2019-03-05 1876 * Return: virtual address in a newly allocated block or ERR_PTR(-errno) cf725ce274ba02 Roman Pen 2015-04-15 1877 */ cf725ce274ba02 Roman Pen 2015-04-15 1878 static void *new_vmap_block(unsigned int order, gfp_t gfp_mask) db64fe02258f15 Nicholas Piggin 2008-10-18 1879 { db64fe02258f15 Nicholas Piggin 2008-10-18 1880 struct vmap_block_queue *vbq; db64fe02258f15 Nicholas Piggin 2008-10-18 1881 struct vmap_block *vb; db64fe02258f15 Nicholas Piggin 2008-10-18 1882 struct vmap_area *va; db64fe02258f15 Nicholas Piggin 2008-10-18 1883 unsigned long vb_idx; 18acf696772631 Thomas Gleixner 2011-07-12 1884 int node, err, cpu; cf725ce274ba02 Roman Pen 2015-04-15 1885 void *vaddr; db64fe02258f15 Nicholas Piggin 2008-10-18 1886 db64fe02258f15 Nicholas Piggin 2008-10-18 1887 node = numa_node_id(); db64fe02258f15 Nicholas Piggin 2008-10-18 1888 db64fe02258f15 Nicholas Piggin 2008-10-18 1889 vb = kmalloc_node(sizeof(struct vmap_block), db64fe02258f15 Nicholas Piggin 2008-10-18 1890 gfp_mask & GFP_RECLAIM_MASK, node); db64fe02258f15 Nicholas Piggin 2008-10-18 1891 if (unlikely(!vb)) db64fe02258f15 Nicholas Piggin 2008-10-18 1892 return ERR_PTR(-ENOMEM); db64fe02258f15 Nicholas Piggin 2008-10-18 1893 db64fe02258f15 Nicholas Piggin 2008-10-18 1894 va = alloc_vmap_area(VMAP_BLOCK_SIZE, VMAP_BLOCK_SIZE, db64fe02258f15 Nicholas Piggin 2008-10-18 1895 VMALLOC_START, VMALLOC_END, db64fe02258f15 Nicholas Piggin 2008-10-18 1896 node, gfp_mask); ddf9c6d472825c Tobias Klauser 2011-01-13 1897 if (IS_ERR(va)) { db64fe02258f15 Nicholas Piggin 2008-10-18 1898 kfree(vb); e7d86340793e71 Julia Lawall 2010-08-09 1899 return ERR_CAST(va); db64fe02258f15 Nicholas Piggin 2008-10-18 1900 } db64fe02258f15 Nicholas Piggin 2008-10-18 1901 cf725ce274ba02 Roman Pen 2015-04-15 1902 vaddr = vmap_block_vaddr(va->va_start, 0); db64fe02258f15 Nicholas Piggin 2008-10-18 1903 spin_lock_init(&vb->lock); db64fe02258f15 Nicholas Piggin 2008-10-18 1904 vb->va = va; cf725ce274ba02 Roman Pen 2015-04-15 1905 /* At least something should be left free */ cf725ce274ba02 Roman Pen 2015-04-15 1906 BUG_ON(VMAP_BBMAP_BITS <= (1UL << order)); cf725ce274ba02 Roman Pen 2015-04-15 1907 vb->free = VMAP_BBMAP_BITS - (1UL << order); db64fe02258f15 Nicholas Piggin 2008-10-18 1908 vb->dirty = 0; 7d61bfe8fddeca Roman Pen 2015-04-15 1909 vb->dirty_min = VMAP_BBMAP_BITS; 7d61bfe8fddeca Roman Pen 2015-04-15 1910 vb->dirty_max = 0; db64fe02258f15 Nicholas Piggin 2008-10-18 1911 INIT_LIST_HEAD(&vb->free_list); db64fe02258f15 Nicholas Piggin 2008-10-18 1912 db64fe02258f15 Nicholas Piggin 2008-10-18 1913 vb_idx = addr_to_vb_idx(va->va_start); 0f14599c607d32 Matthew Wilcox (Oracle 2020-08-06 1914) err = xa_insert(&vmap_blocks, vb_idx, vb, gfp_mask); 0f14599c607d32 Matthew Wilcox (Oracle 2020-08-06 1915) if (err) { 0f14599c607d32 Matthew Wilcox (Oracle 2020-08-06 1916) kfree(vb); 0f14599c607d32 Matthew Wilcox (Oracle 2020-08-06 1917) free_vmap_area(va); 0f14599c607d32 Matthew Wilcox (Oracle 2020-08-06 1918) return ERR_PTR(err); 0f14599c607d32 Matthew Wilcox (Oracle 2020-08-06 1919) } db64fe02258f15 Nicholas Piggin 2008-10-18 1920 18acf696772631 Thomas Gleixner 2011-07-12 @1921 cpu = get_cpu_light(); 18acf696772631 Thomas Gleixner 2011-07-12 1922 vbq = this_cpu_ptr(&vmap_block_queue); db64fe02258f15 Nicholas Piggin 2008-10-18 1923 spin_lock(&vbq->lock); 68ac546f265ba3 Roman Pen 2015-04-15 1924 list_add_tail_rcu(&vb->free_list, &vbq->free); db64fe02258f15 Nicholas Piggin 2008-10-18 1925 spin_unlock(&vbq->lock); 18acf696772631 Thomas Gleixner 2011-07-12 1926 put_cpu_light(); db64fe02258f15 Nicholas Piggin 2008-10-18 1927 cf725ce274ba02 Roman Pen 2015-04-15 1928 return vaddr; db64fe02258f15 Nicholas Piggin 2008-10-18 1929 } db64fe02258f15 Nicholas Piggin 2008-10-18 1930 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/[email protected]
.config.gz
Description: application/gzip
_______________________________________________ kbuild mailing list -- [email protected] To unsubscribe send an email to [email protected]
