All of lore.kernel.org
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH] kmalloc_index optimization(code size & runtime stable)
Date: Mon, 20 Apr 2020 19:41:47 +0800	[thread overview]
Message-ID: <202004201954.JM38mLQy%lkp@intel.com> (raw)
In-Reply-To: <1587089010-110083-1-git-send-email-bernard@vivo.com>

[-- Attachment #1: Type: text/plain, Size: 3696 bytes --]

Hi Bernard,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on v5.7-rc2 next-20200420]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Bernard-Zhao/kmalloc_index-optimization-code-size-runtime-stable/20200417-100445
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 2fcd80144b93ff90836a44f2054b4d82133d3a85
config: s390-zfcpdump_defconfig (attached as .config)
compiler: s390-linux-gcc (GCC) 9.3.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day GCC_VERSION=9.3.0 make.cross ARCH=s390 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   In file included from include/linux/kvm_host.h:18,
                    from arch/s390/kernel/asm-offsets.c:11:
   include/linux/slab.h: In function 'kmalloc_index':
>> include/linux/slab.h:390:3: error: 'high_bit' undeclared (first use in this function); did you mean 'assign_bit'?
     390 |   high_bit = fls((int)size);
         |   ^~~~~~~~
         |   assign_bit
   include/linux/slab.h:390:3: note: each undeclared identifier is reported only once for each function it appears in
   make[2]: *** [scripts/Makefile.build:100: arch/s390/kernel/asm-offsets.s] Error 1
   make[2]: Target '__build' not remade because of errors.
   make[1]: *** [Makefile:1141: prepare0] Error 2
   make[1]: Target 'prepare' not remade because of errors.
   make: *** [Makefile:180: sub-make] Error 2
   40 real  5 user  12 sys  44.33% cpu 	make prepare

vim +390 include/linux/slab.h

   356	
   357	/*
   358	 * Figure out which kmalloc slab an allocation of a certain size
   359	 * belongs to.
   360	 * 0 = zero alloc
   361	 * 1 =  65 .. 96 bytes
   362	 * 2 = 129 .. 192 bytes
   363	 * n = 2^(n-1)+1 .. 2^n
   364	 */
   365	static __always_inline unsigned int kmalloc_index(size_t size)
   366	{
   367		if (!size)
   368			return 0;
   369	
   370		if (size <= KMALLOC_MIN_SIZE)
   371			return KMALLOC_SHIFT_LOW;
   372	
   373		if (KMALLOC_MIN_SIZE <= 32 && size > 64 && size <= 96)
   374			return 1;
   375		if (KMALLOC_MIN_SIZE <= 64 && size > 128 && size <= 192)
   376			return 2;
   377	
   378		if (size <= 8)
   379			return 3;
   380	
   381		/* size over KMALLOC_MAX_SIZE should trigger BUG */
   382		if (size <= KMALLOC_MAX_SIZE) {
   383			/*
   384			 * kmalloc_info[index]
   385			 * size  8----16----32----64----128---256---512---1024---2048.
   386			 *       |  |  |  |  |  |  |  |  |  |  |  |  |  |   |  |   |
   387			 * index 3  4  4  5  5  6  6  7  7  8  8  9  9  10  10 11  11
   388			 */
   389	
 > 390			high_bit = fls((int)size);
   391	
   392			if (size == (2 << (high_bit - KMALLOC_SIZE_POW_2_SHIFT_BIT)))
   393				return (high_bit - KMALLOC_SIZE_POW_2_INDEX_BIT);
   394	
   395			return high_bit;
   396		}
   397	
   398		BUG();
   399	
   400		/* Will never be reached. Needed because the compiler may complain */
   401		return -1;
   402	}
   403	#endif /* !CONFIG_SLOB */
   404	

---
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: 8007 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: kbuild test robot <lkp@intel.com>
To: Bernard Zhao <bernard@vivo.com>,
	Christoph Lameter <cl@linux-foundation.org>,
	Pekka Enberg <penberg@kernel.org>,
	David Rientjes <rientjes@google.com>,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	kernel@vivo.com
Cc: kbuild-all@lists.01.org,
	Linux Memory Management List <linux-mm@kvack.org>,
	kernel@vivo.com
