Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751481AbbDIETI (ORCPT ); Thu, 9 Apr 2015 00:19:08 -0400 Received: from cn.fujitsu.com ([59.151.112.132]:32301 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751070AbbDIETE (ORCPT ); Thu, 9 Apr 2015 00:19:04 -0400 X-IronPort-AV: E=Sophos;i="5.04,848,1406563200"; d="scan'208";a="90400363" Message-ID: <5525FE57.1000003@cn.fujitsu.com> Date: Thu, 9 Apr 2015 12:21:43 +0800 From: Lai Jiangshan User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Peter Zijlstra , , , , , , CC: , , , Subject: Re: [PATCH v4 1/9] module: Sanitize RCU usage and locking References: <20150408164813.810874878@infradead.org> <20150408170043.815070727@infradead.org> In-Reply-To: <20150408170043.815070727@infradead.org> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.167.226.103] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 682 Lines: 23 On 04/09/2015 12:48 AM, Peter Zijlstra wrote: > +static void module_assert_mutex_or_preempt(void) > +{ > +#ifdef CONFIG_LOCKDEP > + int rcu_held = rcu_read_lock_sched_held(); > + int mutex_held = 1; > + > + if (debug_locks) > + mutex_held = lockdep_is_held(&module_mutex); > + > + WARN_ON(!rcu_held && !mutex_held); > +#endif > +} Is rcu_lockdep_assert() suitable for it? (note rcu_lockdep_assert() only works when CONFIG_PROVE_RCU) -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/