[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202210241624.YgkKGxDd-lkp@intel.com>
Date: Mon, 24 Oct 2022 16:16:42 +0800
From: kernel test robot <lkp@...el.com>
To: Liu Shixin <liushixin2@...wei.com>,
Christoph Lameter <cl@...ux-foundation.org>,
Pekka Enberg <penberg@...nel.org>,
David Rientjes <rientjes@...gle.com>,
Joonsoo Kim <iamjoonsoo.kim@....com>,
Andrew Morton <akpm@...ux-foundation.org>,
Vlastimil Babka <vbabka@...e.cz>,
Roman Gushchin <roman.gushchin@...ux.dev>,
Hyeonggon Yoo <42.hyeyoo@...il.com>
Cc: kbuild-all@...ts.01.org,
Linux Memory Management List <linux-mm@...ck.org>,
linux-kernel@...r.kernel.org, Liu Shixin <liushixin2@...wei.com>
Subject: Re: [PATCH 3/4] mm/slab_common: Separate sysfs_slab_add() and
debugfs_slab_add() from __kmem_cache_create()
Hi Liu,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on vbabka-slab/for-next]
[also build test ERROR on linus/master v6.1-rc2 next-20221024]
[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#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Liu-Shixin/Refactor-__kmem_cache_create-and-fix-memory-leak/20221024-145607
base: git://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab.git for-next
patch link: https://lore.kernel.org/r/20221024074232.151383-4-liushixin2%40huawei.com
patch subject: [PATCH 3/4] mm/slab_common: Separate sysfs_slab_add() and debugfs_slab_add() from __kmem_cache_create()
config: i386-tinyconfig
compiler: gcc-11 (Debian 11.3.0-8) 11.3.0
reproduce (this is a W=1 build):
# https://github.com/intel-lab-lkp/linux/commit/b431907fc9bd145502e0bdb34fcb4b1b67770f2a
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Liu-Shixin/Refactor-__kmem_cache_create-and-fix-memory-leak/20221024-145607
git checkout b431907fc9bd145502e0bdb34fcb4b1b67770f2a
# save the config file
mkdir build_dir && cp config build_dir/.config
make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>
All errors (new ones prefixed by >>):
mm/slab_common.c: In function 'create_cache':
>> mm/slab_common.c:239:23: error: implicit declaration of function 'sysfs_slab_add' [-Werror=implicit-function-declaration]
239 | err = sysfs_slab_add(s);
| ^~~~~~~~~~~~~~
>> mm/slab_common.c:244:17: error: implicit declaration of function 'debugfs_slab_add'; did you mean 'debugfs_slab_release'? [-Werror=implicit-function-declaration]
244 | debugfs_slab_add(s);
| ^~~~~~~~~~~~~~~~
| debugfs_slab_release
cc1: some warnings being treated as errors
vim +/sysfs_slab_add +239 mm/slab_common.c
204
205 static struct kmem_cache *create_cache(const char *name,
206 unsigned int object_size, unsigned int align,
207 slab_flags_t flags, unsigned int useroffset,
208 unsigned int usersize, void (*ctor)(void *),
209 struct kmem_cache *root_cache)
210 {
211 struct kmem_cache *s;
212 const char *cache_name;
213 int err = -ENOMEM;
214
215 if (WARN_ON(useroffset + usersize > object_size))
216 useroffset = usersize = 0;
217
218 s = kmem_cache_zalloc(kmem_cache, GFP_KERNEL);
219 if (!s)
220 return ERR_PTR(err);
221
222 cache_name = kstrdup_const(name, GFP_KERNEL);
223 if (!cache_name)
224 goto out_free_cache;
225
226 s->name = cache_name;
227 s->size = s->object_size = object_size;
228 s->align = align;
229 s->ctor = ctor;
230 s->useroffset = useroffset;
231 s->usersize = usersize;
232
233 err = __kmem_cache_create(s, flags);
234 if (err)
235 goto out_free_name;
236
237 /* Mutex is not taken during early boot */
238 if (slab_state >= FULL) {
> 239 err = sysfs_slab_add(s);
240 if (err) {
241 slab_kmem_cache_release(s);
242 return ERR_PTR(err);
243 }
> 244 debugfs_slab_add(s);
245 }
246
247 s->refcount = 1;
248 list_add(&s->list, &slab_caches);
249 return s;
250
251 out_free_name:
252 kfree_const(s->name);
253 out_free_cache:
254 kmem_cache_free(kmem_cache, s);
255 return ERR_PTR(err);
256 }
257
--
0-DAY CI Kernel Test Service
https://01.org/lkp
View attachment "config" of type "text/plain" (29402 bytes)
Powered by blists - more mailing lists