[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1378488088.31445.39.camel@edumazet-glaptop>
Date:	Fri, 06 Sep 2013 10:21:28 -0700
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	paulmck@...ux.vnet.ibm.com
Cc:	Frederic Weisbecker <fweisbec@...il.com>,
	linux-kernel@...r.kernel.org, mingo@...e.hu, laijs@...fujitsu.com,
	dipankar@...ibm.com, akpm@...ux-foundation.org,
	mathieu.desnoyers@...icios.com, josh@...htriplett.org,
	niv@...ibm.com, tglx@...utronix.de, peterz@...radead.org,
	rostedt@...dmis.org, dhowells@...hat.com, edumazet@...gle.com,
	darren@...art.com, sbw@....edu
Subject: Re: [PATCH] rcu: Is it safe to enter an RCU read-side critical
 section?
On Fri, 2013-09-06 at 08:18 -0700, Paul E. McKenney wrote:
> int rcu_is_cpu_idle(void)
> {
> 	int ret;
> 
> 	preempt_disable();
> 	ret = (atomic_read(&__get_cpu_var(rcu_dynticks).dynticks) & 0x1) == 0;
> 	preempt_enable();
> 	return ret;
> }
Paul I find this very confusing.
If caller doesn't have preemption disabled, what could be the meaning of
this rcu_is_cpu_idle() call ?
Its result is meaningless if suddenly thread is preempted, so what is
the point ?
Sorry if this is obvious to you.
--
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
 
