This is an automated email from the ASF dual-hosted git repository. joemcdonnell pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/impala.git
commit 071d176180807c1d5a5678a036af6d8e63770ed9 Author: Eyizoha <[email protected]> AuthorDate: Mon Dec 2 18:55:14 2024 +0800 IMPALA-13590: Use CacheLineAligned instead of CACHELINE_ALIGNED for PerFilterState Currently, class PerFilterState is marked with CACHELINE_ALIGNED, which is actually a macro definition of __attribute__((aligned())). For static allocation, it can specify memory alignment, but it cannot specify alignment for dynamic memory allocation. In the code, all PerFilterState objects are dynamically created using make_unique in the function RuntimeFilterBank::BuildFilterMap(), so CACHELINE_ALIGNED does not really have any effect. It might even lead to unexpected situations as described in the JIRA comments. Therefore, this patch replaces CACHELINE_ALIGNED with CacheLineAligned, which supports alignment for dynamic memory allocation. Testing: - Existing tests cover this change. Change-Id: I0d119679b1d446cb69f6eec595def2d40cb6d1ff Reviewed-on: http://gerrit.cloudera.org:8080/22147 Reviewed-by: Impala Public Jenkins <[email protected]> Tested-by: Impala Public Jenkins <[email protected]> --- be/src/runtime/runtime-filter-bank.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/be/src/runtime/runtime-filter-bank.h b/be/src/runtime/runtime-filter-bank.h index d013a15ab..c87cbfd4d 100644 --- a/be/src/runtime/runtime-filter-bank.h +++ b/be/src/runtime/runtime-filter-bank.h @@ -262,7 +262,7 @@ class RuntimeFilterBank { /// all created when the filter bank is initialized. Each filter state can be locked /// separately to help with scalability. Aligned so that each lock is on a separate /// cache line. - struct PerFilterState { + struct PerFilterState : public CacheLineAligned { /// pending_producers: the number of producers that will call UpdateFilterFromLocal(). /// result_filter: the initial filter that will be returned to producers. Non-NULL if /// there are any producers. Must be owned by 'obj_pool_'. @@ -297,7 +297,7 @@ class RuntimeFilterBank { /// Contains references to all the in-list filters generated. Used in Close() to /// safely release all memory allocated for InListFilters. vector<InListFilter*> in_list_filters; - } CACHELINE_ALIGNED; + }; /// Object pool for objects that will be freed in Close(), e.g. allocated filters. ObjectPool obj_pool_;
