-
Notifications
You must be signed in to change notification settings - Fork 447
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
[VL] Following #6526, minor fixes and improvements #6554
Conversation
Thanks for opening a pull request! Could you open an issue for this pull request on Github Issues? https://github.com/apache/incubator-gluten/issues Then could you also rename commit message and pull request title in the following format?
See also: |
cpp/core/memory/AllocationListener.h
Outdated
@@ -87,11 +73,28 @@ class BlockAllocationListener final : public AllocationListener { | |||
} | |||
|
|||
private: | |||
int64_t reserve(int64_t 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.
add inline
if (peakBytes_.compare_exchange_weak(savedPeakBytes, usedBytes_)) { | ||
break; | ||
} | ||
} |
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.
With C++26 in future, we can use fetch_max directly. https://en.cppreference.com/w/cpp/atomic/atomic/fetch_max
if (peakBytes_.compare_exchange_weak(savedPeakBytes, usedBytes_)) { | ||
break; | ||
} | ||
} |
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.
With C++26 in future, we can use fetch_max directly. https://en.cppreference.com/w/cpp/atomic/atomic/fetch_max
* [GLUTEN-6501][VL] Fix the missing fileReadProperties when constructing a LocalFilesNode (#6503) * [GLUTEN-6477][VL] Fix occasional dead lock during spilling (#6515) * [VL] Add thread_safe to several VeloxRuntime classes (#6526) VeloxRuntime is shared by many threads, like task threads or parquet writter threads. We must make sure the objects hold by VeloxRuntime are thread safe. * [VL] Following #6526, minor fixes and improvements (#6554) --------- Co-authored-by: zhaokuo <[email protected]> Co-authored-by: Hongze Zhang <[email protected]> Co-authored-by: BInwei Yang <[email protected]>
A follow-up to #6526
diff < 0
anddiff > 0
so simplifies codepeakBytes_.store(std::max(peakBytes_.load(), usedBytes_.load()))
is still not atomic so needs to be locked