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

Add task arena worker block time #1352

Merged
merged 3 commits into from
Apr 24, 2024
Merged

Add task arena worker block time #1352

merged 3 commits into from
Apr 24, 2024

Conversation

dnmokhov
Copy link
Contributor

Description

Add threading_control::is_any_other_client_active() to verify if other arenas are requesting workers.

Add hybrid CPU detection at initialization.

On non-hybrid CPUs, make workers block for 1ms before leaving the arena, unless

  • more work becomes available in the arena (⇒ unblock and stay in the arena);
  • other arenas are requesting workers (⇒ unblock and leave the arena immediately).

Fixes performance degradation on large systems when CPU power state demotion is disabled.

  • - git commit message contains an appropriate signed-off-by string (see CONTRIBUTING.md for details)

Type of change

Choose one or multiple, leave empty if none of the other choices apply

Add a respective label(s) to PR if you have permissions

  • bug fix - change that fixes an issue
  • new feature - change that adds functionality
  • tests - change in tests
  • infrastructure - change in infrastructure and CI
  • documentation - documentation update

Tests

  • added - required for new features and some bug fixes
  • not needed (done manually)

Documentation

  • updated in # - add PR number
  • needs to be updated
  • not needed

Breaks backward compatibility

  • Yes
  • No
  • Unknown

Notify the following users

List users with @ to send notifications

Other information

* Add `threading_control::is_any_other_client_active()` to verify if other arenas are requesting workers.
* Add hybrid CPU detection at initialization.
* On non-hybrid CPUs, make workers block for 1ms before leaving the arena, unless
  - more work becomes available in the arena (-> unblock and stay in the arena);
  - other arenas are requesting workers (-> unblock and leave the arena immediately).

Signed-off-by: Dmitri Mokhov <dmitri.n.mokhov@intel.com>
Signed-off-by: pavelkumbrasev <pavel.kumbrasev@intel.com>
Copy link
Contributor

@pavelkumbrasev pavelkumbrasev left a comment

Choose a reason for hiding this comment

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

Overall the patch looks good.

src/tbb/thread_request_serializer.cpp Show resolved Hide resolved
src/tbb/thread_request_serializer.h Outdated Show resolved Hide resolved
src/tbb/thread_dispatcher.cpp Outdated Show resolved Hide resolved
src/tbb/arena.cpp Outdated Show resolved Hide resolved
Copy link
Contributor

@pavelkumbrasev pavelkumbrasev left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Contributor

@isaevil isaevil left a comment

Choose a reason for hiding this comment

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

LGTM

@dnmokhov dnmokhov merged commit 92c8529 into master Apr 24, 2024
22 checks passed
@dnmokhov dnmokhov deleted the dev/dnmokhov/1 branch April 24, 2024 21:50
sarathnandu pushed a commit that referenced this pull request May 8, 2024
* Add `threading_control::is_any_other_client_active()` to verify if other arenas are requesting workers.
* Add hybrid CPU detection at initialization.
* On non-hybrid CPUs, make workers block for 1ms before leaving the arena, unless
  - more work becomes available in the arena (-> unblock and stay in the arena);
  - other arenas are requesting workers (-> unblock and leave the arena immediately).

Signed-off-by: Dmitri Mokhov <dmitri.n.mokhov@intel.com>
Signed-off-by: pavelkumbrasev <pavel.kumbrasev@intel.com>
(cherry picked from commit 92c8529)
sarathnandu added a commit that referenced this pull request May 8, 2024
* Increase yields multiplier on APPLE platforms
* Improve machine_pause on arm64
* Add task arena worker block time (#1352)
* Add hybrid CPU detection at initialization.
* Show patch version in the version string

Signed-off-by: pavelkumbrasev <pavel.kumbrasev@intel.com>
Signed-off-by: sarathnandu <sarath.nandu.ramachandran.nair@intel.com>
Signed-off-by: Isaev, Ilya ilya.isaev@intel.com
Signed-off-by: Dmitri Mokhov <dmitri.n.mokhov@intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants