Re: [PATCH] mm/slab: kmalloc with GFP_DMA32 allocate from SLAB_CACHE_DMA32

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Jianqun,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on hnaz-linux-mm/master]

url:    https://github.com/0day-ci/linux/commits/Jianqun-Xu/mm-slab-kmalloc-with-GFP_DMA32-allocate-from-SLAB_CACHE_DMA32/20210312-160426
base:   https://github.com/hnaz/linux-mm master
config: x86_64-randconfig-a006-20210312 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 7b153b43d3a14d76975039408c4b922beb576735)
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 x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        # https://github.com/0day-ci/linux/commit/93abfa9fa97332c9d5c1727fcf76b604b6da33de
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Jianqun-Xu/mm-slab-kmalloc-with-GFP_DMA32-allocate-from-SLAB_CACHE_DMA32/20210312-160426
        git checkout 93abfa9fa97332c9d5c1727fcf76b604b6da33de
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

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

All error/warnings (new ones prefixed by >>):

>> mm/slab_common.c:812:24: error: implicit declaration of function 'kmalloc_size' [-Werror,-Wimplicit-function-declaration]
                           unsigned int size = kmalloc_size(i);
                                               ^
>> mm/slab_common.c:813:20: error: implicit declaration of function 'kmalloc_cache_name' [-Werror,-Wimplicit-function-declaration]
                           const char *n = kmalloc_cache_name("dma32-kmalloc", size);
                                           ^
>> mm/slab_common.c:813:16: warning: incompatible integer to pointer conversion initializing 'const char *' with an expression of type 'int' [-Wint-conversion]
                           const char *n = kmalloc_cache_name("dma32-kmalloc", size);
                                       ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   1 warning and 2 errors generated.


vim +/kmalloc_size +812 mm/slab_common.c

   761	
   762	/*
   763	 * Create the kmalloc array. Some of the regular kmalloc arrays
   764	 * may already have been created because they were needed to
   765	 * enable allocations for slab creation.
   766	 */
   767	void __init create_kmalloc_caches(slab_flags_t flags)
   768	{
   769		int i;
   770		enum kmalloc_cache_type type;
   771	
   772		for (type = KMALLOC_NORMAL; type <= KMALLOC_RECLAIM; type++) {
   773			for (i = KMALLOC_SHIFT_LOW; i <= KMALLOC_SHIFT_HIGH; i++) {
   774				if (!kmalloc_caches[type][i])
   775					new_kmalloc_cache(i, type, flags);
   776	
   777				/*
   778				 * Caches that are not of the two-to-the-power-of size.
   779				 * These have to be created immediately after the
   780				 * earlier power of two caches
   781				 */
   782				if (KMALLOC_MIN_SIZE <= 32 && i == 6 &&
   783						!kmalloc_caches[type][1])
   784					new_kmalloc_cache(1, type, flags);
   785				if (KMALLOC_MIN_SIZE <= 64 && i == 7 &&
   786						!kmalloc_caches[type][2])
   787					new_kmalloc_cache(2, type, flags);
   788			}
   789		}
   790	
   791		/* Kmalloc array is now usable */
   792		slab_state = UP;
   793	
   794	#ifdef CONFIG_ZONE_DMA
   795		for (i = 0; i <= KMALLOC_SHIFT_HIGH; i++) {
   796			struct kmem_cache *s = kmalloc_caches[KMALLOC_NORMAL][i];
   797	
   798			if (s) {
   799				kmalloc_caches[KMALLOC_DMA][i] = create_kmalloc_cache(
   800					kmalloc_info[i].name[KMALLOC_DMA],
   801					kmalloc_info[i].size,
   802					SLAB_CACHE_DMA | flags, 0,
   803					kmalloc_info[i].size);
   804			}
   805		}
   806	#endif
   807	#ifdef CONFIG_ZONE_DMA32
   808		for (i = 0; i <= KMALLOC_SHIFT_HIGH; i++) {
   809			struct kmem_cache *s = kmalloc_caches[KMALLOC_NORMAL][i];
   810	
   811			if (s) {
 > 812				unsigned int size = kmalloc_size(i);
 > 813				const char *n = kmalloc_cache_name("dma32-kmalloc", size);
   814	
   815				BUG_ON(!n);
   816				kmalloc_caches[KMALLOC_DMA32][i] = create_kmalloc_cache(
   817					n, size, SLAB_CACHE_DMA32 | flags, 0, 0);
   818			}
   819		}
   820	#endif
   821	}
   822	#endif /* !CONFIG_SLOB */
   823	

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

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux