Re: [RFC PATCH v5 1/3] printk-rb: new printk ringbuffer implementation (writer)

From: John Ogness
Date: Mon Dec 09 2019 - 04:01:18 EST


On 2019-12-09, Sergey Senozhatsky <sergey.senozhatsky.work@xxxxxxxxx> wrote:
>> +#define _DATA_SIZE(sz_bits) (1UL << (sz_bits))
>> +#define _DESCS_COUNT(ct_bits) (1U << (ct_bits))
>> +#define DESC_SV_BITS (sizeof(int) * 8)
>> +#define DESC_COMMITTED_MASK (1U << (DESC_SV_BITS - 1))
>
> What does SV state for? State Value?

Yes. Originally this thing was just called the state. But it was a bit
confusing in the code because there is also an enum desc_state (used for
state queries), which is _not_ the value that is stored in the state
variable. That's why the code is using state_var/state_val (SV) for the
actual data values, keeping it separate from desc_state/d_state for the
the state queries.

John Ogness