Skip to content

bthread: fix simd memory align issue#3092

Merged
chenBright merged 1 commit intoapache:masterfrom
icexin:simd_mem_align
Sep 15, 2025
Merged

bthread: fix simd memory align issue#3092
chenBright merged 1 commit intoapache:masterfrom
icexin:simd_mem_align

Conversation

@icexin
Copy link
Copy Markdown
Contributor

@icexin icexin commented Sep 15, 2025

What problem does this PR solve?

Issue Number: Fix #3091

Problem Summary: 对入参使用 BAIDU_CACHELINE_ALIGNMENT 进行修饰,确保内存对齐

What is changed and the side effects?

Changed:

Side effects:

  • Performance effects:

  • Breaking backward compatibility:


Check List:

@wwbmmm wwbmmm requested a review from chenBright September 15, 2025 10:46
Copy link
Copy Markdown
Contributor

@chenBright chenBright left a comment

Choose a reason for hiding this comment

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

Value加上BAIDU_CACHELINE_ALIGNMENT,按64字节对齐能解决问题吗?

@icexin
Copy link
Copy Markdown
Contributor Author

icexin commented Sep 15, 2025

没有看到 _value 已经用 BAIDU_CACHELINE_ALIGNMENT 修饰了。对参数里面的 value 使用 BAIDU_CACHELINE_ALIGNMENT 修饰后不core了,我重新提交一下代码

@chenBright
Copy link
Copy Markdown
Contributor

没有看到 _value 已经用 BAIDU_CACHELINE_ALIGNMENT 修饰了。对参数里面的 value 使用 BAIDU_CACHELINE_ALIGNMENT 修饰后不core了,我重新提交一下代码

Value BAIDU_CACHELINE_ALIGNMENT _value{};

@chenBright
Copy link
Copy Markdown
Contributor

struct BAIDU_CACHELINE_ALIGNMENT Value {
    int64_t v1;
    int64_t v2;
};

这样能解决问题吗?

@chenBright
Copy link
Copy Markdown
Contributor

Macos ci problems haven been fixed in #3093. Please update and rebase master.

@icexin
Copy link
Copy Markdown
Contributor Author

icexin commented Sep 15, 2025

BAIDU_CACHELINE_ALIGNMENT

可以的

Copy link
Copy Markdown
Contributor

@chenBright chenBright left a comment

Choose a reason for hiding this comment

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

LGTM

@chenBright chenBright merged commit 3fed883 into apache:master Sep 15, 2025
16 checks passed
@icexin icexin deleted the simd_mem_align branch September 15, 2025 12:27
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.

core on memory align for SIMD

2 participants