You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "xinyiZzz (via GitHub)" <gi...@apache.org> on 2023/05/17 01:30:52 UTC

[GitHub] [doris] xinyiZzz commented on a diff in pull request #19639: [improvement](storage) let the `storage_page_cache_shard_size` conf be rounded up to a power of two

xinyiZzz commented on code in PR #19639:
URL: https://github.com/apache/doris/pull/19639#discussion_r1195834269


##########
be/src/runtime/exec_env_init.cpp:
##########
@@ -230,6 +230,17 @@ Status ExecEnv::_init_mem_env() {
     }
     int32_t index_percentage = config::index_page_cache_percentage;
     uint32_t num_shards = config::storage_page_cache_shard_size;
+    if ((num_shards & (num_shards - 1)) != 0) {
+        int old_num_shards = num_shards;
+        num_shards = 1;
+        while (num_shards < old_num_shards) {
+            num_shards <<= 1;

Review Comment:
   But on BE, we have `BitUtil::RoundUpToPowerOfTwo` to complete the round



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org