-
Notifications
You must be signed in to change notification settings - Fork 132
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
bpf: Inline helper in powerpc JIT #8654
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Upstream branch: a68894a |
474f6ed
to
44c3a1d
Compare
…U addrs With the introduction of commit 7bdbf74 ("bpf: add special internal-only MOV instruction to resolve per-CPU addrs"), a new BPF instruction BPF_MOV64_PERCPU_REG has been added to resolve absolute addresses of per-CPU data from their per-CPU offsets. This update requires enabling support for this instruction in the powerpc JIT compiler. As of commit 7a0268f ("[PATCH] powerpc/64: per cpu data optimisations"), the per-CPU data offset for the CPU is stored in the paca. To support this BPF instruction in the powerpc JIT, the following powerpc instructions are emitted: mr dst_reg, src_reg //Move src_reg to dst_reg, if src_reg != dst_reg ld tmp1_reg, 48(13) //Load per-CPU data offset from paca(r13) in tmp1_reg. add dst_reg, dst_reg, tmp1_reg //Add the per cpu offset to the dst. To evaluate the performance improvements introduced by this change, the benchmark described in [1] was employed. Before Change: glob-arr-inc : 41.580 ± 0.034M/s arr-inc : 39.592 ± 0.055M/s hash-inc : 25.873 ± 0.012M/s After Change: glob-arr-inc : 42.024 ± 0.049M/s arr-inc : 55.447 ± 0.031M/s hash-inc : 26.565 ± 0.014M/s [1] anakryiko/linux@8dec900975ef Signed-off-by: Saket Kumar Bhaskar <[email protected]>
Inline the calls to bpf_get_smp_processor_id() in the powerpc bpf jit. powerpc saves the Logical processor number (paca_index) in paca. Here is how the powerpc JITed assembly changes after this commit: Before: cpu = bpf_get_smp_processor_id(); addis 12, 2, -517 addi 12, 12, -29456 mtctr 12 bctrl mr 8, 3 After: cpu = bpf_get_smp_processor_id(); lhz 8, 8(13) To evaluate the performance improvements introduced by this change, the benchmark described in [1] was employed. +---------------+-------------------+-------------------+--------------+ | Name | Before | After | % change | |---------------+-------------------+-------------------+--------------| | glob-arr-inc | 41.580 ± 0.034M/s | 54.137 ± 0.019M/s | + 30.20% | | arr-inc | 39.592 ± 0.055M/s | 54.000 ± 0.026M/s | + 36.39% | | hash-inc | 25.873 ± 0.012M/s | 26.334 ± 0.058M/s | + 1.78% | +---------------+-------------------+-------------------+--------------+ [1] anakryiko/linux@8dec900975ef Signed-off-by: Saket Kumar Bhaskar <[email protected]>
Upstream branch: be741c7 |
4812334
to
547c862
Compare
44c3a1d
to
720c696
Compare
At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=942781 expired. Closing PR. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull request for series with
subject: bpf: Inline helper in powerpc JIT
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=942781