Hello, Manfred,Let's assume that
I am still digging through these, and things look quite good in general,
but I have a question on your second patch.
Given the following sequence of events:batch.next_pending = 1.
1. CPU 0 executes the
rcu_ctrlblk.batch.next_pending = 1;
at the beginning of rcu_start_batch().RCU_batch(1) is now 6.
2. CPU 1 executes the read_seqcount code sequence in
rcu_process_callbacks(), setting RCU_batch(cpu) to
the next batch number, and setting next_pending to 1.
3. CPU 0 executes the remainder of rcu_start_batch(),batch.cur = 6.
setting rcu_ctrlblk.batch.next_pending to 0 and
incrementing rcu_ctrlblk.batch.cur.
4. CPU 1's state is now as if the grace period had alreadyAFAICS: No. RCU_batch(1) is 6 and rcu_ctrlblk.batch.completed is still 5. The test for grace period completed is
completed for the callbacks that were just moved to
RCU_curlist(), which would be very bad.
if (!list_empty(&RCU_curlist(cpu)) &&
!rcu_batch_before(rcu_ctrlblk.batch.completed,RCU_batch(cpu))) {
__list_splice(&RCU_curlist(cpu), &list);
INIT_LIST_HEAD(&RCU_curlist(cpu));
}