From: "Satyam Sharma" <satyam.sharma@gmail.com>
To: "Nitin Gupta" <nitingupta910@gmail.com>
Cc: linux-kernel@vger.kernel.org, linux-mm-cc@laptop.org,
"Richard Purdie" <richard@openedhand.com>,
"Andrew Morton" <akpm@linux-foundation.org>,
"Andrey Panin" <pazke@donpac.ru>, "Bret Towe" <magnade@gmail.com>,
"Michael-Luke Jones" <mlj28@cam.ac.uk>
Subject: Re: [RFC] LZO de/compression support - take 4
Date: Fri, 25 May 2007 18:02:41 +0530 [thread overview]
Message-ID: <a781481a0705250532q60bc99b0n93ec6275ac5ca951@mail.gmail.com> (raw)
In-Reply-To: <4cefeab80705250445m51736a9aj8c89af893d8c242c@mail.gmail.com>
On 5/25/07, Nitin Gupta <nitingupta910@gmail.com> wrote:
> Hi,
>
> This is kernel port of LZO1X compressor and LZO1X decompressor (safe
> version only).
>
> * Changes since 'take 3' (Full Changelog after this):
> 1) Removed 'unsafe' decompressor - hence also do away with symlinks in
> Makefiles.
Nice :-)
> 2) Rolled back changes where I replaced COPY4 with memcpy() calls.
> This seemed to be causing too much perf. loss as shown by Richard's
> tests. Need perf. testing again to confirm that this patch has perf.
> comparable to original LZO code/Richard's patch.
Hmmm, you've done away with a lot of cleanup in one big swoop under
suspicion of what exactly causes the performance loss ... so I'd rather
wait till you pinpoint the exact cause.
> 3) Some functions were inlined (DX2, DX3 etc.) - this also seemed to
> be one of factors for perf. loss. Changed them back Macros.
Why would an inline function be slower than a macro? If you're
worried that gcc may ignore to inline them (which is unlikely as it is
with -O2), you can use __always_inline ... inline functions do provide
type-checking.
> 4) Added back the 'register' keyword - again seemed to me one of
> factors for perf. loss.
Again, I wonder whether the programmer's opinion to keep something in
the registers is necessarily better than the compiler's. Especially when
gcc would quite likely ignore your register hint in any case, can't think
of too many reasons to use register these days ...
> Once I pinpoint exact reason for bad perf., I will do above cleanups
> again. But this should not be reason for non-inclusion in mainline.
> These are only minor cleanups.
Right, it'd be nice if you do a step-by-step cleanup to find what exactly
caused the performance hit.
> Richard, can you please provide perf. results for this patch also?
> Also, can you please mail back latest version of your LZO patch? In
> meantime, I will try to include benchmarking support to the
> 'compress-test' module.
I wonder if you could try and use crypto/tcrypt.c -- the debugfs test
module involves userspace, the VFS layer etc ... tcrypt otoh is fully
within the kernel so less likely to introduce spurious noise to the numbers
and better suited to performance benchmarking.
> 5) The only code change: (as suggested by Andrey)
> -#if defined(__LITTLE_ENDIAN)
> - m_pos = op - 1;
> - m_pos -= (*(const unsigned short *)ip) >> 2;
> -#else
> - m_pos = op - 1;
> - m_pos -= (ip[0] >> 2) + (ip[1] << 6);
> -#endif
>
> + m_pos = op - 1 - (cpu_to_le16(*(const u16 *)ip) >> 2);
>
> (Andrey suggested le16_to_cpu for above but I think it should be cpu_to_le16).
> *** Need testing on big endian machine ***
>
> Similarly:
> -#if defined(__LITTLE_ENDIAN)
> - m_pos -= (*(const unsigned short *)ip) >> 2;
> -#else
> - m_pos -= (ip[0] >> 2) + (ip[1] << 6);
> -#endif
>
> + m_pos -= cpu_to_le16(*(const u16 *)ip) >> 2;
You could try and rollback this change too. Also, try to get results
on various arch's yourself (if you can lay your hands on some x86-64
/ sparc64 / etc boxen).
Otherwise, if it's still slower (and we're talking >10% here), there's not
much reason why we shouldn't stay with Richard's patches itself. You
could try and do cleanups to that itself (if Richard's fine with it and as
long as you retain performance).
Satyam
next prev parent reply other threads:[~2007-05-25 12:32 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-25 11:45 Nitin Gupta
2007-05-25 12:00 ` Michael-Luke Jones
2007-05-25 12:10 ` Richard Purdie
2007-05-25 12:37 ` Satyam Sharma
2007-05-25 13:38 ` Richard Purdie
2007-05-25 16:55 ` Daniel Hazelton
2007-05-25 18:45 ` Daniel Hazelton
2007-05-25 19:35 ` Satyam Sharma
2007-05-28 8:18 ` Daniel Hazelton
2007-05-28 8:37 ` Nitin Gupta
2007-05-28 8:43 ` Daniel Hazelton
2007-05-28 9:08 ` Nitin Gupta
2007-05-28 9:21 ` Daniel Hazelton
2007-05-28 9:46 ` Nitin Gupta
2007-05-28 9:58 ` Daniel Hazelton
2007-05-25 12:57 ` Nitin Gupta
2007-05-25 13:33 ` Richard Purdie
2007-05-26 10:28 ` Richard Purdie
2007-05-26 11:21 ` Nitin Gupta
2007-05-25 12:32 ` Satyam Sharma [this message]
2007-05-26 19:17 roland
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=a781481a0705250532q60bc99b0n93ec6275ac5ca951@mail.gmail.com \
--to=satyam.sharma@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm-cc@laptop.org \
--cc=magnade@gmail.com \
--cc=mlj28@cam.ac.uk \
--cc=nitingupta910@gmail.com \
--cc=pazke@donpac.ru \
--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®