Re: [PATCH] PCI: Speed up device init by parsing capabilities all at once

From: Bjorn Helgaas
Date: Fri Jan 21 2022 - 14:42:44 EST


On Fri, Jan 21, 2022 at 05:26:35PM +0000, Vikash Bansal wrote:
> On 20/01/22, 11:56 AM, "Greg KH" <gregkh@xxxxxxxxxxxxxxxxxxx> wrote:
>
> Run pahole for pci_dev structure, it is not adding any padding bytes.
> Please refer to my previous email for replies to Greg's other comments.

Please don't indent your entire response. The original posting
apparently didn't go to linux-pci@xxxxxxxxxxxxxxx or was rejected,
maybe because it wasn't plain text (see
http://vger.kernel.org/majordomo-info.html)?

It doesn't appear in the thread at
https://lore.kernel.org/all/7E2C2648-76CE-4987-AB4F-7B4576F10D7B@xxxxxxxxxx/

> >On Tue, Jan 18, 2022 at 09:16:01AM -0800, Vikash Bansal wrote:
> >> In the current implementation, the PCI capability list is parsed from
> >> the beginning to find each capability, which results in a large number
> >> of redundant PCI reads.
> >>
> >> Instead, we can parse the complete list just once, store it in the
> >> pci_dev structure, and get the offset of each capability directly from
> >> the pci_dev structure.

> ...