created | 2023-05-07T01:09:06Z |
---|---|
begin | 2023-05-05T00:00:00Z |
end | 2023-05-06T00:00:00Z |
path | src/sys |
commits | 1 |
date | 2023-05-05T01:19:51Z | |||
---|---|---|---|---|
author | bluhm | |||
files | src/sys/kern/uipc_mbuf.c | log | diff | annotate |
src/sys/sys/mbuf.h | log | diff | annotate | |
message |
The mbuf_queue API allows read access to integer variables which another CPU may change simultaneously. To prevent miss optimisation by the compiler, they need the READ_ONCE() macro. Otherwise there could be two read operations with inconsistent values. Writing to integer in mq_set_maxlen() needs mutex protection. Otherwise the value could change within critical sections. Again the compiler could optimize to multiple read operations within the critical section. With inconsistent values, the behavior is undefined. OK dlg@ |