-
Notifications
You must be signed in to change notification settings - Fork 225
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
bring loong64 support #154
base: develop
Are you sure you want to change the base?
Conversation
The purpose of this is to be portable to more architectures. Signed-off-by: Guoqi Chen <[email protected]>
go get -d golang.org/x/sys@latest go mod tidy This brings in loong64 support. Signed-off-by: Guoqi Chen <[email protected]>
go version go1.19 linux/loong64
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
非常感谢你的贡献!
总体来看没有大问题,不过我们没有龙芯的环境因此无法进行测试。
还有两个小问题需要确认一下。
@@ -0,0 +1,90 @@ | |||
// Copyright 2022 Loongson Inc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
要不改成这样"Copyright 2022 Loongson Inc. and ByteDance Inc."避免一下后续的法务风险?
@@ -0,0 +1,88 @@ | |||
// Copyright 2022 Loongson Inc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里也是
@@ -131,6 +131,8 @@ type pointerSCQ struct { | |||
type scqNodePointer struct { | |||
flags uint64 // isSafe 1-bit + isEmpty 1-bit + cycle 62-bit | |||
data unsafe.Pointer | |||
_ sync.Mutex // Only for architectures that do not support 128bit atomic operations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里增加两个字段,把 scqNodePointer 的长度从 128 增加到了 256,会不会影响 cacheline 的利用进而影响性能? @zhangyunhao116
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, added a comment below :)
@@ -131,6 +131,8 @@ type uint64SCQ struct { | |||
type scqNodeUint64 struct { | |||
flags uint64 // isSafe 1-bit + isEmpty 1-bit + cycle 62-bit | |||
data uint64 | |||
_ sync.Mutex // Only for architectures that do not support 128bit atomic operations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we don't need to support architectures that don't support 128-bit CAS. Adding a sync.Mutex
usually comes with performance losses. It would be nice if you could run the benchmark to see the diff :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing this work!
The main concern I have is that loong64 doesn't support 128-bit CAS. I'm not familiar with loong64. Is there any way to support this instruction?
Signed-off-by: Guoqi Chen <[email protected]>
No description provided.