public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@redhat.com>
To: Jesse Barnes <jbarnes@virtuousgeek.org>,
	linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org,
	linux-rt-users@vger.kernel.org
Subject: Re: [PATCH][PCI]: Introduce pci_find_capability_cached and make MSI use it
Date: Thu, 15 May 2008 14:02:56 -0300	[thread overview]
Message-ID: <20080515170256.GE14846@ghostprotocols.net> (raw)
In-Reply-To: <20080515160426.GD14846@ghostprotocols.net>

Em Thu, May 15, 2008 at 01:04:26PM -0300, Arnaldo Carvalho de Melo escreveu:
> Hi,
> 
> 	While using the preemptirqsoff ftrace tracer I noticed that
> everytime handle_edge_irq is called it needs to mask and unmask MSI, and
> that leads to a series of very expensive calls to pci_find_capability,
> as can be seen here, with preemption disabled:
> 
>           <idle>-0     [03]   422.558652: unmask_msi_irq <-handle_edge_irq
>           <idle>-0     [03]   422.558653: msi_set_mask_bits <-unmask_msi_irq
>           <idle>-0     [03]   422.558653: msi_set_enable <-msi_set_mask_bits
>           <idle>-0     [03]   422.558654: pci_find_capability <-msi_set_enable
>           <idle>-0     [03]   422.558655: __pci_bus_find_cap_start <-pci_find_capability
>           <idle>-0     [03]   422.558655: pci_bus_read_config_word <-__pci_bus_find_cap_start
>           <idle>-0     [03]   422.558656: _spin_lock_irqsave <-pci_bus_read_config_word
>           <idle>-0     [03]   422.558656: add_preempt_count <-_spin_lock_irqsave
>           <idle>-0     [03]   422.558657: pci_read <-pci_bus_read_config_word
>           <idle>-0     [03]   422.558657: raw_pci_read <-pci_read
>           <idle>-0     [03]   422.558658: pci_conf1_read <-raw_pci_read
>           <idle>-0     [03]   422.558658: _spin_lock_irqsave <-pci_conf1_read
>           <idle>-0     [03]   422.558659: add_preempt_count <-_spin_lock_irqsave
> 
> 	  BZZT! 37us
> 
>           <idle>-0     [03]   422.558696: _spin_unlock_irqrestore <-pci_conf1_read
>           <idle>-0     [03]   422.558697: sub_preempt_count <-_spin_unlock_irqrestore
>           <idle>-0     [03]   422.558697: preempt_schedule <-_spin_unlock_irqrestore
>           <idle>-0     [03]   422.558698: _spin_unlock_irqrestore <-pci_bus_read_config_word
>           <idle>-0     [03]   422.558698: sub_preempt_count <-_spin_unlock_irqrestore
>           <idle>-0     [03]   422.558699: preempt_schedule <-_spin_unlock_irqrestore
>           <idle>-0     [03]   422.558699: __pci_find_next_cap <-pci_find_capability
>           <idle>-0     [03]   422.558700: __pci_find_next_cap_ttl <-__pci_find_next_cap
>           <idle>-0     [03]   422.558700: pci_bus_read_config_byte <-__pci_find_next_cap_ttl
>           <idle>-0     [03]   422.558701: _spin_lock_irqsave <-pci_bus_read_config_byte
>           <idle>-0     [03]   422.558701: add_preempt_count <-_spin_lock_irqsave
>           <idle>-0     [03]   422.558702: pci_read <-pci_bus_read_config_byte
>           <idle>-0     [03]   422.558702: raw_pci_read <-pci_read
>           <idle>-0     [03]   422.558703: pci_conf1_read <-raw_pci_read
>           <idle>-0     [03]   422.558703: _spin_lock_irqsave <-pci_conf1_read
>           <idle>-0     [03]   422.558704: add_preempt_count <-_spin_lock_irqsave
> 
> 	  BZZT! 38us
> 
>           <idle>-0     [03]   422.558742: _spin_unlock_irqrestore <-pci_conf1_read
>           <idle>-0     [03]   422.558743: sub_preempt_count <-_spin_unlock_irqrestore
>           <idle>-0     [03]   422.558743: preempt_schedule <-_spin_unlock_irqrestore
>           <idle>-0     [03]   422.558744: _spin_unlock_irqrestore <-pci_bus_read_config_byte
>           <idle>-0     [03]   422.558744: sub_preempt_count <-_spin_unlock_irqrestore
>           <idle>-0     [03]   422.558745: preempt_schedule <-_spin_unlock_irqrestore
>           <idle>-0     [03]   422.558745: pci_bus_read_config_byte <-__pci_find_next_cap_ttl
>           <idle>-0     [03]   422.558746: _spin_lock_irqsave <-pci_bus_read_config_byte
>           <idle>-0     [03]   422.558746: add_preempt_count <-_spin_lock_irqsave
>           <idle>-0     [03]   422.558747: pci_read <-pci_bus_read_config_byte
>           <idle>-0     [03]   422.558747: raw_pci_read <-pci_read
>           <idle>-0     [03]   422.558748: pci_conf1_read <-raw_pci_read
>           <idle>-0     [03]   422.558748: _spin_lock_irqsave <-pci_conf1_read
>           <idle>-0     [03]   422.558749: add_preempt_count <-_spin_lock_irqsave
> 
> 	  BZZT! 39us
> 
>           <idle>-0     [03]   422.558788: _spin_unlock_irqrestore <-pci_conf1_read
>           <idle>-0     [03]   422.558789: sub_preempt_count <-_spin_unlock_irqrestore
>           <idle>-0     [03]   422.558789: preempt_schedule <-_spin_unlock_irqrestore
>           <idle>-0     [03]   422.558790: _spin_unlock_irqrestore <-pci_bus_read_config_byte
>           <idle>-0     [03]   422.558790: sub_preempt_count <-_spin_unlock_irqrestore
>           <idle>-0     [03]   422.558791: preempt_schedule <-_spin_unlock_irqrestore
>           <idle>-0     [03]   422.558791: pci_bus_read_config_byte <-__pci_find_next_cap_ttl
>           <idle>-0     [03]   422.558792: _spin_lock_irqsave <-pci_bus_read_config_byte
>           <idle>-0     [03]   422.558792: add_preempt_count <-_spin_lock_irqsave
>           <idle>-0     [03]   422.558793: pci_read <-pci_bus_read_config_byte
>           <idle>-0     [03]   422.558793: raw_pci_read <-pci_read
>           <idle>-0     [03]   422.558794: pci_conf1_read <-raw_pci_read
>           <idle>-0     [03]   422.558794: _spin_lock_irqsave <-pci_conf1_read
>           <idle>-0     [03]   422.558795: add_preempt_count <-_spin_lock_irqsave
> 
> 	  BZZT! 39us
> 
>           <idle>-0     [03]   422.558834: _spin_unlock_irqrestore <-pci_conf1_read
>           <idle>-0     [03]   422.558834: sub_preempt_count <-_spin_unlock_irqrestore
> 
> 	  <SNIP many more such BZZT!s>
> 
> 	So I implemented pci_find_capability_cached and made MSI use it
> for good measure, please consider applying.
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> diff --git a/Makefile b/Makefile
> index 14f34b4..d79fdac 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1,7 +1,7 @@
>  VERSION = 2
>  PATCHLEVEL = 6
>  SUBLEVEL = 25
> -EXTRAVERSION =
> +EXTRAVERSION = .pci_cached
>  NAME = Funky Weasel is Jiggy wit it
>  
>  # *DOCUMENTATION*

