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

Fix task_alignment for ARM #1386

Closed
wants to merge 8 commits into from
Closed

Conversation

blonded04
Copy link
Contributor

@blonded04 blonded04 commented May 23, 2024

Description

task_alignment seem to be (as git blame says) added to _task.h in 2019 when moving from TBB to oneTBB. However, it happens so that task_alignment is 64 bytes by default (x86 cacheline), which doesn't make any sense for ARM architectures with 128 bytes cacheline.

Fixes # - issue number(s) if exists

  • - 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

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

@@ -220,7 +224,11 @@ class alignas(task_alignment) task : public task_traits {
virtual task* cancel(execution_data&) = 0;

private:
#if __ARM_ARCH_7A__ || __aarch64__
std::uint64_t m_reserved[14]{};
Copy link
Contributor Author

Choose a reason for hiding this comment

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

i decided to put #if here, instead of (task_alignment - sizeof(void*) - sizeof(task_traits)) / sizeof(std::uint64_t), because it gets weird on architectures where pointer isn't 8 bytes? idk, this seems cleaner than it was before

@pavelkumbrasev
Copy link
Contributor

This patch might introduce backward compatibility problems so it should be carefully investigated.
Have you seen any performance improvements with this change?

@blonded04
Copy link
Contributor Author

This patch might introduce backward compatibility problems so it should be carefully investigated. Have you seen any performance improvements with this change?

I tried to come up with some benchmarks with different variations of system topology, however, no difference is spotted :(

@blonded04 blonded04 closed this May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants