You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by GitBox <gi...@apache.org> on 2022/11/18 08:22:30 UTC

[GitHub] [trafficserver] masaori335 opened a new pull request, #9204: Use ts::shared_lock for ReplaceablePtr

masaori335 opened a new pull request, #9204:
URL: https://github.com/apache/trafficserver/pull/9204

   I have been running my own eBPF based mutex profiling tool. Recently a mutex lock shows up with the latest mater branch that I haven't seen before.
   
   ## Report from profiler
   ```
           mutex [unknown] ::: wait time 228741.80us ::: hold time 57441.78us ::: enter count 6754 ::: try-lock failure count 0
                   std::__1::mutex::lock()+0x6 [libc++.so.1.0] (7f31fb7347f6)
                   Cache::open_read(Continuation*, ats::CryptoHash const*, HTTPHdr*, OverridableHttpConfigParams const*, CacheFragType, char const*, int)+0x42 [traffic_server] (55dd98786a32)
                   CacheProcessor::open_read(Continuation*, HttpCacheKey const*, HTTPHdr*, OverridableHttpConfigParams const*, long, CacheFragType)+0x27 [traffic_server] (55dd9876b5c7)
                   HttpCacheSM::open_read(HttpCacheKey const*, URL*, HTTPHdr*, OverridableHttpConfigParams const*, long)+0x9d [traffic_server] (55dd985f9cad)
                   HttpSM::do_cache_lookup_and_read()+0x169 [traffic_server] (55dd985ec0d9)
   ```
   
   It looks like the `std::__1::mutex::lock` is called from `ReplaceablePtr<CacheHostTable>::ScopedReader` introduced by https://github.com/apache/trafficserver/pull/9046. 
   
   https://github.com/apache/trafficserver/blob/e37b35d79e4760d42c258a98a369c9ba827a5935/iocore/cache/Cache.cc#L3003-L3006
   
   It loosk like replacing `std::shared_lock` with `ts::shared_mutex` mitigates the issue. At least the profiler stoped complaining.
   
   


-- 
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: github-unsubscribe@trafficserver.apache.org

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


[GitHub] [trafficserver] SolidWallOfCode commented on pull request #9204: Use ts::shared_lock for ReplaceablePtr

Posted by GitBox <gi...@apache.org>.
SolidWallOfCode commented on PR #9204:
URL: https://github.com/apache/trafficserver/pull/9204#issuecomment-1320584686

   I wonder if it is because that workload is write heavy.


-- 
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: github-unsubscribe@trafficserver.apache.org

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


[GitHub] [trafficserver] masaori335 closed pull request #9204: Use ts::shared_lock for ReplaceablePtr

Posted by GitBox <gi...@apache.org>.
masaori335 closed pull request #9204: Use ts::shared_lock for ReplaceablePtr
URL: https://github.com/apache/trafficserver/pull/9204


-- 
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: github-unsubscribe@trafficserver.apache.org

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


[GitHub] [trafficserver] masaori335 commented on pull request #9204: Use ts::shared_lock for ReplaceablePtr

Posted by GitBox <gi...@apache.org>.
masaori335 commented on PR #9204:
URL: https://github.com/apache/trafficserver/pull/9204#issuecomment-1320610685

   Sorry, it looks like I tested with my messed working branch and misunderstood. If I look carefully, the call stack of the report doesn't match with the `Cache::key_to_vol`.
   
   #9040 seems fine.


-- 
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: github-unsubscribe@trafficserver.apache.org

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