From: Andrew Jones <ajones@ventanamicro.com>
To: lkp@lists.01.org
Subject: Re: [oliver.sang@intel.com: [cpumask] b9a7ecc71f: WARNING:at_include/linux/cpumask.h:#__is_kernel_percpu_address]
Date: Tue, 11 Oct 2022 20:04:42 +0200 [thread overview]
Message-ID: <20221011180442.cwjtcvjioias3qt6@kamzik> (raw)
In-Reply-To: <Y0Wmj+XnyD/c6XM3@yury-laptop>
[-- Attachment #1: Type: text/plain, Size: 1590 bytes --]
On Tue, Oct 11, 2022 at 10:23:27AM -0700, Yury Norov wrote:
> On Tue, Oct 11, 2022 at 10:16:03AM -0700, Yury Norov wrote:
> > > Hi Yury,
> > >
> > > I just wanted to report that the warning fires when doing
> > > 'cat /proc/cpuinfo' on at least x86 and riscv. I don't think
> > > those are false positives. I'm guessing a patch should be
> > > something like the following diff. If you haven't already
> > > addressed this and I'm not off in left field, then I guess
> > > we should integrate it into your series.
> > >
> > > Thanks,
> > > drew
> >
> > Hi Andrew,
> >
> > Can you please send it as a patch with a description?
>
> Also, can you describe why we'd silence the warning this way?
> If the cpu number greater than nr_cpu_ids comes from upper layer,
> we quite probably should investigate what happens there...
Darn, I fired off the patches before reading this. I didn't try to
completely digest seq_read_iter(), but on a quick look I think the
reason is that it implements something like
p = start();
while (1) {
p = next();
if (!p)
break;
show();
}
stop();
where cpuinfo's operators are
start()
{
*pos = cpumask_next(*pos - 1, cpu_online_mask);
if (*pos < nr_cpu_ids)
return ...;
return NULL;
}
next()
{
(*pos)++;
return start(..., pos);
}
So the justification for the patches the way I've written them is
that I think we just need to return NULL from start / next when
we've gone too far, before we first warn and then return NULL.
Thanks,
drew
prev parent reply other threads:[~2022-10-11 18:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-01 1:49 [oliver.sang@intel.com: [cpumask] b9a7ecc71f: WARNING:at_include/linux/cpumask.h:#__is_kernel_percpu_address] Yury Norov
2022-10-01 16:20 ` Linus Torvalds
2022-10-01 17:16 ` Yury Norov
2022-10-11 17:09 ` Andrew Jones
2022-10-11 17:16 ` Yury Norov
2022-10-11 17:21 ` Andrew Jones
2022-10-11 17:23 ` Yury Norov
2022-10-11 18:04 ` Andrew Jones [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=20221011180442.cwjtcvjioias3qt6@kamzik \
--to=ajones@ventanamicro.com \
--cc=lkp@lists.01.org \
/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;
as well as URLs for NNTP newsgroup(s).