From: Philip Li <philip.li@intel.com>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: kernel test robot <lkp@intel.com>,
<oe-kbuild-all@lists.linux.dev>, <linux-kernel@vger.kernel.org>,
Thomas Gleixner <tglx@linutronix.de>
Subject: Re: lib/flex_proportions.c:73:9: sparse: sparse: incorrect type in argument 1 (different address spaces)
Date: Sat, 11 Nov 2023 09:54:33 +0800 [thread overview]
Message-ID: <ZU7e2bhGV9NR9THx@rli9-mobl> (raw)
In-Reply-To: <20231110154208.5UoC_qsI@linutronix.de>
On Fri, Nov 10, 2023 at 04:42:08PM +0100, Sebastian Andrzej Siewior wrote:
> On 2023-11-08 09:04:40 [+0800], kernel test robot wrote:
> …
> Could you please explain what is wrong here? The code in line 73 has no
> percpu reference at all. Or expects an argument.
Apologize for the confusing report, we will investigate this in earliest
time to understand what goes wrong. Kindly ignore this and sorry for the noise.
>
> > sparse warnings: (new ones prefixed by >>)
> > >> lib/flex_proportions.c:73:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got unsigned int [noderef] __percpu * @@
> > lib/flex_proportions.c:73:9: sparse: expected void *ptr
> > lib/flex_proportions.c:73:9: sparse: got unsigned int [noderef] __percpu *
> > >> lib/flex_proportions.c:73:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got unsigned int [noderef] __percpu * @@
> > lib/flex_proportions.c:73:9: sparse: expected void *ptr
> > lib/flex_proportions.c:73:9: sparse: got unsigned int [noderef] __percpu *
> > >> lib/flex_proportions.c:73:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got unsigned int [noderef] __percpu * @@
> > lib/flex_proportions.c:73:9: sparse: expected void *ptr
> > lib/flex_proportions.c:73:9: sparse: got unsigned int [noderef] __percpu *
> > >> lib/flex_proportions.c:73:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got unsigned int [noderef] __percpu * @@
> > lib/flex_proportions.c:73:9: sparse: expected void *ptr
> > lib/flex_proportions.c:73:9: sparse: got unsigned int [noderef] __percpu *
> > >> lib/flex_proportions.c:73:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got int [noderef] __percpu * @@
> > lib/flex_proportions.c:73:9: sparse: expected void *ptr
> > lib/flex_proportions.c:73:9: sparse: got int [noderef] __percpu *
> > >> lib/flex_proportions.c:73:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got int [noderef] __percpu * @@
> > lib/flex_proportions.c:73:9: sparse: expected void *ptr
> > lib/flex_proportions.c:73:9: sparse: got int [noderef] __percpu *
> > >> lib/flex_proportions.c:73:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got int [noderef] __percpu * @@
> > lib/flex_proportions.c:73:9: sparse: expected void *ptr
> > lib/flex_proportions.c:73:9: sparse: got int [noderef] __percpu *
> > >> lib/flex_proportions.c:73:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *ptr @@ got int [noderef] __percpu * @@
> > lib/flex_proportions.c:73:9: sparse: expected void *ptr
> > lib/flex_proportions.c:73:9: sparse: got int [noderef] __percpu *
> > lib/flex_proportions.c: note: in included file (through include/linux/mmzone.h, include/linux/gfp.h, include/linux/percpu_counter.h, ...):
> >
> > vim +73 lib/flex_proportions.c
> >
> > 55
> > 56 /*
> > 57 * Declare @periods new periods. It is upto the caller to make sure period
> > 58 * transitions cannot happen in parallel.
> > 59 *
> > 60 * The function returns true if the proportions are still defined and false
> > 61 * if aging zeroed out all events. This can be used to detect whether declaring
> > 62 * further periods has any effect.
> > 63 */
> > 64 bool fprop_new_period(struct fprop_global *p, int periods)
> > 65 {
> > 66 s64 events = percpu_counter_sum(&p->events);
> > 67
> > 68 /*
> > 69 * Don't do anything if there are no events.
> > 70 */
> > 71 if (events <= 1)
> > 72 return false;
> > > 73 preempt_disable_nested();
> > 74 write_seqcount_begin(&p->sequence);
> > 75 if (periods < 64)
> > 76 events -= events >> periods;
> > 77 /* Use addition to avoid losing events happening between sum and set */
> > 78 percpu_counter_add(&p->events, -events);
> > 79 p->period += periods;
> > 80 write_seqcount_end(&p->sequence);
> > 81 preempt_enable_nested();
> > 82
> > 83 return true;
> > 84 }
> > 85
> >
> Sebastian
>
next prev parent reply other threads:[~2023-11-11 1:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-08 1:04 kernel test robot
2023-11-10 15:42 ` Sebastian Andrzej Siewior
2023-11-11 1:54 ` Philip Li [this message]
2023-11-11 9:42 ` Philip Li
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=ZU7e2bhGV9NR9THx@rli9-mobl \
--to=philip.li@intel.com \
--cc=bigeasy@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=tglx@linutronix.de \
/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®