[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5525FE57.1000003@cn.fujitsu.com>
Date: Thu, 9 Apr 2015 12:21:43 +0800
From: Lai Jiangshan <laijs@...fujitsu.com>
To: Peter Zijlstra <peterz@...radead.org>, <mingo@...nel.org>,
<rusty@...tcorp.com.au>, <mathieu.desnoyers@...icios.com>,
<oleg@...hat.com>, <paulmck@...ux.vnet.ibm.com>,
<torvalds@...ux-foundation.org>
CC: <linux-kernel@...r.kernel.org>, <andi@...stfloor.org>,
<rostedt@...dmis.org>, <tglx@...utronix.de>
Subject: Re: [PATCH v4 1/9] module: Sanitize RCU usage and locking
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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists