mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
blk-mq: document the need to have STARTED and COMPLETED share a byte
For memory ordering guarantees on stores, we need to ensure that these two bits share the same byte of storage in the unsigned long. Add a comment as to why, and a BUILD_BUG_ON() to ensure that we don't violate this requirement. Suggested-by: Boqun Feng <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
parent
a7af0af321
commit
fc13457f74
2 changed files with 13 additions and 0 deletions
|
|
@ -122,8 +122,15 @@ void blk_account_io_done(struct request *req);
|
|||
* Internal atomic flags for request handling
|
||||
*/
|
||||
enum rq_atomic_flags {
|
||||
/*
|
||||
* Keep these two bits first - not because we depend on the
|
||||
* value of them, but we do depend on them being in the same
|
||||
* byte of storage to ensure ordering on writes. Keeping them
|
||||
* first will achieve that nicely.
|
||||
*/
|
||||
REQ_ATOM_COMPLETE = 0,
|
||||
REQ_ATOM_STARTED,
|
||||
|
||||
REQ_ATOM_POLL_SLEPT,
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue