Skip to content
  • Philippe Gerum's avatar
    drivers/ipc: bufp: fix read-write, write-write preemption cases · a3a76644
    Philippe Gerum authored and Jan Kiszka's avatar Jan Kiszka committed
    
    
    The token-based approach for detecting preemption while data is being
    moved into or out of the ring only protects from read vs read races,
    not from races involving a write side. For instance, a reader might
    read dirty data being changed by a writer concurrently, or two writers
    might compete writing two distinct messages at the same place in the
    ring space.
    
    To address this issue, use a slot-based implementation which
    atomically reserves exclusive portions of the ring space readers and
    writers will be accessing locklessly. Those slots are guaranteed to
    never overlap among read and write requests, until the lockless
    operation finishes.
    
    Signed-off-by: default avatarPhilippe Gerum <rpm@xenomai.org>
    Signed-off-by: default avatarJan Kiszka <jan.kiszka@siemens.com>
    a3a76644