linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Oleg Nesterov <oleg@redhat.com>
Cc: Greg Thelen <gthelen@google.com>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: INFO: suspicious rcu_dereference_check() usage - kernel/pid.c:419 invoked rcu_dereference_check() without protection!
Date: Tue, 9 Nov 2010 12:29:00 -0800	[thread overview]
Message-ID: <20101109202900.GV4032@linux.vnet.ibm.com> (raw)
In-Reply-To: <20101108151509.GA3702@redhat.com>

On Mon, Nov 08, 2010 at 04:15:09PM +0100, Oleg Nesterov wrote:
> On 11/07, Paul E. McKenney wrote:
> >
> > On Tue, Oct 12, 2010 at 12:08:46AM -0700, Greg Thelen wrote:
> > >
> > > ioprio_set() contains a comment warning against of usage of
> > > rcu_read_lock() to avoid this warning:
> > > 	/*
> > > 	 * We want IOPRIO_WHO_PGRP/IOPRIO_WHO_USER to be "atomic",
> > > 	 * so we can't use rcu_read_lock(). See re-copy of ->ioprio
> > > 	 * in copy_process().
> > > 	 */
> > >
> > > So I'm not sure what the best fix is.
> 
> (please note that "we can't use rcu_read_lock()" actually meant
>  rcu_read_lock() is not _enough_)
> 
> > I must defer to Oleg, who wrote the comment.  But please see below.
> 
> I added this comment to explain some oddities in copy_process().
> Nobody confirmed my understanding was correct ;)
> 
> In any case, this comment doesn't look right today. This code was
> changed by fd0928df98b9578be8a786ac0cb78a47a5e17a20
> "ioprio: move io priority from task_struct to io_context" after that,
> tasklist can't help to make sys_ioprio_set(IOPRIO_WHO_PGRP) atomic.
> 
> I think tasklist_lock can be removed now.
> 
> And, as Paul pointed out, we need rcu_read_lock() anyway, it was
> already added by Sergey.

Thank you, Oleg!  Greg, would you be willing to update your patch
to remove the comment?  (Perhaps tasklist_lock as well...)

							Thanx, Paul

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom policy in Canada: sign http://dissolvethecrtc.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2010-11-09 20:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-12  7:08 INFO: suspicious rcu_dereference_check() usage - kernel/pid.c:419 invoked rcu_dereference_check() without protection! Greg Thelen
2010-11-07 18:20 ` Paul E. McKenney
2010-11-08 15:15   ` Oleg Nesterov
2010-11-09 20:29     ` Paul E. McKenney [this message]
2010-11-10 15:55       ` Oleg Nesterov
2010-11-10 16:02         ` Oleg Nesterov
2010-11-11 11:19           ` Jens Axboe
2010-11-11 12:30             ` Oleg Nesterov
2010-11-11 12:39               ` Jens Axboe
2010-11-11 19:45                 ` Greg Thelen
2010-11-11 22:00                   ` Oleg Nesterov

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=20101109202900.GV4032@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=gthelen@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=oleg@redhat.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;
as well as URLs for NNTP newsgroup(s).