Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1577134

Re: [PATCH] mm, slab: rename kmalloc-node cache to kmalloc-<size>

From Andrew Morton <akpm@linux-foundation.org>
Newsgroups linux.kernel
Subject Re: [PATCH] mm, slab: rename kmalloc-node cache to kmalloc-<size>
Date 2017-02-08 23:00 +0100
Message-ID <t8Iro-5Hm-19@gated-at.bofh.it> (permalink)
References <t6QCK-5b2-9@gated-at.bofh.it> <t8hAR-5JV-7@gated-at.bofh.it> <t8lO9-8hG-7@gated-at.bofh.it> <t8wzU-6Sa-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, 8 Feb 2017 10:12:13 +0100 Vlastimil Babka <vbabka@suse.cz> wrote:

> On 02/07/2017 10:38 PM, Andrew Morton wrote:
> > On Wed, 8 Feb 2017 01:15:17 +0800 kbuild test robot <lkp@intel.com> wrote:
> > 
> >> Hi Vlastimil,
> >> 
> >> [auto build test WARNING on mmotm/master]
> >> [also build test WARNING on v4.10-rc7 next-20170207]
> >> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
> >> 
> >> url:    https://github.com/0day-ci/linux/commits/Vlastimil-Babka/mm-slab-rename-kmalloc-node-cache-to-kmalloc-size/20170204-021843
> >> base:   git://git.cmpxchg.org/linux-mmotm.git master
> >> config: arm-allyesconfig (attached as .config)
> >> compiler: arm-linux-gnueabi-gcc (Debian 6.1.1-9) 6.1.1 20160705
> >> reproduce:
> >>         wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
> >>         chmod +x ~/bin/make.cross
> >>         # save the attached .config to linux build tree
> >>         make.cross ARCH=arm 
> >> 
> >> All warnings (new ones prefixed by >>):
> >> 
> >> >> WARNING: mm/built-in.o(.text+0x3b49c): Section mismatch in reference from the function get_kmalloc_cache_name() to the (unknown reference) .init.rodata:(unknown)
> >>    The function get_kmalloc_cache_name() references
> >>    the (unknown reference) __initconst (unknown).
> >>    This is often because get_kmalloc_cache_name lacks a __initconst
> >>    annotation or the annotation of (unknown) is wrong.
> > 
> > yup, thanks.
> 
> Thanks for the fix.
> 
> I was going to implement Christoph's suggestion and export the whole structure
> in mm/slab.h, but gcc was complaining that I'm redefining it, until I created a
> typedef first. Is it worth the trouble? Below is how it would look like.
> 
> ...
>
> --- a/mm/slab.h
> +++ b/mm/slab.h
> @@ -71,6 +71,13 @@ extern struct list_head slab_caches;
>  /* The slab cache that manages slab cache information */
>  extern struct kmem_cache *kmem_cache;
>  
> +/* A table of kmalloc cache names and sizes */
> +typedef struct {
> +	const char *name;
> +	unsigned long size;
> +} kmalloc_info_t;
> +extern const kmalloc_info_t kmalloc_info[];

Why is the typedef needed?  Can't we use something like

extern const struct kmalloc_info_struct {
	const char *name;
	unsigned long size;
} kmalloc_info[];

...

const struct kmalloc_info_struct kmalloc_info[] __initconst = {
 	{NULL,                      0},		{"kmalloc-96",             96},
 	{"kmalloc-192",           192},		{"kmalloc-8",               8},
 	{"kmalloc-16",             16},		{"kmalloc-32",             32},
	...
	{"kmalloc-67108864", 67108864}
};

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] mm, slab: rename kmalloc-node cache to kmalloc-<size> Vlastimil Babka <vbabka@suse.cz> - 2017-02-03 19:20 +0100
  Re: [PATCH] mm, slab: rename kmalloc-node cache to kmalloc-<size> kbuild test robot <lkp@intel.com> - 2017-02-04 03:30 +0100
    Re: [PATCH] mm, slab: rename kmalloc-node cache to kmalloc-<size> Vlastimil Babka <vbabka@suse.cz> - 2017-02-04 09:30 +0100
  Re: [PATCH] mm, slab: rename kmalloc-node cache to kmalloc-<size> Christoph Lameter <cl@linux.com> - 2017-02-06 15:50 +0100
  Re: [PATCH] mm, slab: rename kmalloc-node cache to kmalloc-<size> Matthew Wilcox <willy@infradead.org> - 2017-02-06 16:00 +0100
    Re: [PATCH] mm, slab: rename kmalloc-node cache to kmalloc-<size> Christoph Lameter <cl@linux.com> - 2017-02-06 16:00 +0100
  Re: [PATCH] mm, slab: rename kmalloc-node cache to kmalloc-<size> Andrew Morton <akpm@linux-foundation.org> - 2017-02-07 22:50 +0100
    Re: [PATCH] mm, slab: rename kmalloc-node cache to kmalloc-<size> Vlastimil Babka <vbabka@suse.cz> - 2017-02-08 10:20 +0100
      Re: [PATCH] mm, slab: rename kmalloc-node cache to kmalloc-<size> Vlastimil Babka <vbabka@suse.cz> - 2017-02-08 10:50 +0100
      Re: [PATCH] mm, slab: rename kmalloc-node cache to kmalloc-<size> Christoph Lameter <cl@linux.com> - 2017-02-08 16:30 +0100
      Re: [PATCH] mm, slab: rename kmalloc-node cache to kmalloc-<size> Andrew Morton <akpm@linux-foundation.org> - 2017-02-08 23:00 +0100
        Re: [PATCH] mm, slab: rename kmalloc-node cache to kmalloc-<size> Vlastimil Babka <vbabka@suse.cz> - 2017-02-09 10:40 +0100

csiph-web