Re: [paulmck-rcu:dev.2024.07.25a 15/43] kernel/rcu/rcuscale.c:1021:2: error: use of undeclared identifier 'writer_done'

From: Paul E. McKenney
Date: Tue Jul 30 2024 - 16:37:43 EST


On Tue, Jul 30, 2024 at 12:43:00AM +0800, kernel test robot wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git dev.2024.07.25a
> head: 24e3bccdf4bc0ae57b0e89e0313fd4450fde12af
> commit: 54ff7b22b9062495092737217877be2bdd3dabd4 [15/43] rcuscale: Save a few lines with whitespace-only change
> config: x86_64-randconfig-071-20240728 (https://download.01.org/0day-ci/archive/20240730/202407300009.05X7YXZC-lkp@xxxxxxxxx/config)
> compiler: clang version 18.1.5 (https://github.com/llvm/llvm-project 617a15a9eac96088ae5e9134248d8236e34b91b1)
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240730/202407300009.05X7YXZC-lkp@xxxxxxxxx/reproduce)
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@xxxxxxxxx>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202407300009.05X7YXZC-lkp@xxxxxxxxx/
>
> Note: the paulmck-rcu/dev.2024.07.25a HEAD 24e3bccdf4bc0ae57b0e89e0313fd4450fde12af builds fine.
> It only hurts bisectability.
>
> All errors (new ones prefixed by >>):
>
> >> kernel/rcu/rcuscale.c:1021:2: error: use of undeclared identifier 'writer_done'
> 1021 | writer_done = kcalloc(nrealwriters, sizeof(writer_done[0]), GFP_KERNEL);
> | ^
> kernel/rcu/rcuscale.c:1021:45: error: use of undeclared identifier 'writer_done'
> 1021 | writer_done = kcalloc(nrealwriters, sizeof(writer_done[0]), GFP_KERNEL);
> | ^
> kernel/rcu/rcuscale.c:1021:45: error: use of undeclared identifier 'writer_done'
> kernel/rcu/rcuscale.c:1022:68: error: use of undeclared identifier 'writer_done'
> 1022 | if (!writer_tasks || !writer_durations || !writer_n_durations || !writer_done) {
> | ^
> 4 errors generated.

Good catch!!!

This should be fixed by 2b65b350efe5 ("rcuscale: Save a few lines with
whitespace-only change"). Please let me know if issues remain.

Thanx, Paul

> vim +/writer_done +1021 kernel/rcu/rcuscale.c
>
> 946
> 947 static int __init
> 948 rcu_scale_init(void)
> 949 {
> 950 long i;
> 951 int firsterr = 0;
> 952 static struct rcu_scale_ops *scale_ops[] = {
> 953 &rcu_ops, &srcu_ops, &srcud_ops, TASKS_OPS TASKS_RUDE_OPS TASKS_TRACING_OPS
> 954 };
> 955
> 956 if (!torture_init_begin(scale_type, verbose))
> 957 return -EBUSY;
> 958
> 959 /* Process args and announce that the scalability'er is on the job. */
> 960 for (i = 0; i < ARRAY_SIZE(scale_ops); i++) {
> 961 cur_ops = scale_ops[i];
> 962 if (strcmp(scale_type, cur_ops->name) == 0)
> 963 break;
> 964 }
> 965 if (i == ARRAY_SIZE(scale_ops)) {
> 966 pr_alert("rcu-scale: invalid scale type: \"%s\"\n", scale_type);
> 967 pr_alert("rcu-scale types:");
> 968 for (i = 0; i < ARRAY_SIZE(scale_ops); i++)
> 969 pr_cont(" %s", scale_ops[i]->name);
> 970 pr_cont("\n");
> 971 firsterr = -EINVAL;
> 972 cur_ops = NULL;
> 973 goto unwind;
> 974 }
> 975 if (cur_ops->init)
> 976 cur_ops->init();
> 977
> 978 if (cur_ops->rso_gp_kthread) {
> 979 kthread_tp = cur_ops->rso_gp_kthread();
> 980 if (kthread_tp)
> 981 kthread_stime = kthread_tp->stime;
> 982 }
> 983 if (kfree_rcu_test)
> 984 return kfree_scale_init();
> 985
> 986 nrealwriters = compute_real(nwriters);
> 987 nrealreaders = compute_real(nreaders);
> 988 atomic_set(&n_rcu_scale_reader_started, 0);
> 989 atomic_set(&n_rcu_scale_writer_started, 0);
> 990 atomic_set(&n_rcu_scale_writer_finished, 0);
> 991 rcu_scale_print_module_parms(cur_ops, "Start of test");
> 992
> 993 /* Start up the kthreads. */
> 994
> 995 if (shutdown) {
> 996 init_waitqueue_head(&shutdown_wq);
> 997 firsterr = torture_create_kthread(rcu_scale_shutdown, NULL,
> 998 shutdown_task);
> 999 if (torture_init_error(firsterr))
> 1000 goto unwind;
> 1001 schedule_timeout_uninterruptible(1);
> 1002 }
> 1003 reader_tasks = kcalloc(nrealreaders, sizeof(reader_tasks[0]),
> 1004 GFP_KERNEL);
> 1005 if (reader_tasks == NULL) {
> 1006 SCALEOUT_ERRSTRING("out of memory");
> 1007 firsterr = -ENOMEM;
> 1008 goto unwind;
> 1009 }
> 1010 for (i = 0; i < nrealreaders; i++) {
> 1011 firsterr = torture_create_kthread(rcu_scale_reader, (void *)i,
> 1012 reader_tasks[i]);
> 1013 if (torture_init_error(firsterr))
> 1014 goto unwind;
> 1015 }
> 1016 while (atomic_read(&n_rcu_scale_reader_started) < nrealreaders)
> 1017 schedule_timeout_uninterruptible(1);
> 1018 writer_tasks = kcalloc(nrealwriters, sizeof(writer_tasks[0]), GFP_KERNEL);
> 1019 writer_durations = kcalloc(nrealwriters, sizeof(*writer_durations), GFP_KERNEL);
> 1020 writer_n_durations = kcalloc(nrealwriters, sizeof(*writer_n_durations), GFP_KERNEL);
> > 1021 writer_done = kcalloc(nrealwriters, sizeof(writer_done[0]), GFP_KERNEL);
> 1022 if (!writer_tasks || !writer_durations || !writer_n_durations || !writer_done) {
> 1023 SCALEOUT_ERRSTRING("out of memory");
> 1024 firsterr = -ENOMEM;
> 1025 goto unwind;
> 1026 }
> 1027 for (i = 0; i < nrealwriters; i++) {
> 1028 writer_durations[i] =
> 1029 kcalloc(MAX_MEAS, sizeof(*writer_durations[i]),
> 1030 GFP_KERNEL);
> 1031 if (!writer_durations[i]) {
> 1032 firsterr = -ENOMEM;
> 1033 goto unwind;
> 1034 }
> 1035 firsterr = torture_create_kthread(rcu_scale_writer, (void *)i,
> 1036 writer_tasks[i]);
> 1037 if (torture_init_error(firsterr))
> 1038 goto unwind;
> 1039 }
> 1040 torture_init_end();
> 1041 return 0;
> 1042
> 1043 unwind:
> 1044 torture_init_end();
> 1045 rcu_scale_cleanup();
> 1046 if (shutdown) {
> 1047 WARN_ON(!IS_MODULE(CONFIG_RCU_SCALE_TEST));
> 1048 kernel_power_off();
> 1049 }
> 1050 return firsterr;
> 1051 }
> 1052
>
> --
> 0-DAY CI Kernel Test Service
> https://github.com/intel/lkp-tests/wiki