From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752965AbdCATsj (ORCPT ); Wed, 1 Mar 2017 14:48:39 -0500 Received: from mail-yw0-f175.google.com ([209.85.161.175]:33226 "EHLO mail-yw0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750778AbdCATsg (ORCPT ); Wed, 1 Mar 2017 14:48:36 -0500 Date: Wed, 1 Mar 2017 12:44:52 -0500 From: Tejun Heo To: Mike Galbraith Cc: LKML Subject: Re: [cgroups] suspicious rcu_dereference_check() usage! Message-ID: <20170301174452.GE3662@htj.duckdns.org> References: <1487585723.8499.5.camel@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1487585723.8499.5.camel@gmx.de> User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, Mike. Sorry about the delay. Was on vacation and then had a strep throat. On Mon, Feb 20, 2017 at 11:15:23AM +0100, Mike Galbraith wrote: > Running LTP on master.today (v4.10) with a seriously bloated PREEMPT > config inspired box to emit the below. > > [ 7160.458996] =============================== > [ 7160.463195] [ INFO: suspicious RCU usage. ] > [ 7160.467387] 4.10.0-default #100 Tainted: G E > [ 7160.472808] ------------------------------- > [ 7160.476999] ./include/linux/cgroup.h:435 suspicious rcu_dereference_check() usage! > [ 7160.484576] > [ 7160.484576] other info that might help us debug this: > [ 7160.484576] > [ 7160.492577] > [ 7160.492577] rcu_scheduler_active = 2, debug_locks = 1 > [ 7160.499113] 1 lock held by pids_task1/19308: > [ 7160.503390] #0: (&cgroup_threadgroup_rwsem){+++++.}, at: [] _do_fork+0xf0/0x710 > [ 7160.512450] > [ 7160.512450] stack backtrace: > [ 7160.516810] CPU: 5 PID: 19308 Comm: pids_task1 Tainted: G E 4.10.0-default #100 > [ 7160.525239] Hardware name: IBM System x3550 M3 -[7944K3G]-/69Y5698 , BIOS -[D6E150AUS-1.10]- 12/15/2010 > [ 7160.534965] Call Trace: > [ 7160.537414] dump_stack+0x85/0xc9 > [ 7160.540732] lockdep_rcu_suspicious+0xd5/0x110 > [ 7160.545177] task_css.constprop.7+0x88/0x90 > [ 7160.549357] pids_can_fork+0x132/0x160 > [ 7160.553106] cgroup_can_fork+0x63/0xc0 That gotta be a spurious one coming from the incorrect !CONFIG_PROVE_RCU definition of the task_css_set_check() macro. Something like the following should fix it. If you still have the .config around, can you please attach it? I'll verify the fix and send out the fix. Thanks. diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index f6b43fb..870ea9a 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h @@ -396,7 +396,7 @@ extern spinlock_t css_set_lock; ((task)->flags & PF_EXITING) || (__c)) #else #define task_css_set_check(task, __c) \ - rcu_dereference((task)->cgroups) + rcu_dereference_check((task)->cgroups, (__c)) #endif /**