[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <47E9D1DC.6030201@garzik.org>
Date: Wed, 26 Mar 2008 00:32:28 -0400
From: Jeff Garzik <jeff@...zik.org>
To: David Miller <davem@...emloft.net>
CC: yang.shi@...driver.com, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] Improvev netconsole support for RTL8139 NIC driver
David Miller wrote:
> First, if you mention CPU instructions executed you're
> totally ignoring what I wrote. Which is that we're
> about to sit spinning on hundreds of cycles doing a PIO
> read on a status register.
>
> Those hand full of cycles doing the irqsave/irqrestore don't matter,
> at all.
>
> Again, you're arguing for 18 cycles or so out of say 800.
> It's peanuts, at best.
No, I hear you.
I'm not focusing on cycles, but list examples of the negative effects of
doing needless work for the sake of consistency:
* eliminates ability to compile-out spinlocks on UP
* code size increases (even if miniscule)
* CPU instructions in a hot path increases (even if lost in the noise)
* stack usage increases (even if miniscule)
But those are just examples of the principle: don't do work you don't
need to do.
I also think spin_lock -> spin_lock_irqsave amounts to a slight loss of
information, too: Use of spin_lock() rather than spin_lock_irqsave()
potentially gives the -rt folks some additional flexibility, by
advertising a different set of acceptable irq-disablement states.
Is the effect huge in this specific case? No.
Does that give us license to add needless code to drivers? No, again, IMO.
Jeff
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists