From: Johannes Weiner <hannes@cmpxchg.org>
To: Matthew Wilcox <willy@infradead.org>
Cc: "Paul E. McKenney" <paulmck@linux.ibm.com>,
Andrew Morton <akpm@linux-foundation.org>,
kbuild test robot <lkp@intel.com>,
Suren Baghdasaryan <surenb@google.com>,
kbuild-all@01.org,
Linux Memory Management List <linux-mm@kvack.org>
Subject: Re: [linux-next:master 6618/6917] kernel/sched/psi.c:1230:13: sparse: error: incompatible types in comparison expression (different address spaces)
Date: Tue, 12 Feb 2019 11:31:45 -0500 [thread overview]
Message-ID: <20190212163145.GD14231@cmpxchg.org> (raw)
In-Reply-To: <20190212013606.GJ12668@bombadil.infradead.org>
On Mon, Feb 11, 2019 at 05:36:06PM -0800, Matthew Wilcox wrote:
> On Fri, Feb 08, 2019 at 11:44:07PM -0800, Paul E. McKenney wrote:
> > On Fri, Feb 08, 2019 at 03:14:41PM -0800, Andrew Morton wrote:
> > > On Fri, 8 Feb 2019 02:29:33 +0800 kbuild test robot <lkp@intel.com> wrote:
> > > > 1223 static __poll_t psi_fop_poll(struct file *file, poll_table *wait)
> > > > 1224 {
> > > > 1225 struct seq_file *seq = file->private_data;
> > > > 1226 struct psi_trigger *t;
> > > > 1227 __poll_t ret;
> > > > 1228
> > > > 1229 rcu_read_lock();
> > > > > 1230 t = rcu_dereference(seq->private);
>
> So the problem here is the opposite of what we think it is -- seq->private
> is not marked as being RCU protected.
>
> > If you wish to opt into this checking, you need to mark the pointer
> > definitions (in this case ->private) with __rcu. It may also
> > be necessary to mark function parameters as well, as is done for
> > radix_tree_iter_resume(). If you do not wish to use this checking,
> > you should ignore these sparse warnings.
We cannot make struct seq_file->private generally __rcu, but the
cgroup code has a similar thing with kernfs, where it's doing rcu for
its particular use of struct kernfs_node->private. This is how it does
the dereference:
cgrp = rcu_dereference(*(void __rcu __force **)&kn->priv);
We could do this here as well.
It's ugly, though. I'd also be fine with ignoring the sparse warning.
next prev parent reply other threads:[~2019-02-12 16:31 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-07 18:29 [linux-next:master 6618/6917] kernel/sched/psi.c:1230:13: sparse: error: incompatible types in comparison expression (different address spaces) kbuild test robot
2019-02-08 23:14 ` Andrew Morton
2019-02-09 7:44 ` Paul E. McKenney
2019-02-12 1:00 ` Andrew Morton
2019-02-12 15:54 ` Paul E. McKenney
2019-02-12 1:36 ` Matthew Wilcox
2019-02-12 15:56 ` Paul E. McKenney
2019-02-12 16:25 ` Matthew Wilcox
2019-02-12 16:31 ` Paul E. McKenney
2019-02-12 16:31 ` Johannes Weiner [this message]
2019-02-12 16:35 ` Matthew Wilcox
2019-02-14 1:50 ` Suren Baghdasaryan
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=20190212163145.GD14231@cmpxchg.org \
--to=hannes@cmpxchg.org \
--cc=akpm@linux-foundation.org \
--cc=kbuild-all@01.org \
--cc=linux-mm@kvack.org \
--cc=lkp@intel.com \
--cc=paulmck@linux.ibm.com \
--cc=surenb@google.com \
--cc=willy@infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.