[frederic-dynticks:isolation/split 9/13] kernel/rcu/rcutorture.c:1718:49: sparse: sparse: incorrect type in argument 1 (different modifiers)

From: kernel test robot
Date: Thu Oct 28 2021 - 02:23:30 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/frederic/linux-dynticks.git isolation/split
head: c4988a7256e9e02fb2503a7a0e748ab7b50667b6
commit: 8ea31dca120d4d746a70867c26ca97bb9f4b0471 [9/13] rcu/nocb: Pass a cpumask instead of a single CPU to offload/deoffload
config: i386-randconfig-s001-20211027 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.4-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/frederic/linux-dynticks.git/commit/?id=8ea31dca120d4d746a70867c26ca97bb9f4b0471
git remote add frederic-dynticks https://git.kernel.org/pub/scm/linux/kernel/git/frederic/linux-dynticks.git
git fetch --no-tags frederic-dynticks isolation/split
git checkout 8ea31dca120d4d746a70867c26ca97bb9f4b0471
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386

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


sparse warnings: (new ones prefixed by >>)
kernel/rcu/rcutorture.c:563:1: sparse: sparse: symbol '__srcu_struct_srcu_ctl' was not declared. Should it be static?
>> kernel/rcu/rcutorture.c:1718:49: sparse: sparse: incorrect type in argument 1 (different modifiers) @@ expected struct cpumask *cpumask @@ got struct cpumask const * @@
kernel/rcu/rcutorture.c:1718:49: sparse: expected struct cpumask *cpumask
kernel/rcu/rcutorture.c:1718:49: sparse: got struct cpumask const *
kernel/rcu/rcutorture.c:1721:49: sparse: sparse: incorrect type in argument 1 (different modifiers) @@ expected struct cpumask *cpumask @@ got struct cpumask const * @@
kernel/rcu/rcutorture.c:1721:49: sparse: expected struct cpumask *cpumask
kernel/rcu/rcutorture.c:1721:49: sparse: got struct cpumask const *
kernel/rcu/rcutorture.c:785:12: sparse: sparse: context imbalance in 'rcu_torture_read_lock_trivial' - wrong count at exit
kernel/rcu/rcutorture.c:793:9: sparse: sparse: context imbalance in 'rcu_torture_read_unlock_trivial' - wrong count at exit
kernel/rcu/rcutorture.c:1468:9: sparse: sparse: context imbalance in 'rcutorture_one_extend' - different lock contexts for basic block

vim +1718 kernel/rcu/rcutorture.c

1686
1687 /*
1688 * Randomly Toggle CPUs' callback-offload state. This uses hrtimers to
1689 * increase race probabilities and fuzzes the interval between toggling.
1690 */
1691 static int rcu_nocb_toggle(void *arg)
1692 {
1693 int cpu;
1694 int maxcpu = -1;
1695 int oldnice = task_nice(current);
1696 long r;
1697 DEFINE_TORTURE_RANDOM(rand);
1698 ktime_t toggle_delay;
1699 unsigned long toggle_fuzz;
1700 ktime_t toggle_interval = ms_to_ktime(nocbs_toggle);
1701
1702 VERBOSE_TOROUT_STRING("rcu_nocb_toggle task started");
1703 while (!rcu_inkernel_boot_has_ended())
1704 schedule_timeout_interruptible(HZ / 10);
1705 for_each_online_cpu(cpu)
1706 maxcpu = cpu;
1707 WARN_ON(maxcpu < 0);
1708 if (toggle_interval > ULONG_MAX)
1709 toggle_fuzz = ULONG_MAX >> 3;
1710 else
1711 toggle_fuzz = toggle_interval >> 3;
1712 if (toggle_fuzz <= 0)
1713 toggle_fuzz = NSEC_PER_USEC;
1714 do {
1715 r = torture_random(&rand);
1716 cpu = (r >> 4) % (maxcpu + 1);
1717 if (r & 0x1) {
> 1718 rcu_nocb_cpumask_update(cpumask_of(cpu), true);
1719 atomic_long_inc(&n_nocb_offload);
1720 } else {
1721 rcu_nocb_cpumask_update(cpumask_of(cpu), false);
1722 atomic_long_inc(&n_nocb_deoffload);
1723 }
1724 toggle_delay = torture_random(&rand) % toggle_fuzz + toggle_interval;
1725 set_current_state(TASK_INTERRUPTIBLE);
1726 schedule_hrtimeout(&toggle_delay, HRTIMER_MODE_REL);
1727 if (stutter_wait("rcu_nocb_toggle"))
1728 sched_set_normal(current, oldnice);
1729 } while (!torture_must_stop());
1730 torture_kthread_stopping("rcu_nocb_toggle");
1731 return 0;
1732 }
1733

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

Attachment: .config.gz
Description: application/gzip