Subject: Re: [PATCH] kmalloc_index optimization(code size & runtime stable)
Date: Mon, 20 Apr 2020 19:41:47 +0800	[thread overview]
Message-ID: <202004201954.JM38mLQy%lkp@intel.com> (raw)
In-Reply-To: <1587089010-110083-1-git-send-email-bernard@vivo.com>

[-- Attachment #1: Type: text/plain, Size: 3601 bytes --]

Hi Bernard,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on v5.7-rc2 next-20200420]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Bernard-Zhao/kmalloc_index-optimization-code-size-runtime-stable/20200417-100445
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 2fcd80144b93ff90836a44f2054b4d82133d3a85
config: s390-zfcpdump_defconfig (attached as .config)
compiler: s390-linux-gcc (GCC) 9.3.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day GCC_VERSION=9.3.0 make.cross ARCH=s390 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   In file included from include/linux/kvm_host.h:18,
                    from arch/s390/kernel/asm-offsets.c:11:
   include/linux/slab.h: In function 'kmalloc_index':
>> include/linux/slab.h:390:3: error: 'high_bit' undeclared (first use in this function); did you mean 'assign_bit'?
     390 |   high_bit = fls((int)size);
         |   ^~~~~~~~
         |   assign_bit
   include/linux/slab.h:390:3: note: each undeclared identifier is reported only once for each function it appears in
   make[2]: *** [scripts/Makefile.build:100: arch/s390/kernel/asm-offsets.s] Error 1
   make[2]: Target '__build' not remade because of errors.
   make[1]: *** [Makefile:1141: prepare0] Error 2
   make[1]: Target 'prepare' not remade because of errors.
   make: *** [Makefile:180: sub-make] Error 2
   40 real  5 user  12 sys  44.33% cpu 	make prepare

vim +390 include/linux/slab.h

   356	
   357	/*
   358	 * Figure out which kmalloc slab an allocation of a certain size
   359	 * belongs to.
   360	 * 0 = zero alloc
   361	 * 1 =  65 .. 96 bytes
   362	 * 2 = 129 .. 192 bytes
   363	 * n = 2^(n-1)+1 .. 2^n
   364	 */
   365	static __always_inline unsigned int kmalloc_index(size_t size)
   366	{
   367		if (!size)
   368			return 0;
   369	
   370		if (size <= KMALLOC_MIN_SIZE)
   371			return KMALLOC_SHIFT_LOW;
   372	
   373		if (KMALLOC_MIN_SIZE <= 32 && size > 64 && size <= 96)
   374			return 1;
   375		if (KMALLOC_MIN_SIZE <= 64 && size > 128 && size <= 192)
   376			return 2;
   377	
   378		if (size <= 8)
   379			return 3;
   380	
   381		/* size over KMALLOC_MAX_SIZE should trigger BUG */
   382		if (size <= KMALLOC_MAX_SIZE) {
   383			/*
   384			 * kmalloc_info[index]
   385			 * size  8----16----32----64----128---256---512---1024---2048.
   386			 *       |  |  |  |  |  |  |  |  |  |  |  |  |  |   |  |   |
   387			 * index 3  4  4  5  5  6  6  7  7  8  8  9  9  10  10 11  11
   388			 */
   389	
 > 390			high_bit = fls((int)size);
   391	
   392			if (size == (2 << (high_bit - KMALLOC_SIZE_POW_2_SHIFT_BIT)))
   393				return (high_bit - KMALLOC_SIZE_POW_2_INDEX_BIT);
   394	
   395			return high_bit;
   396		}
   397	
   398		BUG();
   399	
   400		/* Will never be reached. Needed because the compiler may complain */
   401		return -1;
   402	}
   403	#endif /* !CONFIG_SLOB */
   404	

---
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: 8007 bytes --]

  parent reply	other threads:[~2020-04-20 11:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-17  2:03 [PATCH] kmalloc_index optimization(code size & runtime stable) Bernard Zhao
2020-04-17  3:23 ` Matthew Wilcox
2020-04-17  4:55   ` 赵军奎
2020-04-20  5:33 ` kbuild test robot
2020-04-20  5:33   ` kbuild test robot
2020-04-20 11:41 ` kbuild test robot [this message]
2020-04-20 11:41   ` kbuild test robot
2020-04-20 13:20 ` kbuild test robot
2020-04-20 13:20   ` kbuild test robot

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=202004201954.JM38mLQy%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.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: link
Be 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.