All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [Bug 13751] New: libopenssl (static): huge drop in performance in newer versions of buildroot
@ 2021-04-12  9:23 bugzilla at busybox.net
  2021-04-12 20:07 ` [Buildroot] [Bug 13751] " bugzilla at busybox.net
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: bugzilla at busybox.net @ 2021-04-12  9:23 UTC (permalink / raw)
  To: buildroot

https://bugs.busybox.net/show_bug.cgi?id=13751

            Bug ID: 13751
           Summary: libopenssl (static): huge drop in performance in newer
                    versions of buildroot
           Product: buildroot
           Version: 2021.02.1
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P5
         Component: Other
          Assignee: unassigned at buildroot.uclibc.org
          Reporter: maksis33 at gmail.com
                CC: buildroot at uclibc.org
  Target Milestone: ---

I've done some benchmarking with different TLS 1.3 ciphers with an Intel
Celeron N3150 CPU that has support for the AES-NI instruction set. I used
static builds of AirDC++ Web Client (http://airdcpp-web.github.io) that were
built with different versions of buildroot. Target architecture is x86_64
(nocona). Transfer speeds are limited by the CPU (one core is maxed out).


Encrypted download speeds (Buildroot 2021.02.1):

TLS_AES_128_GCM_SHA256: 27 MB/s
TLS_AES_256_GCM_SHA384: 24 MB/s
TLS_CHACHA20_POLY1305_SHA256: 41 MB/s


Encrypted download speeds (Buildroot 2019.02):

TLS_AES_128_GCM_SHA256: 62 MB/s
TLS_AES_256_GCM_SHA384: 59 MB/s
TLS_CHACHA20_POLY1305_SHA256: 54 MB/s


Note that those are actual network file transfers with additional overhead, so
the plain decrypt speed difference should be much bigger than that ("openssl
speed -evp aes-128-cbc" is about 5x faster than "openssl speed aes-128-cbc" on
the same system).

I'd assume that the issue has something to do with
http://lists.busybox.net/pipermail/buildroot/2019-October/263030.html as the
OpenSSL target arch is "gcc no-asm" in Buildroot 2021.02.1 while 2019.02
targets "linux-x86_64" and also has various *_ASM flags present in the
Makefile. I also confirmed with objdump that the binary built with 2021.02.1 is
missing all references to aesenc/aesdec/other AES-NI instructions while those
instructions are present in the binary built with 2019.02.

I read
https://github.com/openssl/openssl/commit/87bea6550ae0dda7c40937cff2e86cc2b0b09491
and https://github.com/openssl/openssl/issues/9839 but I don't fully understand
why the target architecture was changed. I'd say that ASM support is a must for
applications similar to AirDC++.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [Bug 13751] libopenssl (static): huge drop in performance in newer versions of buildroot
  2021-04-12  9:23 [Buildroot] [Bug 13751] New: libopenssl (static): huge drop in performance in newer versions of buildroot bugzilla at busybox.net
@ 2021-04-12 20:07 ` bugzilla at busybox.net
  2021-05-04  5:50 ` bugzilla at busybox.net
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: bugzilla at busybox.net @ 2021-04-12 20:07 UTC (permalink / raw)
  To: buildroot

https://bugs.busybox.net/show_bug.cgi?id=13751

--- Comment #1 from Arnout Vandecappelle <arnout@mind.be> ---
(In reply to maksis33 from comment #0)
> I'd assume that the issue has something to do with
> http://lists.busybox.net/pipermail/buildroot/2019-October/263030.html
> as the OpenSSL target arch is "gcc no-asm" in Buildroot 2021.02.1 while 2019.02
> targets "linux-x86_64" and also has various *_ASM flags present in the Makefile.

The culprit is actually the following commit:

commit 8c2c959b028d44f5518d4445f864aedae3d90406
Author: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Date:   Fri May 31 15:39:28 2019

    package/libopenssl: fix static build

    no-dso option has been removed with
   
https://github.com/openssl/openssl/commit/31b6ed76dfd53529b74e79830c81372d0b756929

    To fix this error, use "gcc" target in static builds. This target is
    very minimalistic, we need to manually pass -lpthread and
    -DOPENSSL_THREADS however we can also remove libdl workarounds

    Fixes:
     -
http://autobuild.buildroot.org/results/96d6b89d20980e8f7fa450b832474a81d492b315

    Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
    Signed-off-by: Peter Korsgaard <peter@korsgaard.com>


The problem is that in a static build, you don't have shared libraries so also
no DSO (the shared library provided by the kernel).


The upstream commit also adds a preprocessor symbol DSO_NONE (which is not set
by anything). So you could try reverting buildroot commit
8c2c959b028d44f5518d4445f864aedae3d90406 and add -DDSO_NONE to
LIBOPENSSL_CFLAGS.

Of course the revert is not entirely trivial, because the code was refactored
and has moved to Config.in...

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [Bug 13751] libopenssl (static): huge drop in performance in newer versions of buildroot
  2021-04-12  9:23 [Buildroot] [Bug 13751] New: libopenssl (static): huge drop in performance in newer versions of buildroot bugzilla at busybox.net
  2021-04-12 20:07 ` [Buildroot] [Bug 13751] " bugzilla at busybox.net
