From: "Paul E. McKenney" <paulmck@kernel.org>
To: kernel test robot <lkp@intel.com>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org
Subject: Re: [rcu:urezki-pcount.2020.09.26a 17/17] kernel/rcu/tree.c:3315:52: sparse: sparse: incorrect type in argument 2 (different base types)
Date: Sun, 27 Sep 2020 08:35:58 -0700 [thread overview]
Message-ID: <20200927153558.GK29330@paulmck-ThinkPad-P72> (raw)
In-Reply-To: <202009270628.gklDosgG%lkp@intel.com>
On Sun, Sep 27, 2020 at 06:55:31AM +0800, kernel test robot wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git urezki-pcount.2020.09.26a
> head: e9bed2a1239b017d78cec5de66adce0560f6d077
> commit: e9bed2a1239b017d78cec5de66adce0560f6d077 [17/17] kvfree_rcu(): Switch to kmalloc() and kfree() for allocations
> config: i386-randconfig-s002-20200927 (attached as .config)
> compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
> reproduce:
> # apt-get install sparse
> # sparse version: v0.6.2-201-g24bdaac6-dirty
> # https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git/commit/?id=e9bed2a1239b017d78cec5de66adce0560f6d077
> git remote add rcu https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
> git fetch --no-tags rcu urezki-pcount.2020.09.26a
> git checkout e9bed2a1239b017d78cec5de66adce0560f6d077
> # 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@intel.com>
Fixed by 1a8eee1cc5b0 ("squash! kvfree_rcu: Switch to GFP_ATOMIC when
preemption is enabled"), to be squashed into the original.
Thank you for your testing efforts!
Thanx, Paul
> sparse warnings: (new ones prefixed by >>)
>
> kernel/rcu/tree.c:1344:13: sparse: sparse: context imbalance in 'rcu_start_this_gp' - different lock contexts for basic block
> kernel/rcu/tree.c:1787:9: sparse: sparse: context imbalance in 'rcu_gp_init' - different lock contexts for basic block
> kernel/rcu/tree.c:2542:9: sparse: sparse: context imbalance in 'force_qs_rnp' - different lock contexts for basic block
> kernel/rcu/tree.c:2596:25: sparse: sparse: context imbalance in 'rcu_force_quiescent_state' - unexpected unlock
> kernel/rcu/tree.c:3299:29: sparse: sparse: incorrect type in initializer (different base types) @@ expected int gfp @@ got restricted gfp_t @@
> kernel/rcu/tree.c:3299:29: sparse: expected int gfp
> kernel/rcu/tree.c:3299:29: sparse: got restricted gfp_t
> >> kernel/rcu/tree.c:3315:52: sparse: sparse: incorrect type in argument 2 (different base types) @@ expected restricted gfp_t [usertype] flags @@ got int gfp @@
> >> kernel/rcu/tree.c:3315:52: sparse: expected restricted gfp_t [usertype] flags
> kernel/rcu/tree.c:3315:52: sparse: got int gfp
> kernel/rcu/tree.c: note: in included file:
> kernel/rcu/tree_stall.h:749:17: sparse: sparse: context imbalance in 'rcu_check_gp_start_stall' - different lock contexts for basic block
> kernel/rcu/tree.c: note: in included file:
> kernel/rcu/tree_exp.h:189:9: sparse: sparse: context imbalance in '__rcu_report_exp_rnp' - different lock contexts for basic block
>
> vim +3315 kernel/rcu/tree.c
>
> 3292
> 3293 static inline bool
> 3294 add_ptr_to_bulk_krc_lock(struct kfree_rcu_cpu **krcp,
> 3295 unsigned long *flags, void *ptr, bool can_sleep)
> 3296 {
> 3297 struct kvfree_rcu_bulk_data *bnode;
> 3298 bool can_alloc_page = preemptible();
> 3299 int gfp = can_sleep ? GFP_NOWAIT | __GFP_NOWARN : GFP_ATOMIC;
> 3300 int idx;
> 3301
> 3302 *krcp = krc_this_cpu_lock(flags);
> 3303 if (unlikely(!(*krcp)->initialized))
> 3304 return false;
> 3305
> 3306 idx = !!is_vmalloc_addr(ptr);
> 3307
> 3308 /* Check if a new block is required. */
> 3309 if (!(*krcp)->bkvhead[idx] ||
> 3310 (*krcp)->bkvhead[idx]->nr_records == KVFREE_BULK_MAX_ENTR) {
> 3311 bnode = get_cached_bnode(*krcp);
> 3312 if (!bnode && can_alloc_page) {
> 3313 migrate_disable();
> 3314 krc_this_cpu_unlock(*krcp, *flags);
> > 3315 bnode = kmalloc(PAGE_SIZE, gfp);
> 3316 *krcp = krc_this_cpu_lock(flags);
> 3317 migrate_enable();
> 3318 }
> 3319
> 3320 /* Switch to emergency path. */
> 3321 if (unlikely(!bnode))
> 3322 return false;
> 3323
> 3324 /* Initialize the new block. */
> 3325 bnode->nr_records = 0;
> 3326 bnode->next = (*krcp)->bkvhead[idx];
> 3327
> 3328 /* Attach it to the head. */
> 3329 (*krcp)->bkvhead[idx] = bnode;
> 3330 }
> 3331
> 3332 /* Finally insert. */
> 3333 (*krcp)->bkvhead[idx]->records
> 3334 [(*krcp)->bkvhead[idx]->nr_records++] = ptr;
> 3335
> 3336 return true;
> 3337 }
> 3338
>
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
prev parent reply other threads:[~2020-09-27 15:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-26 22:55 kernel test robot
2020-09-27 15:35 ` Paul E. McKenney [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200927153558.GK29330@paulmck-ThinkPad-P72 \
--to=paulmck@kernel.org \
--cc=kbuild-all@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®