Commit 2ce02a86 authored by Jiang Biao's avatar Jiang Biao Committed by Bjorn Helgaas

PCI: Add schedule point in pci_read_config()

The PCI sysfs "config" file allows large reads, and the resulting PCI
config reads can take several milliseconds to complete.  Testing with the
cyclictest [1] benchmark showed 5ms+ latencies.

Add a schedule point in pci_read_config() to reduce the maximum latency.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/clrkwllms/rt-tests.git/

[bhelgaas: commit log]
Link: https://lore.kernel.org/r/20200824052025.48362-1-benbjiang@tencent.comReported-by: default avatarBin Lai <robinlai@tencent.com>
Signed-off-by: default avatarJiang Biao <benbjiang@tencent.com>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
parent d24e1245
......@@ -708,6 +708,7 @@ static ssize_t pci_read_config(struct file *filp, struct kobject *kobj,
data[off - init_off + 3] = (val >> 24) & 0xff;
off += 4;
size -= 4;
cond_resched();
}
if (size >= 2) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment