public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Eric Paris <eparis@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Eric Paris <eparis@parisplace.org>,
	Miles Lane <miles.lane@gmail.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: INFO: suspicious rcu_dereference_check() usage - include/linux/cgroup.h:492 invoked rcu_dereference_check() without protection!
Date: Mon, 19 Apr 2010 20:04:52 -0700	[thread overview]
Message-ID: <20100420030452.GB2905@linux.vnet.ibm.com> (raw)
In-Reply-To: <1271726729.2972.13.camel@dhcp231-113.rdu.redhat.com>

On Mon, Apr 19, 2010 at 09:25:29PM -0400, Eric Paris wrote:
> On Mon, 2010-04-19 at 16:01 -0700, Paul E. McKenney wrote:
> 
> > Yep, different code path to the same location.  Does the following
> > patch help?
> > 
> > 							Thanx, Paul
> > 
> > ------------------------------------------------------------------------
> > 
> > commit 2836f18139267ea918ed2cf39023fb0eb38c4361
> > Author: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> > Date:   Mon Apr 19 15:59:50 2010 -0700
> > 
> >     rcu: fix RCU lockdep splat on freezer_fork path
> >     
> >     Add an RCU read-side critical section to suppress this false positive.
> >     
> >     Located-by: Eric Paris <eparis@parisplace.org>
> >     Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> 
> That one is also fixed so feel free to add a tested or something from
> me.  But we've got another, weeeee!  If there some way I could get all
> of these at once?

Sure!  I -think- that if you remove the first "if" statement in
lockdep_rcu_dereference() in kernel/lockdep.c, you will get lots of them
all at once.  Maybe more than your console log is able to hold...

So another approach would be to print only the first 100 or some such.

It -looks- to me that you could make __debug_locks_off() atomically
decrement a counter rather than just setting it to zero, see
include/linux/debug_locks.h.  I suspect that atomic_dec_not_zero()
would work very well for you here.

Peter probably knows a better approach, but those would work.

						Thanx, Paul

