[SERVER-40908] Alter stdx::condition_variable::_runWithNotifyable to avoid allocations Created: 30/Apr/19  Updated: 08/Jan/24  Resolved: 05/Jun/19

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: 4.2.0-rc1, 4.3.1

Type: Improvement Priority: Major - P3
Reporter: Mira Carey Assignee: Mira Carey
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Backwards Compatibility: Fully Compatible
Backport Requested:
v4.2
Sprint: Service Arch 2019-06-03, Service Arch 2019-06-17
Participants:

 Description   

condition_variable::_runWithNotifyable allocates a linked list member for the notification list per invocation. It also does this under both the condvar mutex as well as the mutex for the predicate waiter.

Two things need to happen for this:

  1. notifyables need to either own a std::list<Notifyable*> or be intrusively linked listed
  2. NotInterruptible needs to not be a global (making it a thread local would do)


 Comments   
Comment by Githook User [ 05/Jun/19 ]

Author:

{'name': 'Jason Carey', 'email': 'jcarey@argv.me', 'username': 'hanumantmk'}

Message: SERVER-40908 !allocs in cv::_runWithNotifyable

condition_variable::_runWithNotifyable allocates a linked list member
for the notification list per invocation. It also does this under both
the condvar mutex as well as the mutex for the predicate waiter.

Two things need to happen for this:

  • notifyables need to own a std::list<Notifyable*>
  • NotInterruptible needs to be a thread local

(cherry picked from commit 24ebd1d1f6d7a05e80bff9b14fa6a3e2ff35cc86)
Branch: v4.2
https://github.com/mongodb/mongo/commit/c79827714943d9aaca568db3bfabefa99896d065

Comment by Githook User [ 05/Jun/19 ]

Author:

{'name': 'Jason Carey', 'email': 'jcarey@argv.me', 'username': 'hanumantmk'}

Message: SERVER-40908 !allocs in cv::_runWithNotifyable

condition_variable::_runWithNotifyable allocates a linked list member
for the notification list per invocation. It also does this under both
the condvar mutex as well as the mutex for the predicate waiter.

Two things need to happen for this:

Generated at Thu Feb 08 04:56:17 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.