All of lore.kernel.org
 help / color / mirror / Atom feed
From: Olof Johansson <olof@lixom.net>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: linuxppc-dev@ozlabs.org, paulus@samba.org, jgarzik@pobox.com
Subject: Re: [PATCH] powerpc: mpic: minor optimization of ipi handler
Date: Fri, 19 Oct 2007 18:31:34 -0500	[thread overview]
Message-ID: <20071019233134.GA17851@lixom.net> (raw)
In-Reply-To: <1192835859.17235.12.camel@pasglop>

On Sat, Oct 20, 2007 at 09:17:39AM +1000, Benjamin Herrenschmidt wrote:
> 
> On Fri, 2007-10-19 at 13:51 -0500, Olof Johansson wrote:
> > Jeff Garzik pointed out that we don't actually have to lookup the mpic
> > instance since it's passed in as the interrupt handler data for IPIs.
> 
> Note that's typically one of the annoying case where we use "irq"
> for a good reasons, getting the way of Jeff attempt at removing
> this argument.
> 
> I suppose a working approach would be to have 4 mpic IPI handlers...

We still need the _irq_, but we don't need to lookup the mpic based on it.

We knew the mpic pointer at irq setup time, and passed it in as the
argument to pass to the handler. Doing a second lookup is just extra
overhead, it should return the same controller:


void mpic_request_ipis(void)
{
        struct mpic *mpic = mpic_primary;
        int i, err;
        static char *ipi_names[] = {
                "IPI0 (call function)",
                "IPI1 (reschedule)",
                "IPI2 (unused)",
                "IPI3 (debugger break)",
        };
        BUG_ON(mpic == NULL);

        printk(KERN_INFO "mpic: requesting IPIs ... \n");

        for (i = 0; i < 4; i++) {
                unsigned int vipi = irq_create_mapping(mpic->irqhost,
                                                       mpic->ipi_vecs[0] + i);
                if (vipi == NO_IRQ) {
                        printk(KERN_ERR "Failed to map IPI %d\n", i);
                        break;
                }
                err = request_irq(vipi, mpic_ipi_action,
                                  IRQF_DISABLED|IRQF_PERCPU,
                                  ipi_names[i], mpic);
                if (err) {
                        printk(KERN_ERR "Request of irq %d for IPI %d failed\n",
                               vipi, i);
                        break;
                }
        }
}


-Olof

  reply	other threads:[~2007-10-19 23:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-19 18:51 [PATCH] powerpc: mpic: minor optimization of ipi handler Olof Johansson
2007-10-19 23:17 ` Benjamin Herrenschmidt
2007-10-19 23:31   ` Olof Johansson [this message]
2007-10-19 23:49     ` Olof Johansson
2007-10-20  1:23       ` Benjamin Herrenschmidt

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=20071019233134.GA17851@lixom.net \
    --to=olof@lixom.net \
    --cc=benh@kernel.crashing.org \
    --cc=jgarzik@pobox.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=paulus@samba.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.