Re: [PATCH v2 2/2] powerpc/numa: Fill distance_lookup_table for offline nodes
From: kernel test robot
Date: Thu Jul 01 2021 - 06:21:46 EST
Hi Srikar,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on 031e3bd8986fffe31e1ddbf5264cccfe30c9abd7]
url: https://github.com/0day-ci/linux/commits/Srikar-Dronamraju/Skip-numa-distance-for-offline-nodes/20210701-121809
base: 031e3bd8986fffe31e1ddbf5264cccfe30c9abd7
config: powerpc64-randconfig-r001-20210630 (attached as .config)
compiler: powerpc64le-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/715881c25ce171cc9d097d4faeb0dce60bb3e71c
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Srikar-Dronamraju/Skip-numa-distance-for-offline-nodes/20210701-121809
git checkout 715881c25ce171cc9d097d4faeb0dce60bb3e71c
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=powerpc64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>
All errors (new ones prefixed by >>):
>> arch/powerpc/mm/numa.c:871:13: error: no previous prototype for 'fake_update_distance_lookup_table' [-Werror=missing-prototypes]
871 | void __init fake_update_distance_lookup_table(void)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
vim +/fake_update_distance_lookup_table +871 arch/powerpc/mm/numa.c
862
863 /*
864 * Scheduler expects unique number of node distances to be available at
865 * boot. It uses node distance to calculate this unique node distances. On
866 * POWER, node distances for offline nodes is not available. However, POWER
867 * already knows unique possible node distances. Fake the offline node's
868 * distance_lookup_table entries so that all possible node distances are
869 * updated.
870 */
> 871 void __init fake_update_distance_lookup_table(void)
872 {
873 unsigned long distance_map;
874 int i, nr_levels, nr_depth, node;
875
876 if (!numa_enabled)
877 return;
878
879 if (!form1_affinity)
880 return;
881
882 /*
883 * distance_ref_points_depth lists the unique numa domains
884 * available. However it ignore LOCAL_DISTANCE. So add +1
885 * to get the actual number of unique distances.
886 */
887 nr_depth = distance_ref_points_depth + 1;
888
889 WARN_ON(nr_depth > sizeof(distance_map));
890
891 bitmap_zero(&distance_map, nr_depth);
892 bitmap_set(&distance_map, 0, 1);
893
894 for_each_online_node(node) {
895 int nd, distance = LOCAL_DISTANCE;
896
897 if (node == first_online_node)
898 continue;
899
900 nd = __node_distance(node, first_online_node);
901 for (i = 0; i < nr_depth; i++, distance *= 2) {
902 if (distance == nd) {
903 bitmap_set(&distance_map, i, 1);
904 break;
905 }
906 }
907 nr_levels = bitmap_weight(&distance_map, nr_depth);
908 if (nr_levels == nr_depth)
909 return;
910 }
911
912 for_each_node(node) {
913 if (node_online(node))
914 continue;
915
916 i = find_first_zero_bit(&distance_map, nr_depth);
917 if (i >= nr_depth || i == 0) {
918 pr_warn("Levels(%d) not matching levels(%d)", nr_levels, nr_depth);
919 return;
920 }
921
922 bitmap_set(&distance_map, i, 1);
923 while (i--)
924 distance_lookup_table[node][i] = node;
925
926 nr_levels = bitmap_weight(&distance_map, nr_depth);
927 if (nr_levels == nr_depth)
928 return;
929 }
930 }
931
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx
Attachment:
.config.gz
Description: application/gzip