From: Oleg Nesterov <oleg@redhat.com>
To: Christian Brauner <christian.brauner@ubuntu.com>
Cc: paulmck@kernel.org, peterz@infradead.org,
linux-kernel@vger.kernel.org, rcu@vger.kernel.org,
madhuparnabhowmik10@gmail.com, joel@joelfernandes.org,
linux-kernel-mentees@lists.linuxfoundation.org, mingo@kernel.org
Subject: Re: [Linux-kernel-mentees] [PATCH] exit.c: Fix Sparse errors and warnings
Date: Thu, 30 Jan 2020 12:33:41 +0100 [thread overview]
Message-ID: <20200130113339.GA25426@redhat.com> (raw)
In-Reply-To: <20200130103158.azxldyfnugwvv6vy@wittgenstein>
On 01/30, Christian Brauner wrote:
>
> On Thu, Jan 30, 2020 at 11:50:28AM +0530, madhuparnabhowmik10@gmail.com wrote:
> > From: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
> >
> > This patch fixes the following sparse error:
> > kernel/exit.c:627:25: error: incompatible types in comparison expression
> >
> > And the following warning:
> > kernel/exit.c:626:40: warning: incorrect type in assignment
> >
> > Signed-off-by: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
>
> I think the previous version was already fine but hopefully
> RCU_INIT_POINTER() really saves some overhead. In any case:
It is not about overhead, RCU_INIT_POINTER() documents the fact that we
didn't make any changes to the new parent, we only need to change the
pointer.
And btw, I don't really understand the __rcu annotations. Say, according
to sparse this code is wrong:
int __rcu *P;
void func(int *p)
{
P = p;
}
OK, although quite possibly it is fine.
However, this code
int __rcu *P;
void func(int __rcu *p)
{
*p = 10;
P = p;
}
is almost certainly wrong but sparse is happy, asn is the same.
> Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
Acked-by: Oleg Nesterov <oleg@redhat.com>
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
WARNING: multiple messages have this Message-ID (diff)
From: Oleg Nesterov <oleg@redhat.com>
To: Christian Brauner <christian.brauner@ubuntu.com>
Cc: madhuparnabhowmik10@gmail.com, peterz@infradead.org,
mingo@kernel.org, paulmck@kernel.org,
linux-kernel@vger.kernel.org, joel@joelfernandes.org,
linux-kernel-mentees@lists.linuxfoundation.org,
rcu@vger.kernel.org
Subject: Re: [PATCH] exit.c: Fix Sparse errors and warnings
Date: Thu, 30 Jan 2020 12:33:41 +0100 [thread overview]
Message-ID: <20200130113339.GA25426@redhat.com> (raw)
In-Reply-To: <20200130103158.azxldyfnugwvv6vy@wittgenstein>
On 01/30, Christian Brauner wrote:
>
> On Thu, Jan 30, 2020 at 11:50:28AM +0530, madhuparnabhowmik10@gmail.com wrote:
> > From: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
> >
> > This patch fixes the following sparse error:
> > kernel/exit.c:627:25: error: incompatible types in comparison expression
> >
> > And the following warning:
> > kernel/exit.c:626:40: warning: incorrect type in assignment
> >
> > Signed-off-by: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
>
> I think the previous version was already fine but hopefully
> RCU_INIT_POINTER() really saves some overhead. In any case:
It is not about overhead, RCU_INIT_POINTER() documents the fact that we
didn't make any changes to the new parent, we only need to change the
pointer.
And btw, I don't really understand the __rcu annotations. Say, according
to sparse this code is wrong:
int __rcu *P;
void func(int *p)
{
P = p;
}
OK, although quite possibly it is fine.
However, this code
int __rcu *P;
void func(int __rcu *p)
{
*p = 10;
P = p;
}
is almost certainly wrong but sparse is happy, asn is the same.
> Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
Acked-by: Oleg Nesterov <oleg@redhat.com>
next prev parent reply other threads:[~2020-01-30 11:33 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-30 6:20 [Linux-kernel-mentees] [PATCH] exit.c: Fix Sparse errors and warnings madhuparnabhowmik10
2020-01-30 6:20 ` madhuparnabhowmik10
2020-01-30 10:31 ` [Linux-kernel-mentees] " Christian Brauner
2020-01-30 10:31 ` Christian Brauner
2020-01-30 11:33 ` Oleg Nesterov [this message]
2020-01-30 11:33 ` Oleg Nesterov
2020-01-30 11:45 ` [Linux-kernel-mentees] " Christian Brauner
2020-01-30 11:45 ` Christian Brauner
2020-01-30 15:20 ` [Linux-kernel-mentees] " Christian Brauner
2020-01-30 15:20 ` Christian Brauner
-- strict thread matches above, loose matches on Subject: below --
2020-01-28 17:20 [Linux-kernel-mentees] " madhuparnabhowmik10
2020-01-28 18:01 ` Christian Brauner
2020-01-29 12:30 ` Oleg Nesterov
2020-01-29 16:02 ` Madhuparna Bhowmik
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=20200130113339.GA25426@redhat.com \
--to=oleg@redhat.com \
--cc=christian.brauner@ubuntu.com \
--cc=joel@joelfernandes.org \
--cc=linux-kernel-mentees@lists.linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=madhuparnabhowmik10@gmail.com \
--cc=mingo@kernel.org \
--cc=paulmck@kernel.org \
--cc=peterz@infradead.org \
--cc=rcu@vger.kernel.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.