Re: [PATCH v2] n_tty: Fix unordered accesses to lockless read buffer

From: Peter Hurley
Date: Fri Jan 16 2015 - 10:55:27 EST


On 01/12/2015 08:47 PM, Peter Hurley wrote:
> Add commit_head buffer index, which the producer-side publishes
> after input processing in non-canon mode. This ensures the consumer-side
> observes correctly-ordered writes in non-canonical mode (ie., the buffer
> data is written before the buffer index is advanced). Fix consumer-side
> uses of read_cnt() to use commit_head instead.
>
> Add required memory barriers to the tail index to guarantee
> the consumer-side has completed the loads before the producer-side
> begins writing new data. Open-code the producer-side receive_room()
> into the i/o loop.

Hi Greg,

Please don't apply this. I've been testing a v3 series that I should be
able to get to you today.

Regards,
Peter Hurley

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/