From: Jeff Garzik <jeff@garzik.org>
To: David Miller <davem@davemloft.net>
Cc: yang.shi@windriver.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Improvev netconsole support for RTL8139 NIC driver
Date: Wed, 26 Mar 2008 00:32:28 -0400 [thread overview]
Message-ID: <47E9D1DC.6030201@garzik.org> (raw)
In-Reply-To: <20080325.205331.02412053.davem@davemloft.net>
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
prev parent reply other threads:[~2008-03-26 4:32 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-26 2:12 [PATCH] Improvev netconsole support for RTL8139 NIC driver yshi
2008-03-26 2:23 ` Jeff Garzik
2008-03-26 2:38 ` yshi
2008-03-26 2:42 ` David Miller
2008-03-26 2:52 ` yshi
2008-03-26 3:14 ` Jeff Garzik
2008-03-26 3:14 ` Jeff Garzik
2008-03-26 3:30 ` David Miller
2008-03-26 3:39 ` Jeff Garzik
2008-03-26 3:48 ` Jeff Garzik
2008-03-26 3:53 ` David Miller
2008-03-26 4:32 ` Jeff Garzik [this message]
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=47E9D1DC.6030201@garzik.org \
--to=jeff@garzik.org \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=yang.shi@windriver.com \
/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;
as well as URLs for NNTP newsgroup(s).