Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752646AbdDHRAf (ORCPT ); Sat, 8 Apr 2017 13:00:35 -0400 Received: from twosheds.infradead.org ([90.155.92.209]:39722 "EHLO twosheds.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751955AbdDHRAb (ORCPT ); Sat, 8 Apr 2017 13:00:31 -0400 Message-ID: <1491670819.6021.33.camel@infradead.org> Subject: Re: `pci_apply_final_quirks()` taking half a second From: David Woodhouse To: Bjorn Helgaas , Paul Menzel Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20170408154128.GA16832@bhelgaas-glaptop.roam.corp.google.com> References: <44cada166e42007d27b4c3e3aa0744d7@molgen.mpg.de> <20170408154128.GA16832@bhelgaas-glaptop.roam.corp.google.com> Content-Type: multipart/signed; micalg="sha-256"; protocol="application/x-pkcs7-signature"; boundary="=-knaHAfF8CetqNoOswCxh" Date: Sat, 08 Apr 2017 19:00:19 +0200 Mime-Version: 1.0 X-Mailer: Evolution 3.18.5.2-0ubuntu3.1 X-SRS-Rewrite: SMTP reverse-path rewritten from by twosheds.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 7956 Lines: 123 --=-knaHAfF8CetqNoOswCxh Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, 2017-04-08 at 10:41 -0500, Bjorn Helgaas wrote: >=20 > > Measuring where time is spent during boot with `systemd-bootchart` > > on an Asus A780FullHD, it turns out that half a second is spent in > > `pci_apply_final_quirks()`. >=20 > I agree, that seems like a crazy amount of time. >=20 > Can you figure out how to turn on pr_debug() (via the dynamic debug > mess or whatever) and boot with "initcall_debug"?=C2=A0 That should tell = us > how long each quirk took. It could well be spending a fair amount of time just attempting to match each device against the list. When I first implemented the table- based quirks, back in the mists of time, there were relatively few.=C2=A0 Now I wonder if it's worth sorting the list by vendor ID or something, at least for the common case of the quirks which match on vendor/device. I note it's also reading PCI_CACHE_LINE_SIZE From config space for each device in pci_apply_final_quirks(). How long does that take? --=-knaHAfF8CetqNoOswCxh Content-Type: application/x-pkcs7-signature; name="smime.p7s" Content-Disposition: attachment; filename="smime.p7s" Content-Transfer-Encoding: base64 MIAGCSqGSIb3DQEHAqCAMIACAQExDzANBglghkgBZQMEAgEFADCABgkqhkiG9w0BBwEAAKCCDzUw ggSvMIIDl6ADAgECAhEA4CPLFRKDU4mtYW56VGdrITANBgkqhkiG9w0BAQsFADBvMQswCQYDVQQG EwJTRTEUMBIGA1UEChMLQWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFkZFRydXN0IEV4dGVybmFsIFRU UCBOZXR3b3JrMSIwIAYDVQQDExlBZGRUcnVzdCBFeHRlcm5hbCBDQSBSb290MB4XDTE0MTIyMjAw MDAwMFoXDTIwMDUzMDEwNDgzOFowgZsxCzAJBgNVBAYTAkdCMRswGQYDVQQIExJHcmVhdGVyIE1h bmNoZXN0ZXIxEDAOBgNVBAcTB1NhbGZvcmQxGjAYBgNVBAoTEUNPTU9ETyBDQSBMaW1pdGVkMUEw PwYDVQQDEzhDT01PRE8gU0hBLTI1NiBDbGllbnQgQXV0aGVudGljYXRpb24gYW5kIFNlY3VyZSBF bWFpbCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAImxDdp6UxlOcFIdvFamBia3 uEngludRq/HwWhNJFaO0jBtgvHpRQqd5jKQi3xdhTpHVdiMKFNNKAn+2HQmAbqUEPdm6uxb+oYep LkNSQxZ8rzJQyKZPWukI2M+TJZx7iOgwZOak+FaA/SokFDMXmaxE5WmLo0YGS8Iz1OlAnwawsayT QLm1CJM6nCpToxDbPSBhPFUDjtlOdiUCISn6o3xxdk/u4V+B6ftUgNvDezVSt4TeIj0sMC0xf1m9 UjewM2ktQ+v61qXxl3dnUYzZ7ifrvKUHOHaMpKk4/9+M9QOsSb7K93OZOg8y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