On 8/20/20 11:03 AM, Ming Lei wrote:
We can't run allocating driver tag and updating tags->rqs[tag] atomically, so stale request may be retrieved from tags->rqs[tag]. More seriously, the stale request may have been freed via updating nr_requests or switching elevator or other use cases. It is one long-term issue, and Jianchao previous worked towards using static_rqs[] for iterating request, one problem is that it can be hard to use when iterating over tagset. This patchset takes another different approach for fixing the issue: cache freed rqs pages and release them until all tags->rqs[] references on these pages are gone.
Hi Ming, Is this the only possible solution? Would it e.g. be possible to protect the code that iterates over all tags with rcu_read_lock() / rcu_read_unlock() and to free pages that contain request pointers only after an RCU grace period has expired? Would that perhaps result in a simpler solution? Thanks, Bart.