RE: [PATCH 2/2] x86/MCE: Add command line option to extend MCE Records pool

Luck, Tony
2024-02-12T19:49:46Z

I said:

> spin_lock(&pool->lock);
> list_add_rcu(&chunk->next_chunk, &pool->chunks);
> spin_unlock(&pool->lock);

Avadhut said:

> gen_pool_alloc_algo_owner() iterates over the existing chunks
> within the genpool through list_for_each_entry_rcu(), within
> an RCU read-side critical section (rcu_read_lock()).

> So the concern is not about traversal, but rather that the #MC can break the
> list_add_rcu(). Is this correct?

Yazen,

Yes. The question is whether a #MC that come in the middle of list_rcu_add()
can safely do list_for_each_entry_rcu() on the same list.

RCU is black magic ... maybe it can do this? Adding Paul.

-Tony