lkml.org 
[lkml]   [2011]   [Feb]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH RFC tip/core/rcu 05/11] rcu: add comment saying why DEBUG_OBJECTS_RCU_HEAD depends on PREEMPT.
* Steven Rostedt (rostedt@goodmis.org) wrote:
> On Wed, 2011-02-23 at 08:59 -0500, Mathieu Desnoyers wrote:
>
> > #ifdef CONFIG_PREEMPT
> > /*
> > * Ensure that queued callbacks are all executed.
> > * If we detect that we are nested in a RCU read-side
> > * critical
> > * section, we should simply fail, otherwise we would
> > * deadlock.
> > */
> > if (rcu_preempt_depth() != 0 || preempt_count() != 0 ||
> > irqs_disabled()) {
> > WARN_ON(1);
> > return 0;
> > }
> > rcu_barrier();
> > rcu_barrier_sched();
> > rcu_barrier_bh();
> > debug_object_init(head, &rcuhead_debug_descr);
> > return 1;
> > #else
> > return 0;
> > #endif
> >
> > instead, no ?
>
> BTW, if you do end up doing such a thing...
>
> #ifndef CONFIG_PREEMPT
> return 0;
> #endif
>
> before all that would be much cleaner.
>
> Just make sure any non defined in PREEMPT macros/functions are defined
> as nops in !CONFIG_PREEMPT

Good point, thanks !

Mathieu

>
> -- Steve
>
>

--
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com


\
 
 \ /
  Last update: 2011-02-23 16:05    [W:0.110 / U:19.040 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site