Bug #13968
closed
OSD:lock PG when get_pg_or_queue_for_pg method successfully return a PG
Added by xie xingguo over 8 years ago.
Updated over 8 years ago.
Description
Otherwise caller shall race with other PG users, especially with PG removal.
Also, simplify wake_pg_waiters method a little, the input parameter PG is not needed any more.
- Status changed from New to Rejected
The threads that use that method are not allowed to take the pg or osd lock (messenger ms_fast_dispatch threads). The design is intended to tolerate the race. We don't even remove the op wq entries in _remove_pg, everything checks whether then pg is deleting when items are dequeued (and the items have pg refs, so the pg structure itself won't be deleted until all queued items are gone). Reopen if I'm missing something.
Samuel Just wrote:
The threads that use that method are not allowed to take the pg or osd lock (messenger ms_fast_dispatch threads). The design is intended to tolerate the race. We don't even remove the op wq entries in _remove_pg, everything checks whether then pg is deleting when items are dequeued (and the items have pg refs, so the pg structure itself won't be deleted until all queued items are gone). Reopen if I'm missing something.
Got it. Thank you for your patient explaining.
Also available in: Atom
PDF