All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ralf Baechle <ralf@linux-mips.org>
To: linux-mips@linux-mips.org, loongson-dev@googlegroups.com
Subject: Re: [PATCH] MIPS: Add emulation for fpureg-mem unaligned access
Date: Tue, 31 Jul 2012 17:10:05 +0200	[thread overview]
Message-ID: <20120731151005.GB14151@linux-mips.org> (raw)
In-Reply-To: <20120731140723.GB25996@vicerveza.homeunix.net>

On Tue, Jul 31, 2012 at 04:07:23PM +0200, Lluís Batlle i Rossell wrote:

> Maybe there could be a cleaner declaration of that intention, though. The only
> code there was "I herewith declare: this does not happen.  So send SIGBUS."

To give you an idea, the emulation is on the order of a 1000 times slower
than the processing a properly aligned load in hardware.  And even where
hardware does unaligned handling such as on x86 there still is a performance
penalty though that would far less severe.

So given that proper alignment is always the right thing.  There are very
few cases were handling misalignment in software is justified, for example
the IP stack.  Even the checks if a packet is misaligned would cause a
performance penalty and it's (assuming sane networking hardware) a very
rare event.

lwl/lwr in the IP stack would be a bad tradeoff.  It's faster than the
unaligned exception handler but would slow down processing of every
correctly aligned packet.  So lwl/lwr are only a good choice where a high
fraction of misaligned packets is expected.

  Ralf

      reply	other threads:[~2012-07-31 15:10 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-15 22:22 [PATCH] MIPS: Add emulation for fpureg-mem unaligned access Lluis Batlle i Rossell
2012-06-16 11:21 ` Jonas Gorski
2012-06-16 12:15   ` Lluís Batlle i Rossell
2012-06-16 12:40     ` [loongson-dev] " Lluís Batlle i Rossell
2012-06-20 19:05       ` Lluís Batlle i Rossell
2012-07-11  0:05         ` Maciej W. Rozycki
2012-07-30 19:47           ` Lluís Batlle i Rossell
2012-07-30 23:56             ` Maciej W. Rozycki
2012-06-16 12:58     ` Lluís Batlle i Rossell
2012-06-17  9:09       ` Thomas Bogendoerfer
2012-07-31 13:40 ` Ralf Baechle
2012-07-31 14:07   ` Lluís Batlle i Rossell
2012-07-31 15:10     ` Ralf Baechle [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=20120731151005.GB14151@linux-mips.org \
    --to=ralf@linux-mips.org \
    --cc=linux-mips@linux-mips.org \
    --cc=loongson-dev@googlegroups.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 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.