Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit f530744

Browse files
committed
pci: document potential contention on PCI bus lock
We have a single lock for all devices on the PCI bus that serializes reads and writes on the devices' PCI configuration space and BARs. This should not be a problem at the moment. It should be out of any hot path and only up until we are setting up devices. However, add a comment that mentions the existence of the contention so that we keep it in mind for the futuer (and maybe perform some profiling). Signed-off-by: Babis Chalios <bchalios@amazon.es>
1 parent af93661 commit f530744

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

‎src/pci/src/bus.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,9 @@ impl PciConfigIo {
161161
return 0xffff_ffff;
162162
}
163163

164+
// NOTE: Potential contention among vCPU threads on this lock. This should not
165+
// be a problem currently, since we mainly access this when we are setting up devices.
166+
// We might want to do some profiling to ensure this does not become a bottleneck.
164167
self.pci_bus
165168
.as_ref()
166169
.lock()
@@ -195,6 +198,9 @@ impl PciConfigIo {
195198
return None;
196199
}
197200

201+
// NOTE: Potential contention among vCPU threads on this lock. This should not
202+
// be a problem currently, since we mainly access this when we are setting up devices.
203+
// We might want to do some profiling to ensure this does not become a bottleneck.
198204
let pci_bus = self.pci_bus.as_ref().lock().unwrap();
199205
if let Some(d) = pci_bus.devices.get(&(device as u32)) {
200206
let mut device = d.lock().unwrap();

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /