]> www.infradead.org Git - users/jedix/linux-maple.git/commit
um: vector: Replace locks guarding queue depth with atomics
authorAnton Ivanov <anton.ivanov@cambridgegreys.com>
Fri, 5 Jul 2024 10:53:31 +0000 (11:53 +0100)
committerRichard Weinberger <richard@nod.at>
Thu, 12 Sep 2024 17:56:05 +0000 (19:56 +0200)
commit612a8c8e0b43ba7e3d0e51f6f76a5fec4912d439
tree6adf0c626cbe8012f7bfd6c965a8807c8b9db59a
parentec24b988eb26e21f37707d090ec3ab53c51fd386
um: vector: Replace locks guarding queue depth with atomics

UML vector drivers use ring buffer structures which map
preallocated skbs onto mmsg vectors for use with sendmmsg
and recvmmsg. They are designed around a single consumer,
single producer pattern allowing simultaneous enqueue and
dequeue.

Lock debugging with preemption showed possible races when
locking the queue depth. This patch addresses this by
removing extra locks, adding barriers and making queue
depth inc/dec and access atomic.

Signed-off-by: Anton Ivanov <anton.ivanov@cambridgegreys.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
arch/um/drivers/vector_kern.c
arch/um/drivers/vector_kern.h