From: Ajay Kaher <akaher@vmware.com>
To: Bjorn Helgaas <helgaas@kernel.org>, Matthew Wilcox <willy@infradead.org>
Cc: "bhelgaas@google.com" <bhelgaas@google.com>,
"tglx@linutronix.de" <tglx@linutronix.de>,
"mingo@redhat.com" <mingo@redhat.com>,
"bp@alien8.de" <bp@alien8.de>,
"dave.hansen@linux.intel.com" <dave.hansen@linux.intel.com>,
"x86@kernel.org" <x86@kernel.org>,
"hpa@zytor.com" <hpa@zytor.com>,
"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"rostedt@goodmis.org" <rostedt@goodmis.org>,
Nadav Amit <namit@vmware.com>,
Srivatsa Bhat <srivatsab@vmware.com>,
"srivatsa@csail.mit.edu" <srivatsa@csail.mit.edu>,
Alexey Makhalov <amakhalov@vmware.com>,
Anish Swaminathan <anishs@vmware.com>,
Vasavi Sirnapalli <vsirnapalli@vmware.com>,
"er.ajay.kaher@gmail.com" <er.ajay.kaher@gmail.com>
Subject: Re: [PATCH] MMIO should have more priority then IO
Date: Fri, 8 Jul 2022 05:56:07 +0000 [thread overview]
Message-ID: <25F843ED-7EB4-4D00-96CB-7DE1AC886460@vmware.com> (raw)
In-Reply-To: <20220628180919.GA1850423@bhelgaas>
On 28/06/22, 11:39 PM, "Bjorn Helgaas" <helgaas@kernel.org> wrote:
> [+cc Matthew]
>
> On Tue, Jun 28, 2022 at 09:59:21PM +0530, Ajay Kaher wrote:
>> Port IO instructions (PIO) are less efficient than MMIO (memory
>> mapped I/O). They require twice as many PCI accesses and PIO
>> instructions are serializing. As a result, MMIO should be preferred
>> when possible over PIO.
>>
>> Bare metal test result
>> 1 million reads using raw_pci_read() took:
>> PIO: 0.433153 Sec.
>> MMIO: 0.268792 Sec.
>>
>> Virtual Machine test result
>> 1 hundred thousand reads using raw_pci_read() took:
>> PIO: 12.809 Sec.
>> MMIO: took 8.517 Sec.
>>
>> Signed-off-by: Ajay Kaher <akaher@vmware.com>
>> ---
>> arch/x86/pci/common.c | 8 ++++----
>> 1 files changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c
>> index 3507f456f..0b3383d9c 100644
>> --- a/arch/x86/pci/common.c
>> +++ b/arch/x86/pci/common.c
>> @@ -40,20 +40,20 @@ const struct pci_raw_ops *__read_mostly raw_pci_ext_ops;
>> int raw_pci_read(unsigned int domain, unsigned int bus, unsigned int devfn,
>> int reg, int len, u32 *val)
>> {
>> + if (raw_pci_ext_ops)
>> + return raw_pci_ext_ops->read(domain, bus, devfn, reg, len, val);
>> if (domain == 0 && reg < 256 && raw_pci_ops)
>> return raw_pci_ops->read(domain, bus, devfn, reg, len, val);
>> - if (raw_pci_ext_ops)
>> - return raw_pci_ext_ops->read(domain, bus, devfn, reg, len, val);
>> return -EINVAL;
>
> This organization of raw_pci_read() dates to b6ce068a1285 ("Change
> pci_raw_ops to pci_raw_read/write"), by Matthew. Cc'd him for
> comment, since I think he considered the ordering at the time.
Thanks Bjorn for quick response.
Matthew, b6ce068a1285 is old commit. It will be very helpful if you could
provide some detail on ordering as Bjorn mentioned above.
- Ajay
>> }
>>
>> int raw_pci_write(unsigned int domain, unsigned int bus, unsigned int devfn,
>> int reg, int len, u32 val)
>> {
>> + if (raw_pci_ext_ops)
>> + return raw_pci_ext_ops->write(domain, bus, devfn, reg, len, val);
>> if (domain == 0 && reg < 256 && raw_pci_ops)
>> return raw_pci_ops->write(domain, bus, devfn, reg, len, val);
>> - if (raw_pci_ext_ops)
>> - return raw_pci_ext_ops->write(domain, bus, devfn, reg, len, val);
>> return -EINVAL;
>> }
>>
>> --
>> 2.30.0
>>
next prev parent reply other threads:[~2022-07-08 5:56 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-28 16:29 Ajay Kaher
2022-06-28 18:09 ` Bjorn Helgaas
2022-07-08 5:56 ` Ajay Kaher [this message]
2022-07-08 12:56 ` Matthew Wilcox
2022-07-08 16:45 ` Nadav Amit
2022-07-08 17:55 ` Matthew Wilcox
2022-07-08 18:35 ` Nadav Amit
2022-07-08 18:43 ` Matthew Wilcox
2022-07-08 19:49 ` Nadav Amit
2022-07-11 6:31 ` Ajay Kaher
2022-07-11 17:04 ` Nadav Amit
2022-07-11 17:53 ` Ajay Kaher
2022-07-11 18:18 ` H. Peter Anvin
2022-07-11 19:43 ` Paolo Bonzini
2022-07-12 21:20 ` Shuah Khan
2022-08-31 21:44 ` Matthew Wilcox
2022-08-31 22:23 ` Shuah Khan
2022-06-29 6:12 ` Greg KH
2022-06-29 6:37 ` H. Peter Anvin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=25F843ED-7EB4-4D00-96CB-7DE1AC886460@vmware.com \
--to=akaher@vmware.com \
--cc=amakhalov@vmware.com \
--cc=anishs@vmware.com \
--cc=bhelgaas@google.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=er.ajay.kaher@gmail.com \
--cc=helgaas@kernel.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=namit@vmware.com \
--cc=rostedt@goodmis.org \
--cc=srivatsa@csail.mit.edu \
--cc=srivatsab@vmware.com \
--cc=tglx@linutronix.de \
--cc=vsirnapalli@vmware.com \
--cc=willy@infradead.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®