From: Linus Torvalds <torvalds@osdl.org>
To: David Woodhouse <dwmw2@infradead.org>
Cc: Russell King <rmk+lkml@arm.linux.org.uk>,
Thomas Gleixner <tglx@linutronix.de>,
Greg Weeks <greg.weeks@timesys.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2.4] jffs2 aligment problems
Date: Mon, 7 Jun 2004 12:22:57 -0700 (PDT) [thread overview]
Message-ID: <Pine.LNX.4.58.0406071218240.1637@ppc970.osdl.org> (raw)
In-Reply-To: <1086635643.29255.46.camel@localhost.localdomain>
On Mon, 7 Jun 2004, David Woodhouse wrote:
> > > Pleas fix jffs2 to use the proper "get_unaligned()"/"put_unaligned()"
> > > instead.
>
> > I'll let you have a bun fight with dwmw2 and networking people over
> > this. I'm standing well clear. 8)
>
> S'fine by me. I already added get_unaligned() to the flash drivers years
> ago -- it's actually those, not JFFS2 itself which needs it. Alan
> insisted I remove it on the basis that much of our network code is
> similarly broken anyway; an arch without fixups is dead in the water
> whatever happens.
I don't see it as a correctness issue, I see it as a performance issue.
Yes, the old ARM chips that can't do unaligned accesses and can't even
trap on them probably have a number of cases where they literally do the
wrong thing, and I think most people will say "tough luck, don't do that
then".
But get_unaligned() makes sense quite apart from that usage too. Notably,
many architectures can cheaply do unaligned accesses when they are known
to be unaligned, but take thousands of cycles to fix up traps. Alpha comes
to mind, and this was actually what "get_unaligned()" was really designed
for.
> Anything which _could_ be unaligned should be marked as such, even if we
> do have two levels ('possibly unaligned', 'probably unaligned') where
> the latter behaves purely as an optimisation on most arches, just like
> our current get_unaligned() does.
Right now we might as well consider the "get_unaligned()" to be a "quite
possibly unaligned" as opposed to "this just _might_ be unaligned".
That's the current usage pattern anyway. Nothing really _guarantees_ that
unaligned accesses are marked with "get_unaligned()", but the unaligned
fixup is at least supposed to be _rare_.
Put another way: imagine if the unaligned handler did a printk(). That
shouldn't flood the logs under normal load.
Linus
next prev parent reply other threads:[~2004-06-07 19:23 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-07 15:08 Greg Weeks
2004-06-07 15:36 ` Thomas Gleixner
2004-06-07 16:03 ` Linus Torvalds
2004-06-07 16:41 ` Russell King
2004-06-07 19:14 ` David Woodhouse
2004-06-07 19:22 ` Linus Torvalds [this message]
2004-06-07 20:39 ` David Woodhouse
2004-06-07 20:54 ` Linus Torvalds
2004-06-07 20:56 ` Thomas Gleixner
2004-06-07 21:29 ` David Woodhouse
2004-06-07 21:40 ` Thomas Gleixner
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=Pine.LNX.4.58.0406071218240.1637@ppc970.osdl.org \
--to=torvalds@osdl.org \
--cc=dwmw2@infradead.org \
--cc=greg.weeks@timesys.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rmk+lkml@arm.linux.org.uk \
--cc=tglx@linutronix.de \
/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
all inboxes | Powered by JetHome®