Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Add memory operation syscalls #16447

Merged
merged 1 commit into from
Jun 1, 2021
Merged

Conversation

jackcmay
Copy link
Contributor

@jackcmay jackcmay commented Apr 8, 2021

Problem

Large repetitive memory operations (memcpy) are expensive in BPF

Summary of Changes

  • Provide syscalls to do those operations natively
  • This PR exposes syscalls for memcpy, memmove, memset, and memcmp.
  • Consolidate the memory op tests into a trait/function combo so we can run the memory tests on multiple implementations of the above functions. Currently testing builtins and syscalls
  • Once these are mainlined we can update the toolchain to take advantage of these syscalls inherently.

Fixes #

@jackcmay jackcmay added the CI Pull Request is ready to enter CI label Apr 8, 2021
@solana-grimes solana-grimes removed the CI Pull Request is ready to enter CI label Apr 8, 2021
@codecov
Copy link

codecov bot commented Apr 8, 2021

Codecov Report

Merging #16447 (27bf9b4) into master (ac452f9) will decrease coverage by 0.0%.
The diff coverage is 21.4%.

@@            Coverage Diff            @@
##           master   #16447     +/-   ##
=========================================
- Coverage    82.7%    82.6%   -0.1%     
=========================================
  Files         426      427      +1     
  Lines      119417   119533    +116     
=========================================
+ Hits        98793    98826     +33     
- Misses      20624    20707     +83     

@dmakarov
Copy link
Contributor

dmakarov commented Apr 9, 2021

Is this going to be merged soon? Once this is merged I can release a new version of bpf-tools that uses the memory operations syscalls

@stale
Copy link

stale bot commented Apr 19, 2021

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale [bot only] Added to stale content; results in auto-close after a week. label Apr 19, 2021
@stale stale bot removed the stale [bot only] Added to stale content; results in auto-close after a week. label May 31, 2021
@jackcmay jackcmay requested a review from dmakarov June 1, 2021 21:08
@jackcmay jackcmay added the v1.7 label Jun 1, 2021
@jackcmay jackcmay merged commit 2b50529 into solana-labs:master Jun 1, 2021
@jackcmay jackcmay deleted the mem-op-syscalls branch June 1, 2021 22:33
mergify bot pushed a commit that referenced this pull request Jun 1, 2021
(cherry picked from commit 2b50529)

# Conflicts:
#	programs/bpf/Cargo.lock
jackcmay added a commit that referenced this pull request Jun 2, 2021
* Add memory operation syscalls (#16447)

(cherry picked from commit 2b50529)

# Conflicts:
#	programs/bpf/Cargo.lock

* Resolve conflicts

Co-authored-by: Jack May <jack@solana.com>
@jackcmay jackcmay added the v1.6 label Jun 22, 2021
mergify bot pushed a commit that referenced this pull request Jun 22, 2021
(cherry picked from commit 2b50529)

# Conflicts:
#	programs/bpf/Cargo.lock
#	programs/bpf/rust/sysvar/tests/lib.rs
#	programs/bpf/tests/programs.rs
#	programs/bpf_loader/src/syscalls.rs
#	sdk/src/feature_set.rs
mergify bot added a commit that referenced this pull request Jun 22, 2021
* Add memory operation syscalls (#16447)

(cherry picked from commit 2b50529)

# Conflicts:
#	programs/bpf/Cargo.lock
#	programs/bpf/rust/sysvar/tests/lib.rs
#	programs/bpf/tests/programs.rs
#	programs/bpf_loader/src/syscalls.rs
#	sdk/src/feature_set.rs

* resolve conflicts

Co-authored-by: Jack May <jack@solana.com>
This was referenced Aug 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants