Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linux_5_0: restore __kernel_fpu_{begin,restore} #61076

Merged
merged 1 commit into from
May 7, 2019
Merged

Conversation

Mic92
Copy link
Member

@Mic92 Mic92 commented May 7, 2019

In 5.0er these function were removed from the public interface also zfs needs
them for AVX/AES-NI support. Without this patch for example throughput on a
encrypted zfs dataset drops to 200 MB/s from 1.2 GB/s. These functions were
removed as there was no user within the linux kernel tree itself.

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

In 5.0er these function were removed from the public interface also zfs needs
them for AVX/AES-NI support. Without this patch for example throughput on a
encrypted zfs dataset drops to 200 MB/s from 1.2 GB/s. These functions were
removed as their was no user within the linux kernel tree itself.
@Mic92 Mic92 requested a review from fpletz May 7, 2019 05:53

kernel_fpu_enable();
}
+EXPORT_SYMBOL(__kernel_fpu_end);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The way the zfs build system works is that it just picks up the symbols if they are exported.

@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 11-100 labels May 7, 2019
@Mic92 Mic92 merged commit 2146e10 into NixOS:master May 7, 2019
@Mic92 Mic92 deleted the linux-fpu branch May 7, 2019 09:35
@tilpner
Copy link
Member

tilpner commented Jun 22, 2019

Should this be added to older kernels too, now that it was backported to e.g. 4.19.52?

@nh2
Copy link
Contributor

nh2 commented Dec 2, 2019

I suspect yes, I see very 100% z_wr_iss CPU usage, see openzfs/zfs#9370.

See also openzfs/zfs#9515.

@grahamc
Copy link
Member

grahamc commented Dec 2, 2019

According to show-derivation, my 19.09 system on 4.19.86 has been patched:

nix show-derivation /nix/store/hv84pqznindpcdc7szgyvh4dinq9ls6w-linux-4.19.86.drv
...
"patches": "/nix/store/mnlqwys9dxznjcvq4w3s0435s9ql8qv8-bridge-stp-helper.patch 
/nix/store/h4c3bag6lv3y47sbx83339xnalmlmdmg-modinst-arg-list-too-long.patch 
/nix/store/l24rm77fgrycjyjwx75b14wk1n4x49p9-export_kernel_fpu_functions.patch 
/nix/store/hdr6v584ig3dpjlcs9afxxky3lvzm2nw-randstruct-provide-seed.patch",

@nh2
Copy link
Contributor

nh2 commented Dec 2, 2019

Hmm, indeed my perf top shows me aes_encrypt_intel and aes_aesni_encrypt, suggesting that AES-NI is working as expected.

I'm still surprised the performance is so bad though, I'm maxed out on 100% CPU for z_wr_iss at 100 MB/s.

@tilpner
Copy link
Member

tilpner commented Dec 2, 2019

@nh2 My question from 2019-06-22 was answered elsewhere, and should have been addressed in #63664 and #63665

Mic92 pushed a commit to Mic92/nixpkgs that referenced this pull request Apr 29, 2023
Introduced in torvalds/linux@aaeca98
with the usual disdain for ZFS.

We have been there in the past with
<https://www.phoronix.com/news/NixOS-Linux-5.0-ZFS-FPU-Drop> /
NixOS#61076.

This fixes ZFS on aarch64 until the next breakage.

See openzfs/zfs#14555 for original upstream
issue.
RaitoBezarius added a commit to RaitoBezarius/nixpkgs that referenced this pull request May 4, 2023
Introduced in torvalds/linux@aaeca98
with the usual disdain for ZFS.

We have been there in the past with
<https://www.phoronix.com/news/NixOS-Linux-5.0-ZFS-FPU-Drop> /
NixOS#61076.

This fixes ZFS on aarch64 until the next breakage.

See openzfs/zfs#14555 for original upstream
issue.
Mic92 pushed a commit to Mic92/nixpkgs that referenced this pull request May 7, 2023
Introduced in torvalds/linux@aaeca98
with the usual disdain for ZFS.

We have been there in the past with
<https://www.phoronix.com/news/NixOS-Linux-5.0-ZFS-FPU-Drop> /
NixOS#61076.

This fixes ZFS on aarch64 until the next breakage.

See openzfs/zfs#14555 for original upstream
issue.
Mic92 pushed a commit to Mic92/nixpkgs that referenced this pull request May 7, 2023
Introduced in torvalds/linux@aaeca98
with the usual disdain for ZFS.

We have been there in the past with
<https://www.phoronix.com/news/NixOS-Linux-5.0-ZFS-FPU-Drop> /
NixOS#61076.

This fixes ZFS on aarch64 until the next breakage.

See openzfs/zfs#14555 for original upstream
issue.
Mic92 pushed a commit to Mic92/nixpkgs that referenced this pull request Jun 10, 2023
Introduced in torvalds/linux@aaeca98
with the usual disdain for ZFS.

We have been there in the past with
<https://www.phoronix.com/news/NixOS-Linux-5.0-ZFS-FPU-Drop> /
NixOS#61076.

This fixes ZFS on aarch64 until the next breakage.

See openzfs/zfs#14555 for original upstream
issue.
Mic92 pushed a commit to TUM-DSE/nixpkgs that referenced this pull request Jun 13, 2023
Introduced in torvalds/linux@aaeca98
with the usual disdain for ZFS.

We have been there in the past with
<https://www.phoronix.com/news/NixOS-Linux-5.0-ZFS-FPU-Drop> /
NixOS#61076.

This fixes ZFS on aarch64 until the next breakage.

See openzfs/zfs#14555 for original upstream
issue.
Mic92 pushed a commit to Mic92/nixpkgs that referenced this pull request Jun 15, 2023
Introduced in torvalds/linux@aaeca98
with the usual disdain for ZFS.

We have been there in the past with
<https://www.phoronix.com/news/NixOS-Linux-5.0-ZFS-FPU-Drop> /
NixOS#61076.

This fixes ZFS on aarch64 until the next breakage.

See openzfs/zfs#14555 for original upstream
issue.
Mic92 pushed a commit to Mic92/nixpkgs that referenced this pull request Jun 16, 2023
Introduced in torvalds/linux@aaeca98
with the usual disdain for ZFS.

We have been there in the past with
<https://www.phoronix.com/news/NixOS-Linux-5.0-ZFS-FPU-Drop> /
NixOS#61076.

This fixes ZFS on aarch64 until the next breakage.

See openzfs/zfs#14555 for original upstream
issue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 11-100
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants