Whamcloud - gitweb
LU-9859 libcfs: remove conditional compilation from libcfs_cpu.c 81/37881/10
authorMr NeilBrown <neilb@suse.de>
Wed, 22 Apr 2020 12:58:39 +0000 (08:58 -0400)
committerOleg Drokin <green@whamcloud.com>
Thu, 7 May 2020 05:46:06 +0000 (05:46 +0000)
commit83a2dbe9e50d3a60312fa40f41052b23a3edb3ca
tree576aeb69a191f343edb889a3feddd6f6b1de36c4
parent66172e3274ca3187edd519dd87a81a478a6d7259
LU-9859 libcfs: remove conditional compilation from libcfs_cpu.c

libcfs_cpu.c manages CPU partitions. In the !CONFIG_SMP case, most
of this disappears and 'static inline's from libcfs_cpu.h are used.
However we still allocate a 'struct cfs_cpt_table' which is used
to keep the NUMA node mask. Event with SMP disabled Lustre wants
to handle any NUMA nodes available.

This patch removes all the !CONFIG_SMP code from libcfs_cpu.c and
conditionally compiles the whole file only when CONFIG_SMP.
We no longer allocate a 'struct cfs_cpt_table' on !CONFIG_SMP,
and don't even declare a structure.  The name "cfs_cpt_tab"
becomes always "NULL", which allows some code to be optimized away.

This means that cfs_cpt_tab can sometimes be NULL, so we need to
discard the assertion that it isn't.

Linux-commit: 7b8e2026fb185e5178f9137c463ff07fc895be5d

Test-Parameters: trivial
Change-Id: Icb84f23249d086c662de76df6ce9686de0b692aa
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-on: https://review.whamcloud.com/37881
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
libcfs/include/libcfs/libcfs_cpu.h
libcfs/libcfs/Makefile.in
libcfs/libcfs/heap.c
libcfs/libcfs/libcfs_cpu.c
libcfs/libcfs/module.c