@ 2021-05-04  5:50 ` bugzilla at busybox.net
  2021-05-04  8:54 ` bugzilla at busybox.net
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: bugzilla at busybox.net @ 2021-05-04  5:50 UTC (permalink / raw)
  To: buildroot

https://bugs.busybox.net/show_bug.cgi?id=13751

--- Comment #2 from Fabrice Fontaine <fontaine.fabrice@gmail.com> ---
Could you try
https://patchwork.ozlabs.org/project/buildroot/patch/20210425133845.2459496-1-fontaine.fabrice at gmail.com/?

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [Bug 13751] libopenssl (static): huge drop in performance in newer versions of buildroot
  2021-04-12  9:23 [Buildroot] [Bug 13751] New: libopenssl (static): huge drop in performance in newer versions of buildroot bugzilla at busybox.net
  2021-04-12 20:07 ` [Buildroot] [Bug 13751] " bugzilla at busybox.net
  2021-05-04  5:50 ` bugzilla at busybox.net
@ 2021-05-04  8:54 ` bugzilla at busybox.net
  2021-05-04 19:26 ` bugzilla at busybox.net
  2021-05-07  8:40 ` bugzilla at busybox.net
  4 siblings, 0 replies; 6+ messages in thread
From: bugzilla at busybox.net @ 2021-05-04  8:54 UTC (permalink / raw)
  To: buildroot

https://bugs.busybox.net/show_bug.cgi?id=13751

--- Comment #3 from maksis33 at gmail.com ---
I tested the patch and it seems to fix the issue. Performance is now similar to
Buildroot 2019.02.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [Bug 13751] libopenssl (static): huge drop in performance in newer versions of buildroot
  2021-04-12  9:23 [Buildroot] [Bug 13751] New: libopenssl (static): huge drop in performance in newer versions of buildroot bugzilla at busybox.net
                   ` (2 preceding siblings ...)
  2021-05-04  8:54 ` bugzilla at busybox.net
@ 2021-05-04 19:26 ` bugzilla at busybox.net
  2021-05-07  8:40 ` bugzilla at busybox.net
  4 siblings, 0 replies; 6+ messages in thread
From: bugzilla at busybox.net @ 2021-05-04 19:26 UTC (permalink / raw)
  To: buildroot

https://bugs.busybox.net/show_bug.cgi?id=13751

Yann E. MORIN <yann.morin.1998@free.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
                 CC|                            |yann.morin.1998 at free.fr
             Status|NEW                         |RESOLVED

--- Comment #4 from Yann E. MORIN <yann.morin.1998@free.fr> ---
Hello, 

Thanks for your report. We believe this has now been fixed with commit
67d19f6014 (package/libopenssl: fix performance issue in static build)
as provided by Fabrice.

Thanks!

Regards,
Yann E. MORIN.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [Bug 13751] libopenssl (static): huge drop in performance in newer versions of buildroot
  2021-04-12  9:23 [Buildroot] [Bug 13751] New: libopenssl (static): huge drop in performance in newer versions of buildroot bugzilla at busybox.net
                   ` (3 preceding siblings ...)
  2021-05-04 19:26 ` bugzilla at busybox.net
@ 2021-05-07  8:40 ` bugzilla at busybox.net
  4 siblings, 0 replies; 6+ messages in thread
From: bugzilla at busybox.net @ 2021-05-07  8:40 UTC (permalink / raw)
  To: buildroot

https://bugs.busybox.net/show_bug.cgi?id=13751

--- Comment #5 from Peter Korsgaard <jacmet@uclibc.org> ---
Also backported to 2021.02.x and will be part of the upcoming 2021.02.2 release

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-05-07  8:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-12  9:23 [Buildroot] [Bug 13751] New: libopenssl (static): huge drop in performance in newer versions of buildroot bugzilla at busybox.net
2021-04-12 20:07 ` [Buildroot] [Bug 13751] " bugzilla at busybox.net
2021-05-04  5:50 ` bugzilla at busybox.net
2021-05-04  8:54 ` bugzilla at busybox.net
2021-05-04 19:26 ` bugzilla at busybox.net
2021-05-07  8:40 ` bugzilla at busybox.net

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.