/* * Restriction: only 63 iqdio subchannels would have its own indicator, * after that, subsequent subchannels share one indicator
*/ #define TIQDIO_NR_NONSHARED_IND 63 #define TIQDIO_NR_INDICATORS (TIQDIO_NR_NONSHARED_IND + 1) #define TIQDIO_SHARED_IND 63
/* device state change indicators */ struct indicator_t {
u32 ind; /* u32 because of compare-and-swap performance */
atomic_t count; /* use count, 0 or 1 for non-shared indicators */
};
/* list of thin interrupt input queues */ static LIST_HEAD(tiq_list); static DEFINE_MUTEX(tiq_list_lock);
staticstruct indicator_t *q_indicators;
u64 last_ai_time;
/* returns addr for the device state change indicator */ static u32 *get_indicator(void)
{ int i;
for (i = 0; i < TIQDIO_NR_NONSHARED_IND; i++) if (!atomic_cmpxchg(&q_indicators[i].count, 0, 1)) return &q_indicators[i].ind;
/* use the shared indicator */
atomic_inc(&q_indicators[TIQDIO_SHARED_IND].count); return &q_indicators[TIQDIO_SHARED_IND].ind;
}
/* protect tiq_list entries, only changed in activate or shutdown */
rcu_read_lock();
list_for_each_entry_rcu(irq, &tiq_list, entry) { /* only process queues from changed sets */ if (unlikely(references_shared_dsci(irq))) { if (!si_used) continue;
} else { if (!*irq->dsci) continue;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.