Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 3648ea56 in mainline


Ignore:
Timestamp:
2012-07-30T19:20:21Z (9 years ago)
Author:
Adam Hraska <adam.hraska+hos@…>
Branches:
lfn, master
Children:
09737cc
Parents:
452e91b
Message:

rcu: Cosmetic change. Shaved off some overhead in rcu_call().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/synch/rcu.c

    r452e91b r3648ea56  
    164164static void start_reclaimers(void);
    165165static void synch_complete(rcu_item_t *rcu_item);
     166static inline void rcu_call_impl(bool expedite, rcu_item_t *rcu_item,
     167        rcu_func_t func);
    166168static void add_barrier_cb(void *arg);
    167169static void barrier_complete(rcu_item_t *barrier_item);
     
    565567void rcu_call(rcu_item_t *rcu_item, rcu_func_t func)
    566568{
    567         _rcu_call(false, rcu_item, func);
     569        rcu_call_impl(false, rcu_item, func);
    568570}
    569571
     
    571573void _rcu_call(bool expedite, rcu_item_t *rcu_item, rcu_func_t func)
    572574{
     575        rcu_call_impl(expedite, rcu_item, func);
     576}
     577
     578/** rcu_call() inline-able implementation. See rcu_call() for comments. */
     579static inline void rcu_call_impl(bool expedite, rcu_item_t *rcu_item,
     580        rcu_func_t func)
     581{
    573582        ASSERT(rcu_item);
    574583       
     
    580589        ipl_t ipl = interrupts_disable();
    581590
    582         *CPU->rcu.parriving_cbs_tail = rcu_item;
    583         CPU->rcu.parriving_cbs_tail = &rcu_item->next;
    584        
    585         size_t cnt = ++CPU->rcu.arriving_cbs_cnt;
     591        rcu_cpu_data_t *r = &CPU->rcu;
     592        *r->parriving_cbs_tail = rcu_item;
     593        r->parriving_cbs_tail = &rcu_item->next;
     594       
     595        size_t cnt = ++r->arriving_cbs_cnt;
    586596        interrupts_restore(ipl);
    587597       
    588598        if (expedite) {
    589                 CPU->rcu.expedite_arriving = true;
     599                r->expedite_arriving = true;
    590600        }
    591601       
    592602        /* Added first callback - notify the reclaimer. */
    593         if (cnt == 1 && !semaphore_count_get(&CPU->rcu.arrived_flag)) {
    594                 semaphore_up(&CPU->rcu.arrived_flag);
     603        if (cnt == 1 && !semaphore_count_get(&r->arrived_flag)) {
     604                semaphore_up(&r->arrived_flag);
    595605        }
    596606       
Note: See TracChangeset for help on using the changeset viewer.