On Sun, 18 Mar 2018, Mark Bloch wrote: > This may lead to the following scenario if we have multiple concurrent reads > of counters, cpu 0 (tries to read counter at index 0) cpu 1 (tries to read > counter at index 1) > > CPU 0 CPU 1 > driver: stats->value[0] = x; | .... > .... | .... > .... | .... > ib_core: return stats->value[0] to user | driver: stats->value[0] = y; > > We end up with read/write to the same location at the same time. > Which can lead to providing an incorrect value to the user. This RFC introduces > a lock to protect against that. What is "incorrect"? If its just an old value then this is expected and tolerated. Writing to cachelines can only occur when you have exclusive write access. So there will be no undefined value. -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html