On 12/01/2015 13:01, Pavel Dovgalyuk wrote: > - bh->next = ctx->first_bh; > - /* Make sure that the members are ready before putting bh into list */ > - smp_wmb(); > - ctx->first_bh = bh; > + if (replay_mode != REPLAY_MODE_NONE) { > + /* Slower way, but this is a queue and not a stack. > + Replay will process the BH in the same order they > + came into the queue. */ > + last = &ctx->first_bh; > + while (*last) { > + last = &(*last)->next; > + } > + smp_wmb(); > + *last = bh; > + } else { > + bh->next = ctx->first_bh; > + /* Make sure that the members are ready before putting bh into list > */ > + smp_wmb(); > + ctx->first_bh = bh; > + }
I am not sure I understand the reason for this, but feel free to change the list to a QSIMPLEQ, and introduce QSIMPLEQ_INSERT_TAIL_RCU that has the appropriate barriers. Paolo