Ouch, left this in, do you want another patch or can you just remove
this bit?

Thanks,

- Arnaldo

  reply	other threads:[~2008-05-15 17:03 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-15 16:04 [PATCH][PCI]: Introduce pci_find_capability_cached and make MSI use it Arnaldo Carvalho de Melo
2008-05-15 17:02 ` Arnaldo Carvalho de Melo [this message]
2008-05-15 17:04 ` Matthew Wilcox
2008-05-15 17:10   ` Arnaldo Carvalho de Melo
2008-05-16 17:44     ` Jesse Barnes
2008-05-16 18:33       ` Arnaldo Carvalho de Melo
2008-05-16 19:01         ` Jesse Barnes
2008-05-16 19:10           ` Arnaldo Carvalho de Melo
2008-05-19  4:48       ` [PATCH] msi: skip calling pci_find_capability from msi_set_mask_bits Hidetoshi Seto
2008-05-19 20:11         ` Jesse Barnes
2008-05-19 20:26           ` Arnaldo Carvalho de Melo
2008-05-20 19:56           ` Arnaldo Carvalho de Melo
2008-05-20 20:06             ` Jesse Barnes

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=20080515170256.GE14846@ghostprotocols.net \
    --to=acme@redhat.com \
    --cc=jbarnes@virtuousgeek.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-rt-users@vger.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