# CAL: Core-Aware Lock for the big.LITTLE Multicore Architecture
## 4 Experiment
### Micro-Benchmarks  
We conducted two sets of benchmarks to evaluate the performance of CAL across a series of workload scenarios. **A benchmark with high contentions:** First, we conduct a benchmark with a fixed high contention level, which is representative of the most prevalent and critical contention levels encountered in lock-intensive multithreaded applications and is pivotal for assessing the effectiveness of lock algorithms. We used all cores (six big cores and four little cores) to run the threads competing for a shared lock to execute four distinct critical sections with varying lengths. Each critical section manipulated a predefined number of rows within the shared cache. In order to emulate the execution of non-critical section operations, we inserted a constant quantity of 12,000 non instructions between every pair of lock acquisitions. In this section, we selected five classical lock algorithms to compare with CAL. * Ticket lock [21]. This lock algorithm embodies the FIFO locking. Big core and little core acquire lock in FIFO order. * Pthread lock [22], dettas [8], and spinlock [8; 23]. These lock algorithms are competition-based locks. The big or little core competes for the lock in an unpredictable behavior. * Cptltkt lock [10]. This lock algorithm implements the cohort locks, comprising a global partitioned ticket lock and a local ticket lock mechanism. The fairness results are shown in Figure 6(a). In high contention runtime, CAL can maintain a high fairness of nearly 0.96, while the fairness of other locks is as low as 0.53. Figure 6(b) shows the throughput and latency results. Compared with FIFO-based ticket lock, CAL exhibits a commendable improvement with a 7.5% higher throughput while concurrently maintaining a lower tail latency. As for three competition-based locks, ttas shows big-core-friendly (i.e., the success rate of atomic operation on big cores is much higher), so its throughput is the highest. However, this advantage comes at the cost of unignorable tail latency compared to CAL. Both pthread lock and spinlock lock \begin{table}
\begin{tabular}{l l} \hline \hline
**Property** & **Parameter** \\ \hline Processor & 13 th Gen Intel(R) Core(TM) i5-13400 \\ OS & Ubuntu: 20.04 \\ Linux Kernel & Linux 5.15.0-89-generic \\ Glibc & 2.31 \\ Gcc & 9.4.0 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Configuration of server. \begin{table}
\begin{tabular}{l l} \hline \hline
**Property** & **Value** \\ \hline Total cores & 10 \\ Number of performance-cores & 6 \\ Linux Kernel & Linux 5.15.0-89-generic \\ Number of efficient-cores & 4 \\ Performance-core base frequency & 2.50 GHz \\ Efficient-core base frequency & 1.80 GHz \\ \hline \hline \end{tabular}
\end{table} 
Table 2: CPU parameters. show little-core-friendly, which leads to a collapse of throughput and latency. Given that our experimental environment comprises only a single NUMA node, the global lock component within the hierarchical lock (cptltkt) does not achieve its full potential; hence, its performance is comparable to that of the local ticket lock. **A benchmark with variant contentions:** Secondly, we conduct a benchmark test under variable contention conditions to emulate the dynamic nature of contention levels that typically vary with time and workload in real-world scenarios. In this benchmark test, we gradually increased the number of threads from 1 to 10, simulating the transition from mild contention level to high contention level. The results are shown in Figure 8. Figure 8 shows the variation in fairness across different contention levels. When running on the first six big cores, FIFO locks have the highest fairness. Meanwhile, the three locks based on competition can maintain a relatively high fairness due to an approximately equal success rate for atomic operations. However, as the workload expands to use little cores, these lock algorithms face fairness issue, while CAL consistently sustains a relatively high fairness. The throughput and latency results are shown in Figure 8 and Figure 8, respectively.