arm64 build doesn't use asm and is 4x-16x slower than it could be

Bug #1552939 reported by Ali
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenSSL
Invalid
Undecided
Unassigned
openssl (Debian)
Fix Released
Unknown
openssl (Ubuntu)
Fix Released
High
dann frazier

Bug Description

The openssl build for arm64 doesn't compile in the assembly that is present in openssl as of version 1.0.2 for aarch64 because the debian-targets.patch that is applied specifies a target that doesn't have assembly. The line at issue is debian-arm64 target which needs ${no_asm} changed to ${aarch64_asm}:linux64. Running openssl speed -evp aes-128-gcm shows a 4x-16x improvement in performance with this change made and the package rebuilt. Other aes and sha variants show similar performance gains by enabling asm.

Yangzheng Bai (zoy)
tags: added: xenial
Revision history for this message
Yangzheng Bai (zoy) wrote :
Yangzheng Bai (zoy)
tags: added: arm64 patch
Changed in openssl:
status: Unknown → New
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "debian-arm64-aarch64_asm.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in openssl (Ubuntu):
status: New → Confirmed
dann frazier (dannf)
Changed in openssl (Ubuntu):
assignee: nobody → dann frazier (dannf)
importance: Undecided → High
Changed in openssl:
importance: Unknown → Undecided
Revision history for this message
dann frazier (dannf) wrote :

Thanks for the patch Ali! I uploaded a test package to ppa:dannf/test, and I've attempted to reproduce the improvement on a couple of different systems.

On a ThunderX system, I am observing a significant performance improvement. However, on an X-Gene system, the performance actually seems to be about the same slightly worse. Is that expected?

Revision history for this message
dann frazier (dannf) wrote :

Oops - I mean thanks Yangzheng! Confused the bug reporter w/ the patch submitter, sorry!

dann frazier (dannf)
Changed in openssl (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Ali (asaidi) wrote :

Hi Dann,

Yes, that is expected. The Xgene doesn't have support for hardware crypto instructions. I believe it's the only AArch64 platform without them.

Changed in openssl (Debian):
status: Unknown → New
Christian Reis (kiko)
Changed in openssl (Ubuntu):
status: Incomplete → In Progress
Revision history for this message
dann frazier (dannf) wrote :

This is a change to a Debian-specific targets, so marking it Invalid for the upstream OpenSSL project.

Changed in openssl:
status: New → Invalid
Changed in openssl (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
dann frazier (dannf) wrote :

fyi, this is now available in xenial-proposed.

Revision history for this message
Yangzheng Bai (zoy) wrote :

Verified the new xenial-proposed openssl and libssl debs, both AES and SHA performance have been significantly improved.

We tested the following packages from xenial-proposed on arm64 (aarch64 with fp asimd evtstrm aes pmull sha1 sha2 crc32) and the performance result is as expected:

libssl1.0.0_1.0.2g-1ubuntu2_arm64.deb
libssl1.0.0-dbg_1.0.2g-1ubuntu2_arm64.deb
libssl1.0.0-dbgsym_1.0.2g-1ubuntu2_arm64.ddeb
libssl-dev_1.0.2g-1ubuntu2_arm64.deb
libssl-dev-dbgsym_1.0.2g-1ubuntu2_arm64.ddeb
libssl-doc_1.0.2g-1ubuntu2_all.deb
openssl_1.0.2g-1ubuntu2_arm64.deb
openssl-dbgsym_1.0.2g-1ubuntu2_arm64.ddeb

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package openssl - 1.0.2g-1ubuntu2

---------------
openssl (1.0.2g-1ubuntu2) xenial; urgency=medium

  * debian/patches/arm64-aarch64_asm.patch: Enable aarch64 asm routines
    (LP: #1552939).

 -- dann frazier <email address hidden> Mon, 07 Mar 2016 10:03:26 -0700

Changed in openssl (Ubuntu):
status: Fix Committed → Fix Released
Changed in openssl (Debian):
status: New → Fix Released
Revision history for this message
Edward Vielmetti (edward-vielmetti) wrote :

Are there before and after numbers for ThunderX that are easy to share? I'm seeing

aes-128-gcm 78608.06k 167039.08k 239836.84k 268366.17k 277192.70k

with "OpenSSL 1.0.2g 1 Mar 2016" on Ubuntu 16.04 LTS aarch64 with "1.0.2g-1ubuntu4.6", which almost certainly is a "with this patch" number.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.