From: "Nitin Gupta" <nitingupta910@gmail.com>
To: "Christoph Hellwig" <hch@infradead.org>,
"Nitin Gupta" <nitingupta910@gmail.com>,
LKML <linux-kernel@vger.kernel.org>,
"Andrew Morton" <akpm@linux-foundation.org>,
"Daniel Hazelton" <dhazelton@enter.net>,
"Richard Purdie" <richard@openedhand.com>
Subject: Re: [RFC] LZO de/compression support - take 7
Date: Thu, 7 Jun 2007 12:19:19 +0530 [thread overview]
Message-ID: <4cefeab80706062349s264648fbr25ccbc9884be2057@mail.gmail.com> (raw)
In-Reply-To: <4cefeab80706060705o210f6a71od074d6cc60e113a9@mail.gmail.com>
On 6/6/07, Nitin Gupta <nitingupta910@gmail.com> wrote:
> On 6/6/07, Christoph Hellwig <hch@infradead.org> wrote:
> > On Wed, Jun 06, 2007 at 06:04:17PM +0530, Nitin Gupta wrote:
> > > Hi,
> > >
> > > This is kernel port of LZO1X-1 compressor and LZO1X decompressor (safe
> > > version only).
> > >
> > > * Changes since 'take 6' (Full Changelog after this):
> > > 1) Fixed unaligned memory access problems as pointed out by author --
> > > LZO_UNALIGNED_OK_{2,4} collapsed to UNALIGNED_OK which is #defined for
> > > archs that allow unaligned access (see lib/lzo1x/Makefile). For other
> > > archs, we fall down to byte-by-byte access avoiding any unaligned
> > > access. In original code, LZO_UNALIGNED_OK_{2,4} resp. describe if we
> > > can do unaligned access for ushort and uint32.
> >
> > Please use get_unaligned() for any unaligned access in kernel space.
> >
> >
>
> Done.
>
Just as a side note: I think retaining code to do byte-by-byte access
also is worth it, such as:
+ #ifdef UNALIGNED_OK
+ if (get_unaligned((const unsigned short *)m_pos) ==
+ get_unaligned((const unsigned short *)ip)) {
+#else
+ if (m_pos[0] != ip[0] || m_pos[1] != ip[1]) {
+#endif
Since on archs where unaligned access is slower than byte-by-byte
access (e.g. where unaligned access dirty work is done in s/w), we do
not want to use get_unaligned() - instead simply byte-by-byte access
is better.
- Nitin
prev parent reply other threads:[~2007-06-07 6:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-06 12:34 Nitin Gupta
2007-06-06 12:51 ` Christoph Hellwig
2007-06-06 14:05 ` Nitin Gupta
2007-06-07 6:49 ` Nitin Gupta [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=4cefeab80706062349s264648fbr25ccbc9884be2057@mail.gmail.com \
--to=nitingupta910@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=dhazelton@enter.net \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=richard@openedhand.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
all inboxes | Powered by JetHome®