> [    0.045164] ===================================================
> [    0.047002] [ INFO: suspicious rcu_dereference_check() usage. ]
> [    0.048002] ---------------------------------------------------
> [    0.049012] include/linux/cgroup.h:533 invoked rcu_dereference_check() without protection!
> [    0.051087] 
> [    0.051088] other info that might help us debug this:
> [    0.051088] 
> [    0.057011] 
> [    0.057011] rcu_scheduler_active = 1, debug_locks = 0
> [    0.059046] no locks held by watchdog/0/5.
> [    0.060002] 
> [    0.060003] stack backtrace:
> [    0.061003] Pid: 5, comm: watchdog/0 Not tainted 2.6.34-rc4-next-20100415+ #104
> [    0.063011] Call Trace:
> [    0.063654]  [<ffffffff8108652f>] lockdep_rcu_dereference+0xaf/0xc0
> [    0.065009]  [<ffffffff810b53f0>] ? watchdog+0x0/0xa0
> [    0.066006]  [<ffffffff8104d01b>] __sched_setscheduler+0x3ab/0x430
> [    0.067005]  [<ffffffff810b53f0>] ? watchdog+0x0/0xa0
> [    0.068004]  [<ffffffff8104d0be>] sched_setscheduler+0xe/0x10
> [    0.070009]  [<ffffffff810b541a>] watchdog+0x2a/0xa0
> [    0.071004]  [<ffffffff810b53f0>] ? watchdog+0x0/0xa0
> [    0.072007]  [<ffffffff810714ec>] kthread+0xac/0xc0
> [    0.073005]  [<ffffffff81087ff0>] ? trace_hardirqs_on_caller+0xc0/0x240
> [    0.074006]  [<ffffffff8100bc24>] kernel_thread_helper+0x4/0x10
> [    0.075005]  [<ffffffff814fee54>] ? restore_args+0x0/0x30
> [    0.076004]  [<ffffffff81071440>] ? kthread+0x0/0xc0
> [    0.077004]  [<ffffffff8100bc20>] ? kernel_thread_helper+0x0/0x10
> 
> 
> 

  reply	other threads:[~2010-04-20  3:04 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-08  1:26 INFO: suspicious rcu_dereference_check() usage - include/linux/cgroup.h:492 invoked rcu_dereference_check() without protection! Miles Lane
2010-03-11  3:28 ` Paul E. McKenney
2010-04-12 18:44   ` Eric Paris
2010-04-12 18:47     ` Peter Zijlstra
2010-04-14 10:47       ` Peter Zijlstra
2010-04-15 15:47         ` Paul E. McKenney
2010-04-19  3:45           ` Lai Jiangshan
2010-04-19 18:26         ` Eric Paris
2010-04-19 23:01           ` Paul E. McKenney
2010-04-20  1:25             ` Eric Paris
2010-04-20  3:04               ` Paul E. McKenney [this message]
2010-04-20  7:21                 ` Peter Zijlstra
2010-04-20  8:23                 ` [PATCH] RCU: don't turn off lockdep when find suspicious rcu_dereference_check() usage Lai Jiangshan
2010-04-20  8:36                   ` Peter Zijlstra
2010-04-20 12:31                   ` Eric Paris
2010-04-20 13:28                     ` Paul E. McKenney
     [not found]                     ` <j2ya44ae5cd1004200545q6be4ec82o18ae99d93e8c29c7@mail.gmail.com>
2010-04-20 13:52                       ` Paul E. McKenney
2010-04-20 15:38                         ` Miles Lane
2010-04-21  6:04                           ` Borislav Petkov
2010-04-21 21:45                             ` Paul E. McKenney
2010-04-21 21:35                           ` Paul E. McKenney
2010-04-21 21:48                             ` Paul E. McKenney
2010-04-21 21:57                             ` Eric Dumazet
2010-04-21 22:14                               ` Paul E. McKenney
2010-04-21 23:26                                 ` Eric W. Biederman
2010-04-22 14:56                             ` Vivek Goyal
2010-04-22 16:01                               ` Paul E. McKenney
2010-04-23 12:50                                 ` Miles Lane
2010-04-23 19:42                                   ` Paul E. McKenney
2010-04-23 19:43                                     ` [PATCH v2.6.34-rc5 01/12] rcu: Fix RCU lockdep splat in set_task_cpu on fork path Paul E. McKenney
2010-04-23 19:43                                     ` [PATCH v2.6.34-rc5 02/12] rcu: fix RCU lockdep splat on freezer_fork path Paul E. McKenney
2010-04-23 19:43                                     ` [PATCH v2.6.34-rc5 03/12] rcu: leave lockdep enabled after RCU lockdep splat Paul E. McKenney
2010-04-23 19:43                                     ` [PATCH v2.6.34-rc5 04/12] NFSv4: Fix the locking in nfs_inode_reclaim_delegation() Paul E. McKenney
2010-04-23 19:43                                     ` [PATCH v2.6.34-rc5 05/12] NFS: Fix RCU issues in the NFSv4 delegation code Paul E. McKenney
2010-04-23 19:43                                     ` [PATCH v2.6.34-rc5 06/12] KEYS: Fix an RCU warning Paul E. McKenney
2010-04-23 19:43                                     ` [PATCH v2.6.34-rc5 07/12] KEYS: Fix an RCU warning in the reading of user keys Paul E. McKenney
2010-04-23 19:43                                     ` [PATCH v2.6.34-rc5 08/12] cgroup: Fix an RCU warning in cgroup_path() Paul E. McKenney
2010-04-23 19:43                                     ` [PATCH v2.6.34-rc5 09/12] cgroup: Fix an RCU warning in alloc_css_id() Paul E. McKenney
2010-04-23 19:43                                     ` [PATCH v2.6.34-rc5 10/12] sched: Fix an RCU warning in print_task() Paul E. McKenney
2010-04-23 19:43                                     ` [PATCH v2.6.34-rc5 11/12] cgroup: Check task_lock in task_subsys_state() Paul E. McKenney
2010-04-23 19:43                                     ` [PATCH v2.6.34-rc5 12/12] memcg: css_id() must be called under rcu_read_lock() Paul E. McKenney
2010-04-23 22:59                                     ` [PATCH] RCU: don't turn off lockdep when find suspicious rcu_dereference_check() usage Miles Lane
2010-04-24  5:35                                       ` Miles Lane
2010-04-25  2:36                                         ` Paul E. McKenney
2010-04-25  2:34                                       ` Paul E. McKenney
2010-04-25  7:45                                         ` Johannes Berg
2010-04-25  7:49                                           ` David Miller
2010-04-26  2:07                                             ` Paul E. McKenney
2010-04-25 15:49                                         ` Miles Lane
2010-04-25 20:20                                           ` Miles Lane
2010-04-26 16:09                                             ` Paul E. McKenney
2010-04-26 18:35                                               ` Eric W. Biederman
2010-04-27  4:27                                                 ` Paul E. McKenney
2010-04-27 16:22                                                   ` Paul E. McKenney
2010-04-27 16:33                                                     ` Eric Dumazet
2010-04-27 17:58                                                     ` Miles Lane
2010-04-27 23:31                                                       ` Paul E. McKenney
2010-04-27 23:42                                                         ` David Miller
2010-04-27 23:52                                                           ` Paul E. McKenney
     [not found]                                         ` <p2ka44ae5cd1004281358n86ce29d2tbece16b2fb974dab@mail.gmail.com>
2010-04-28 21:37                                           ` Paul E. McKenney
2010-05-01 17:26                         ` Miles Lane
2010-05-01 21:55                           ` Paul E. McKenney
2010-05-02  2:00                             ` Miles Lane
2010-05-02  4:11                               ` Paul E. McKenney
2010-04-21  1:05             ` INFO: suspicious rcu_dereference_check() usage - include/linux/cgroup.h:492 invoked rcu_dereference_check() without protection! Li Zefan
2010-04-21  3:14               ` Paul E. McKenney
2010-04-14 16:03     ` Paul E. McKenney

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=20100420030452.GB2905@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=eparis@parisplace.org \
    --cc=eparis@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miles.lane@gmail.com \
    --cc=peterz@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox