• Krunal Bauskar's avatar
    MDEV-21212: buf_page_get_gen -> buf_pool->stat.n_page_gets++ is a cpu waste · 8d4e3ec2
    Krunal Bauskar authored
    n_page_gets is a global counter that is updated on each page access.
    This also means it is updated pretty often and with a multi-core machine
    it easily boils up to be the hottest counter as also reported by perf.
    
    Using existing distributed counter framework help ease the contention
    and improve the performance.
    
    Patch also tend to increase the slot of the distributed counter from original
    64 to 128 given that is new normal for next-generation machines.
    
    The original idea and patch came from Daniel Black which is now ported
    to 10.6 with some improvement and adjustment.
    8d4e3ec2
btr0sea.cc 59.5 KB