Lib ring buffer: use TLS for nesting count
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sat, 16 Jul 2011 17:06:06 +0000 (13:06 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sat, 16 Jul 2011 17:06:06 +0000 (13:06 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
libringbuffer/frontend_api.h

index 93b28e43e6e42457b0ee72538ab5ec1392322bf4..ebe5db493f71f220d1d05f9117a9f53bbcf036b6 100644 (file)
@@ -40,12 +40,12 @@ int lib_ring_buffer_get_cpu(const struct lib_ring_buffer_config *config)
 
        rcu_read_lock_sched_notrace();
        cpu = smp_processor_id();
-       nesting = ++per_cpu(lib_ring_buffer_nesting, cpu);
+       nesting = ++lib_ring_buffer_nesting;    /* TLS */
        barrier();
 
        if (unlikely(nesting > 4)) {
                WARN_ON_ONCE(1);
-               per_cpu(lib_ring_buffer_nesting, cpu)--;
+               lib_ring_buffer_nesting--;      /* TLS */
                rcu_read_unlock_sched_notrace();
                return -EPERM;
        } else
@@ -59,7 +59,7 @@ static inline
 void lib_ring_buffer_put_cpu(const struct lib_ring_buffer_config *config)
 {
        barrier();
-       __get_cpu_var(lib_ring_buffer_nesting)--;
+       lib_ring_buffer_nesting--;              /* TLS */
        rcu_read_unlock_sched_notrace();
 }
 
This page took 0.024103 seconds and 4 git commands to generate.