public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <ak@suse.de>
To: jbarnes@sgi.com (Jesse Barnes)
Cc: linux-kernel@vger.kernel.org
Subject: Re: Memory mapped IO vs Port IO
Date: Fri, 12 Sep 2003 20:09:33 +0200	[thread overview]
Message-ID: <20030912200933.4e483bf8.ak@suse.de> (raw)
In-Reply-To: <20030912180429.GA876@sgi.com>

On Fri, 12 Sep 2003 11:04:29 -0700
jbarnes@sgi.com (Jesse Barnes) wrote:

> On Fri, Sep 12, 2003 at 08:00:03PM +0200, Andi Kleen wrote:
> > jbarnes@sgi.com (Jesse Barnes) writes:
> > 
> > > Ok, Andi asked for benchmarks, so I ran some.  Let this should be a
> > > lesson on why you shouldn't use port I/O :)  I ran these on an SGI Altix
> > > w/900 MHz McKinley processors.
> > > 
> > > Just straight calls to the routines (all of these are based on the
> > > average of 100 iterations):
> > >   writeq(val, reg) time: 64 cycles
> > >   outl(val, reg) time: 2126 cycles
> >                          ^^^^^
> > > 
> > > A simple branch:
> > >   if (use_mmio)
> > > 	writeq(val, reg) time: 132 cycles
> > >   else
> > > 	outl(val, reg) time: 1990 cycles
> >                              ^^^^^
> > Something seems to be wrong in your numbers.
> > 
> > Surely the outl in the if () cannot be faster than the pure outl() ?
> 
> Well, they're approximate at best...  For outl the branch doesn't seem
> to matter since it takes forever regardless.

True. Ok for PIO it doesn't matter. I'm surprised the hit is that big
for MMIO. What code does the IA64 compiler generate for this?
If it was a branch it should have been predicted.

I guess we could use dynamic patching like the alternative() code on
i386 does for prefetches etc., but that may be a bit of overkill...
Or fix the makefiles that they can easily compile two versions of 
the driver.

-Andi

  reply	other threads:[~2003-09-12 18:10 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20030911192550.7dfaf08c.ak@suse.de.suse.lists.linux.kernel>
     [not found] ` <1063308053.4430.37.camel@huykhoi.suse.lists.linux.kernel>
     [not found]   ` <20030912162713.GA4852@sgi.com.suse.lists.linux.kernel>
     [not found]     ` <20030912174807.GA629@sgi.com.suse.lists.linux.kernel>
2003-09-12 18:00       ` Memory mapped IO vs Port IO Andi Kleen
2003-09-12 18:04         ` Jesse Barnes
2003-09-12 18:09           ` Andi Kleen [this message]
2003-09-12 18:11         ` Tim Hockin
2003-09-12 18:24           ` Jesse Barnes
2003-09-12 18:29             ` Andi Kleen
2003-09-12 18:58             ` Martin J. Bligh
2003-09-12 19:51               ` Jesse Barnes
2003-09-12 16:41 John Bradford
2003-09-12 21:52 ` Mike Fedyk
2003-09-13  4:01   ` Mike Fedyk
     [not found] <20030911160116.GI21596@parcelfarce.linux.theplanet.co.uk.suse.lists.linux.kernel>
2003-09-11 16:17 ` Andi Kleen
2003-09-11 16:25   ` Matthew Wilcox
2003-09-11 16:31     ` Andi Kleen
2003-09-11 16:42       ` Matthew Wilcox
2003-09-11 17:12       ` Jamie Lokier
2003-09-11 17:25         ` Andi Kleen
2003-09-12  1:39           ` jw schultz
2003-09-12 16:10           ` Anthony Dominic Truong
2003-09-12 16:22             ` Jamie Lokier
2003-09-12 16:27             ` Jesse Barnes
2003-09-12 17:48               ` Jesse Barnes
2003-09-11 17:13   ` Jamie Lokier
     [not found] ` <20030911161450.GA23536@sgi.com.suse.lists.linux.kernel>
2003-09-11 16:20   ` Andi Kleen
  -- strict thread matches above, loose matches on Subject: below --
2003-09-11 16:01 Matthew Wilcox
2003-09-11 16:14 ` Måns Rullgård
2003-09-11 16:14 ` 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=20030912200933.4e483bf8.ak@suse.de \
    --to=ak@suse.de \
    --cc=jbarnes@sgi.com \
    --cc=linux-kernel@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