Netdev List
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: Ramkrishna.Vepa@neterion.com
Cc: Sreenivasa.Honnur@neterion.com, netdev@vger.kernel.org
Subject: Re: [net-next-2.6 PATCH 8/9] vxge: Acquire correct lock based on interrupt context.
Date: Mon, 05 Oct 2009 21:18:52 -0700 (PDT)	[thread overview]
Message-ID: <20091005.211852.12665189.davem@davemloft.net> (raw)
In-Reply-To: <78C9135A3D2ECE4B8162EBDCE82CAD7705C16322@nekter>

From: "Ramkrishna Vepa" <Ramkrishna.Vepa@neterion.com>
Date: Mon, 5 Oct 2009 22:36:22 -0400

>> > - Added macros that check if the thread is in interrupt context or
> not
>> to
>> >   acquire or release locks
>> >
>> > Signed-off-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
>> 
>> There is nothing at all wrong with using irqsave/irqrestore spin lock
>> calls when you're already in an interrupt.
>> 
>> I don't see any reason for this change.
> [Ram] Right, but why have the additional step of saving and restoring
> the flags while in the interrupt context?

Do you know that in the interrupt handler, cpu interrupts are
actually enabled?

And the cost is (relatively speaking) next to nothing.  You're
in the process of taking cache misses and toucing PIO registers
(on the order of thousands of cycles).

Not doing a IRQ save/restore is going to save you a hand full
of cycles.

The new branch mispredict you might get there is probably more
expensive or of equal expense to the IRQ save/restore itself.

This change makes really no sense, NO OTHER DRIVER does crap
like this.  Because there is no reason to.

  parent reply	other threads:[~2009-10-06  4:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-05 11:58 [net-next-2.6 PATCH 8/9] vxge: Acquire correct lock based on interrupt context Sreenivasa Honnur
2009-10-05 12:37 ` David Miller
2009-10-06  2:36   ` Ramkrishna Vepa
2009-10-06  3:19     ` Eric Dumazet
2009-10-06  3:23       ` Ramkrishna Vepa
2009-10-06  4:18     ` David Miller [this message]
  -- strict thread matches above, loose matches on Subject: below --
2009-10-05  9:14 Sreenivasa Honnur

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=20091005.211852.12665189.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=Ramkrishna.Vepa@neterion.com \
    --cc=Sreenivasa.Honnur@neterion.com \
    --cc=netdev@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