From: Mathias Nyman <mathias.nyman@linux.intel.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: linux-usb@vger.kernel.org, stern@rowland.harvard.edu,
"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
ACPI Devel Maling List <linux-acpi@vger.kernel.org>
Subject: Re: [RFC PATCH] usb: optimize acpi companion search for usb port devices
Date: Thu, 25 May 2017 18:24:22 +0300 [thread overview]
Message-ID: <5926F726.4070302@linux.intel.com> (raw)
In-Reply-To: <20170524144414.GA13730@kroah.com>
On 24.05.2017 17:44, Greg KH wrote:
> On Wed, May 24, 2017 at 04:11:12PM +0300, Mathias Nyman wrote:
>> This optimization significantly reduces xhci driver load time.
>>
>> In ACPI tables the acpi companion port devices are children of
>> the hub device. The port devices are identified by their port number
>> returned by the ACPI _ADR method.
>> _ADR 0 is reserved for the root hub device.
>>
>> The current implementation to find a acpi companion port device
>> loops through all acpi port devices under that parent hub, calling
>> their _ADR method each time a new port device is added.
>>
>> for a xHC controller with 25 ports under its roothub it
>> will end up invoking ACPI bytecode 625 times before all ports
>> are ready, making it really slow.
>>
>> The _ADR values are already read and cached earler. So instead of
>> running the bytecode again we can check the cached _ADR value first,
>> and then fall back to the old way.
>>
>> As one of the more significant changes, the xhci load time on
>> Intel kabylake reduced by 70%, (28ms) from
>> initcall xhci_pci_init+0x0/0x49 returned 0 after 39537 usecs
>> to
>> initcall xhci_pci_init+0x0/0x49 returned 0 after 11270 usecs
>>
>> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
>> ---
>> drivers/usb/core/usb-acpi.c | 26 +++++++++++++++++++++++---
>> 1 file changed, 23 insertions(+), 3 deletions(-)
>
> Why is this RFC? What's wrong with it as-is?
>
Last minute doubt, nothing should be wrong, but I started to wonder if there is
any particular reason the ACPI part was done the way it was.
Or if maybe other drivers could benefit from checking cached _ADR value first as
well, and this whole thing should be a part of drivers/acpi/glue.c instead?
(adding acpi mailing list, not just Rafael)
Thanks
-Mathias
next parent reply other threads:[~2017-05-25 15:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1495631472-3828-1-git-send-email-mathias.nyman@linux.intel.com>
[not found] ` <20170524144414.GA13730@kroah.com>
2017-05-25 15:24 ` Mathias Nyman [this message]
2017-05-31 23:01 ` [RFC PATCH] usb: optimize acpi companion search for usb port devices Rafael J. Wysocki
2017-06-02 12:20 ` Mathias Nyman
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=5926F726.4070302@linux.intel.com \
--to=mathias.nyman@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=rafael.j.wysocki@intel.com \
--cc=stern@rowland.harvard.edu \
/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;
as well as URLs for NNTP newsgroup(s).