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 debug preemption in x86_64 #11792

Open
wants to merge 1 commit into
base: 3.0-dev
Choose a base branch
from

Conversation

rlmenge
Copy link
Contributor

@rlmenge rlmenge commented Jan 6, 2025

Merge Checklist

All boxes should be checked before merging the PR (just tick any boxes which don't apply to this PR)

  • The toolchain has been rebuilt successfully (or no changes were made to it)
  • The toolchain/worker package manifests are up-to-date
  • Any updated packages successfully build (or no packages were changed)
  • Packages depending on static components modified in this PR (Golang, *-static subpackages, etc.) have had their Release tag incremented.
  • Package tests (%check section) have been verified with RUN_CHECK=y for existing SPEC files, or added to new SPEC files
  • All package sources are available
  • cgmanifest files are up-to-date and sorted (./cgmanifest.json, ./toolkit/scripts/toolchain/cgmanifest.json, .github/workflows/cgmanifest.json)
  • LICENSE-MAP files are up-to-date (./LICENSES-AND-NOTICES/SPECS/data/licenses.json, ./LICENSES-AND-NOTICES/SPECS/LICENSES-MAP.md, ./LICENSES-AND-NOTICES/SPECS/LICENSE-EXCEPTIONS.PHOTON)
  • All source files have up-to-date hashes in the *.signatures.json files
  • sudo make go-tidy-all and sudo make go-test-coverage pass
  • Documentation has been updated to match any changes to the build system
  • Ready to merge

Summary

Performance improvement.

In 6.1, the recommended default for DEBUG_PREEMPT was y. However, this led to performance hits and overhead due to frequent calls to __this_cpu_preempt_check().

The defualt was later changed in "[cc60039] lib/Kconfig.debug: do not enable DEBUG_PREEMPT by default".

Therefore, go with new recommeded default to improve performance.
Kconfig

Change Log
  • Disable debug preemption in x86_64
Does this affect the toolchain?

YES

Associated issues
Test Methodology

Tested it booted on an Azure Standard_D96ps_v6 (ARM64) and Standard_D8s_v4 (x86_64)

Additionally, saw improved perf results without DEBUG_PREEPMT

Results with 6.6.57.1-6 (currently published)

azureuser@mariner-vm-StandardD8sv4-1 [ ~ ]$ perf bench sched messaging -g 16 -l 1000
# Running 'sched/messaging' benchmark:
# 20 sender and receiver processes per group
# 16 groups == 640 processes run

     Total time: 3.285 [sec]
azureuser@mariner-vm-StandardD8sv4-1 [ ~ ]$ perf bench sched pipe
# Running 'sched/pipe' benchmark:
# Executed 1000000 pipe operations between two processes

     Total time: 21.453 [sec]

      21.453281 usecs/op
          46612 ops/sec

With 6.6.64.2-2 with DEBUG_PREEMPT

azureuser@mariner-vm-StandardD8sv4-1 [ ~ ]$ uname -a
Linux mariner-vm-StandardD8sv4-1 6.6.64.2-2.azl3 #1 SMP PREEMPT_DYNAMIC Thu Jan 16 05:20:03 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
azureuser@mariner-vm-StandardD8sv4-1 [ ~ ]$ perf bench sched messaging -g 16 -l 1000
# Running 'sched/messaging' benchmark:
# 20 sender and receiver processes per group
# 16 groups == 640 processes run

     Total time: 3.315 [sec]
azureuser@mariner-vm-StandardD8sv4-1 [ ~ ]$ perf bench sched pipe
# Running 'sched/pipe' benchmark:
# Executed 1000000 pipe operations between two processes

     Total time: 21.731 [sec]

      21.731123 usecs/op
          46016 ops/sec

With 6.6.64.2 without DEBUG_PREEMPT - improvement by ~10%

azureuser@mariner-vm-StandardD8sv4-1 [ ~ ]$ perf bench sched messaging -g 16 -l 1000
# Running 'sched/messaging' benchmark:
# 20 sender and receiver processes per group
# 16 groups == 640 processes run

     Total time: 2.997 [sec]

azureuser@mariner-vm-StandardD8sv4-1 [ ~ ]$ perf bench sched pipe
# Running 'sched/pipe' benchmark:
# Executed 1000000 pipe operations between two processes

     Total time: 20.782 [sec]

      20.782934 usecs/op
          48116 ops/sec

@rlmenge rlmenge added stable-release-shiproom PRs for consideration for stable shiproom 3.0-dev PRs Destined for AzureLinux 3.0 labels Jan 6, 2025
@rlmenge rlmenge force-pushed the rlmenge/3.0/kernel/debug_preempt branch 2 times, most recently from b0b2c6e to d568138 Compare January 16, 2025 01:18
In 6.1, the recommended default for DEBUG_PREEMPT was y. However,
this led to performance hits and overhead due to frequent calls
to __this_cpu_preempt_check().

The defualt was later changed in "[cc60039] lib/Kconfig.debug:
do not enable DEBUG_PREEMPT by default".

Therefore, go with new recommeded default to improve performance.
@rlmenge rlmenge force-pushed the rlmenge/3.0/kernel/debug_preempt branch from d568138 to 32db886 Compare January 16, 2025 01:30
@rlmenge rlmenge marked this pull request as ready for review January 16, 2025 02:53
@rlmenge rlmenge requested a review from a team as a code owner January 16, 2025 02:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.0-dev PRs Destined for AzureLinux 3.0 Packaging stable-release-shiproom PRs for consideration for stable shiproom
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant