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

Disable folly memcpy as default memcpy #5996

Merged
merged 3 commits into from
Sep 22, 2022
Merged

Conversation

solotzg
Copy link
Contributor

@solotzg solotzg commented Sep 22, 2022

What problem does this PR solve?

Issue Number: close #5949

Problem Summary:

since #5834

MemUtils benchmark show that __folly_memcpy is not friendly
When memory size > 32K(L1 cache size) and both address are aligned to 32, __folly_memcpy will use non-temporal way(mark data unlikely to be used again soon) to minimize caching. It causes big performance regression.

.L_NON_TEMPORAL_LOOP:
testb $31, %sil
jne .L_ALIGNED_DST_LOOP
// This is prefetching the source data unlike ALIGNED_DST_LOOP which
// prefetches the destination data. This choice is again informed by
// benchmarks. With a non-temporal store the entirety of the cache line
// is being written so the previous data can be discarded without being
// fetched.
prefetchnta 128(%rsi)
prefetchnta 196(%rsi)
vmovntdqa (%rsi), %ymm0
vmovntdqa 32(%rsi), %ymm1
vmovntdqa 64(%rsi), %ymm2
vmovntdqa 96(%rsi), %ymm3
add $128, %rsi
vmovntdq %ymm0, (%rdi)
vmovntdq %ymm1, 32(%rdi)
vmovntdq %ymm2, 64(%rdi)
vmovntdq %ymm3, 96(%rdi)
add $128, %rdi
cmp %r8, %rsi
jb .L_NON_TEMPORAL_LOOP

What is changed and how it works?

For b232bcd, the result is

20220922,constant,incremental,0.49,200478,1747997

Before this PR

+ ./tiflash dtworkload --write_key_distribution=incremental --verify_round=20
20220922,constant,incremental,0.53,188916,1720491

After this PR

+ ./tiflash dtworkload --write_key_distribution=incremental --verify_round=20
20220922,constant,incremental,0.44,207025,1685328

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

None

@solotzg solotzg added type/enhancement The issue or PR belongs to an enhancement. type/bugfix This PR fixes a bug. needs-cherry-pick-release-6.3 labels Sep 22, 2022
@solotzg solotzg self-assigned this Sep 22, 2022
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Sep 22, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • JinheLin
  • zanmato1984

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/needs-triage-completed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Sep 22, 2022
@solotzg solotzg requested a review from JinheLin September 22, 2022 07:43
@JinheLin
Copy link
Contributor

LGTM

Copy link
Contributor

@zanmato1984 zanmato1984 left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Sep 22, 2022
@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Sep 22, 2022
@JinheLin
Copy link
Contributor

/merge

@ti-chi-bot
Copy link
Member

@JinheLin: It seems you want to merge this PR, I will help you trigger all the tests:

/run-all-tests

You only need to trigger /merge once, and if the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

If you have any questions about the PR merge process, please refer to pr process.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 4dccd63

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Sep 22, 2022
@solotzg
Copy link
Contributor Author

solotzg commented Sep 22, 2022

/hold

@ti-chi-bot ti-chi-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 22, 2022
@solotzg
Copy link
Contributor Author

solotzg commented Sep 22, 2022

/merge

@ti-chi-bot
Copy link
Member

@solotzg: It seems you want to merge this PR, I will help you trigger all the tests:

/run-all-tests

You only need to trigger /merge once, and if the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

If you have any questions about the PR merge process, please refer to pr process.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@solotzg
Copy link
Contributor Author

solotzg commented Sep 22, 2022

/unhold

@ti-chi-bot ti-chi-bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 22, 2022
@sre-bot
Copy link
Collaborator

sre-bot commented Sep 22, 2022

Coverage for changed files

no c/c++ source change detected

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
18710      7920             57.67%    218347  81796        62.54%

full coverage report (for internal network access only)

@ti-chi-bot ti-chi-bot merged commit bd16255 into pingcap:master Sep 22, 2022
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created: #6001.

@sre-bot
Copy link
Collaborator

sre-bot commented Sep 22, 2022

Coverage for changed files

no c/c++ source change detected

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
18850      8116             56.94%    218924  83416        61.90%

full coverage report (for internal network access only)

@solotzg solotzg deleted the fix-memcpy branch September 22, 2022 08:49
ti-chi-bot added a commit that referenced this pull request Sep 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-cherry-pick-release-6.3 release-note-none Denotes a PR that doesn't merit a release note. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. type/bugfix This PR fixes a bug. type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The stress performance test result of dtworkload-incremental workload-write speed drop more than 10%
5 participants