buffer pool has latches that protect access to pages.
there is a latch per N pages.
(check page_hash_table for more details)
N is calculated based on the cacheline size.
for example: if cacheline size is
: 64 then 7 pages pointers + 1 latch can be hosted on the same cacheline
: 128 then 15 pages pointers + 1 latch can be hosted on the same cacheline
arm generally have wider cacheline so with arm 1 latch is used
to access 15 pages vs with x86 1 latch is used to access 7 pages.
Naturally, the contention is more with arm case.
said patch help relax this contention by limiting the elements
per cacheline to 7 (+ 1 latch slot).
for wider-cacheline (say 128), the remaining 8 slots are kept empty.
this ensures there are no 2 latches on the same cacheline to avoid
latch level contention.
----------
Said patch has shown improvement in performance in range of 2-5%.
I see that the cache line size is 128 bytes also on POWER, and 256 bytes on s390x. I hope that danblack can assess the performance impact on those architectures.
In 10.6, there is also lock_sys_t::hash_table::ELEMENTS_PER_LATCH that we may want to change in the same way.
This change would not affect AMD64 or IA-32 or other systems where the cache line size is 64 bytes.
Marko Mäkelä
added a comment - I see that the cache line size is 128 bytes also on POWER, and 256 bytes on s390x. I hope that danblack can assess the performance impact on those architectures.
In 10.6, there is also lock_sys_t::hash_table::ELEMENTS_PER_LATCH that we may want to change in the same way.
This change would not affect AMD64 or IA-32 or other systems where the cache line size is 64 bytes.
As suggested, I tried extending the patch to lock_sys::hash_table and continued to observe a performance difference. Improvement for read-write is 5-6%. Check the attached graph.
Krunal Bauskar
added a comment - As suggested, I tried extending the patch to lock_sys::hash_table and continued to observe a performance difference. Improvement for read-write is 5-6%. Check the attached graph.
People
Marko Mäkelä
Krunal Bauskar
Votes:
0Vote for this issue
Watchers:
2Start watching this issue
Dates
Created:
Updated:
Resolved:
Git Integration
Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.
{"report":{"fcp":7497.699999988079,"ttfb":6533.0999999940395,"pageVisibility":"visible","entityId":102755,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0,"journeyId":"a487da91-4ab6-4492-bbef-ee8221b21c40","navigationType":0,"readyForUser":7553.299999982119,"redirectCount":0,"resourceLoadedEnd":7380.299999982119,"resourceLoadedStart":6556.199999988079,"resourceTiming":[{"duration":162.90000000596046,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":6556.199999988079,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":6556.199999988079,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":6719.0999999940395,"responseStart":0,"secureConnectionStart":0},{"duration":163.19999998807907,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/2bf333562ca6724060a9d5f1535471f6/_/download/contextbatch/css/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":6556.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":6556.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":6719.699999988079,"responseStart":0,"secureConnectionStart":0},{"duration":338.69999998807907,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":6556.699999988079,"connectEnd":6556.699999988079,"connectStart":6556.699999988079,"domainLookupEnd":6556.699999988079,"domainLookupStart":6556.699999988079,"fetchStart":6556.699999988079,"redirectEnd":0,"redirectStart":0,"requestStart":6556.699999988079,"responseEnd":6895.399999976158,"responseStart":6895.399999976158,"secureConnectionStart":6556.699999988079},{"duration":298,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/2bf333562ca6724060a9d5f1535471f6/_/download/contextbatch/js/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true","startTime":6556.899999976158,"connectEnd":6556.899999976158,"connectStart":6556.899999976158,"domainLookupEnd":6556.899999976158,"domainLookupStart":6556.899999976158,"fetchStart":6556.899999976158,"redirectEnd":0,"redirectStart":0,"requestStart":6556.899999976158,"responseEnd":6854.899999976158,"responseStart":6854.899999976158,"secureConnectionStart":6556.899999976158},{"duration":168,"initiatorType":"script","name":"https://jira.mariadb.org/s/a9324d6758d385eb45c462685ad88f1d-CDN/lu2cib/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":6557.0999999940395,"connectEnd":6557.0999999940395,"connectStart":6557.0999999940395,"domainLookupEnd":6557.0999999940395,"domainLookupStart":6557.0999999940395,"fetchStart":6557.0999999940395,"redirectEnd":0,"redirectStart":0,"requestStart":6557.0999999940395,"responseEnd":6725.0999999940395,"responseStart":6725.0999999940395,"secureConnectionStart":6557.0999999940395},{"duration":181.2999999821186,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":6557.0999999940395,"connectEnd":6557.0999999940395,"connectStart":6557.0999999940395,"domainLookupEnd":6557.0999999940395,"domainLookupStart":6557.0999999940395,"fetchStart":6557.0999999940395,"redirectEnd":0,"redirectStart":0,"requestStart":6557.0999999940395,"responseEnd":6738.399999976158,"responseStart":6738.399999976158,"secureConnectionStart":6557.0999999940395},{"duration":363.30000001192093,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":6557.299999982119,"connectEnd":6557.299999982119,"connectStart":6557.299999982119,"domainLookupEnd":6557.299999982119,"domainLookupStart":6557.299999982119,"fetchStart":6557.299999982119,"redirectEnd":0,"redirectStart":0,"requestStart":6557.299999982119,"responseEnd":6920.5999999940395,"responseStart":6920.5999999940395,"secureConnectionStart":6557.299999982119},{"duration":373.09999999403954,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2cib/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":6557.5999999940395,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":6557.5999999940395,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":6930.699999988079,"responseStart":0,"secureConnectionStart":0},{"duration":372.69999998807907,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":6557.699999988079,"connectEnd":6557.699999988079,"connectStart":6557.699999988079,"domainLookupEnd":6557.699999988079,"domainLookupStart":6557.699999988079,"fetchStart":6557.699999988079,"redirectEnd":0,"redirectStart":0,"requestStart":6557.699999988079,"responseEnd":6930.399999976158,"responseStart":6930.399999976158,"secureConnectionStart":6557.699999988079},{"duration":373.09999999403954,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/css/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.css?jira.create.linked.issue=true","startTime":6557.799999982119,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":6557.799999982119,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":6930.899999976158,"responseStart":0,"secureConnectionStart":0},{"duration":387,"initiatorType":"script","name":"https://jira.mariadb.org/s/5d5e8fe91fbc506585e83ea3b62ccc4b-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/js/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.js?jira.create.linked.issue=true&locale=en","startTime":6558.0999999940395,"connectEnd":6558.0999999940395,"connectStart":6558.0999999940395,"domainLookupEnd":6558.0999999940395,"domainLookupStart":6558.0999999940395,"fetchStart":6558.0999999940395,"redirectEnd":0,"redirectStart":0,"requestStart":6558.0999999940395,"responseEnd":6945.0999999940395,"responseStart":6945.0999999940395,"secureConnectionStart":6558.0999999940395},{"duration":483.7999999821186,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":6559.0999999940395,"connectEnd":6559.0999999940395,"connectStart":6559.0999999940395,"domainLookupEnd":6559.0999999940395,"domainLookupStart":6559.0999999940395,"fetchStart":6559.0999999940395,"redirectEnd":0,"redirectStart":0,"requestStart":6559.0999999940395,"responseEnd":7042.899999976158,"responseStart":7042.899999976158,"secureConnectionStart":6559.0999999940395},{"duration":817.0999999940395,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":6563.199999988079,"connectEnd":6563.199999988079,"connectStart":6563.199999988079,"domainLookupEnd":6563.199999988079,"domainLookupStart":6563.199999988079,"fetchStart":6563.199999988079,"redirectEnd":0,"redirectStart":0,"requestStart":6563.199999988079,"responseEnd":7380.299999982119,"responseStart":7380.299999982119,"secureConnectionStart":6563.199999988079},{"duration":307,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":7192.5999999940395,"connectEnd":7192.5999999940395,"connectStart":7192.5999999940395,"domainLookupEnd":7192.5999999940395,"domainLookupStart":7192.5999999940395,"fetchStart":7192.5999999940395,"redirectEnd":0,"redirectStart":0,"requestStart":7192.5999999940395,"responseEnd":7499.5999999940395,"responseStart":7499.5999999940395,"secureConnectionStart":7192.5999999940395},{"duration":300,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":7446.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":7446.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":7746.5,"responseStart":0,"secureConnectionStart":0}],"fetchStart":1,"domainLookupStart":220,"domainLookupEnd":6357,"connectStart":6358,"connectEnd":6377,"secureConnectionStart":6366,"requestStart":6377,"responseStart":6534,"responseEnd":6559,"domLoading":6555,"domInteractive":7682,"domContentLoadedEventStart":7683,"domContentLoadedEventEnd":7744,"domComplete":8002,"loadEventStart":8002,"loadEventEnd":8003,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":7651.199999988079},{"name":"bigPipe.sidebar-id.end","time":7652.199999988079},{"name":"bigPipe.activity-panel-pipe-id.start","time":7652.199999988079},{"name":"bigPipe.activity-panel-pipe-id.end","time":7653.5999999940395},{"name":"activityTabFullyLoaded","time":7758.299999982119}],"measures":[],"correlationId":"62710327f93430","effectiveType":"4g","downlink":9.5,"rtt":0,"serverDuration":100,"dbReadsTimeInMs":10,"dbConnsTimeInMs":18,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
patch submitted through the pr: https://github.com/MariaDB/server/pull/1910