Re: [PATCH v4] mm: slub: move sysfs slab alloc/free interfaces to debugfs

From: kernel test robot
Date: Fri Apr 16 2021 - 14:48:04 EST


Hi Faiyaz,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v5.12-rc7]
[cannot apply to hnaz-linux-mm/master next-20210416]
[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]

url: https://github.com/0day-ci/linux/commits/Faiyaz-Mohammed/mm-slub-move-sysfs-slab-alloc-free-interfaces-to-debugfs/20210416-222940
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 7e25f40eab52c57ff6772d27d2aef3640a3237d7
config: alpha-randconfig-s031-20210416 (attached as .config)
compiler: alpha-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
# apt-get install sparse
# sparse version: v0.6.3-280-g2cd6d34e-dirty
# https://github.com/0day-ci/linux/commit/8adf70f166344443e2f4e689e30c5d20f16b234e
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Faiyaz-Mohammed/mm-slub-move-sysfs-slab-alloc-free-interfaces-to-debugfs/20210416-222940
git checkout 8adf70f166344443e2f4e689e30c5d20f16b234e
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' W=1 ARCH=alpha

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

All warnings (new ones prefixed by >>):

mm/slub.c: In function 'debugfs_slab_add':
>> mm/slub.c:5896:14: warning: variable 'name' set but not used [-Wunused-but-set-variable]
5896 | const char *name;
| ^~~~
mm/slub.c: At top level:
mm/slub.c:4628: error: unterminated #ifdef
4628 | #ifdef CONFIG_SLUB_DEBUG
|


vim +/name +5896 mm/slub.c

5893
5894 static void debugfs_slab_add(struct kmem_cache *s)
5895 {
> 5896 const char *name;
5897 int unmergeable = slab_unmergeable(s);
5898
5899 if (unlikely(!slab_debugfs_root))
5900 return;
5901
5902 if (!unmergeable && disable_higher_order_debug &&
5903 (slub_debug & DEBUG_METADATA_FLAGS))
5904 unmergeable = 1;
5905
5906 if (unmergeable) {
5907 /*
5908 * Slabcache can never be merged so we can use the name proper.
5909 * This is typically the case for debug situations. In that
5910 * case we can catch duplicate names easily.
5911 */
5912 debugfs_remove(s->slab_cache_dentry);
5913 name = s->name;
5914 } else {
5915 /*
5916 * Create a unique name for the slab as a target
5917 * for the symlinks.
5918 */
5919 name = create_unique_id(s);
5920 }
5921
5922 s->slab_cache_dentry = debugfs_create_dir(s->name, slab_debugfs_root);
5923 if (!IS_ERR(s->slab_cache_dentry)) {
5924 debugfs_create_file("alloc_trace", 0400,
5925 s->slab_cache_dentry, s, &slab_debug_fops);
5926
5927 debugfs_create_file("free_trace", 0400,
5928 s->slab_cache_dentry, s, &slab_debug_fops);
5929 }
5930
5931 if (!unmergeable) {
5932 /* Setup first alias */
5933 debugfs_slab_alias(s, s->name);
5934 }
5935 }
5936

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

Attachment: .config.gz
Description: application/gzip