Bug 203571 - Allow use of SIMD in interrupts on PowerPC
Summary: Allow use of SIMD in interrupts on PowerPC
Status: NEW
Alias: None
Product: Platform Specific/Hardware
Classification: Unclassified
Component: PPC-64 (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: platform_ppc-64
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-05-11 05:01 UTC by Shawn Landden
Modified: 2019-05-13 12:39 UTC (History)
0 users

See Also:
Kernel Version: 4.19
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description Shawn Landden 2019-05-11 05:01:16 UTC
This patch optimizing chacha20 for WireGuard https://github.com/shawnl/WireGuard/commit/3e02fce92a14cba7b7d1e2733def3a51bec97498

doesn't work because may_use_simd() is always returning false in kworkers. If I remove the check everything seems to work fine.
Comment 1 Shawn Landden 2019-05-11 17:27:32 UTC
                                                      ▒
-   11.41%     0.01%  kworker/1:2-mm_  [kernel.vmlinux]            [k] process_one_work                                                                         ▒
   - 11.41% process_one_work                                                                                                                                    ▒
      - 10.28% wg_packet_tx_worker                                                                                                                              ▒
         - 10.06% wg_socket_send_skb_to_peer                                                                                                                    ▒
            - 7.38% _raw_read_unlock_bh                                                                                                                         ▒
               - 7.35% __local_bh_enable_ip                                                                                                                     ▒
                  - 7.34% do_softirq.part.2                                                                                                                     ▒
                     - 7.31% do_softirq_own_stack                                                                                                               ▒
                        + 7.28% call_do_softirq                                                                                                                 ▒
            - 2.45% send4                                                                                                                                       ▒
               - 1.85% udp_tunnel_xmit_skb                                                                                                                      ▒
                  - 1.66% iptunnel_xmit                                                                                                                         ▒
                     - 1.33% ip_local_out                                                                                                                       ▒
                        - 1.14% ip_output                                                                                                                       ▒
                           - 1.06% ip_finish_output2                                                                                                            ▒
                              + 0.99% __dev_queue_xmit                                                                                                          ▒
      - 1.06% wg_packet_encrypt_worker                                                                                                                          ▒
         - 1.03% encrypt_packet                                                                                                                                 ▒
            - 0.98% chacha20poly1305_encrypt_sg                                                                                                                 ▒
                 0.59% chacha20
Comment 2 Shawn Landden 2019-05-13 12:39:38 UTC
X86 manages to allow SIMD in interrupts through some very careful code in arch/x86/kernel/fpu/core.c (starting with irq_fpu_usable())

PowerPC can do the same.

Note You need to log in before you can comment on or make changes to this bug.