masaori335 commented on code in PR #13328:
URL: https://github.com/apache/trafficserver/pull/13328#discussion_r3576051376


##########
src/iocore/cache/Stripe.cc:
##########
@@ -153,15 +154,22 @@ Stripe::_init_directory(std::size_t directory_size, int 
header_size, int footer_
 
   Dbg(dbg_ctl_cache_init, "Stripe %s: allocating %zu directory bytes for a 
%lld byte volume (%lf%%)", hash_text.get(),
       directory_size, (long long)this->len, percent(directory_size, 
this->len));
-  if (ats_hugepage_enabled()) {
-    this->directory.raw_dir = static_cast<char 
*>(ats_alloc_hugepage(directory_size));
-    if (this->directory.raw_dir != nullptr) {
-      this->directory.raw_dir_huge = true;
-    }
-  }
-  if (nullptr == this->directory.raw_dir) {
-    this->directory.raw_dir      = static_cast<char 
*>(ats_memalign(ats_pagesize(), directory_size));
+  // Try a shared-memory-backed directory first; fall back to the hugepage /
+  // aligned-heap path when shm is disabled or the attach/create fails.
+  this->directory.raw_dir = CacheShm::attach_or_create_stripe(hash_text.get(), 
directory_size);

Review Comment:
   Addressed by 161f39c7b282933fae3596666f1452538407a448



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to