## 2 Technological Background and Related Work
### The Kernel-Based Memory-Aware Load Balancing (kMLB) Mechanism
* Most Benefit (MB) Policy selects the task in the source core’s runqueue that can reduce the maximum amount of remote memory access when migrated. This policy considers the memory that is occupied by each task on the source and destination nodes. The task with the maximum difference is selected. The following metric is used to select the target task with the maximum value, in which RSS\(p\)(i) is the RSS value for task \(p\) on NUMA node \(i\) and _dest_node_ and _src_node_ are the IDs for the destination and source NUMA nodes, respectively: \[\text{MB}_{p}=\text{RSS}_{p}(\textit{dest\_node})-\text{RSS}_{p}(\textit{src\_ node})\]
* Best Cost-Effectiveness (BCE) Policy selects the task in the source core’s runqueue for which inter-node migration is the most cost-effective. Based on the MB policy, the BCE policy also considers the maximum cost of page migration, which is the amount of memory occupied by one task on the source node. The selected task is the one that can reduce the maximum remote memory access relative to the maximum migration  
\begin{table} \begin{tabular}{c c c c c} \hline \hline \multirow{2}{*}{**Policy**} & \multicolumn{3}{c}{**Tasks Waiting in the Source Core’s Runqueue**} & \multirow{2}{*}{**Selected Task**} \\ \cline{2-2} \cline{4-5}  & **Task\#3** & **Task\#9** & **Task\#10** & \\ \hline First-Fit & N/A & N/A & N/A & Task\#3 \\ TM & \(3+7=10\) & \(3+3=6\) & \(5+10=15\) & Task\#9 \\ MB & \(7-3=4\) & \(3-3=0\) & \(10-5=5\) & Task\#10 \\ BCE & \((7-3)/3=1.333\) & \((3-3)/3=0\) & \((10-5)/5=1\) & Task\#3 \\ \hline \hline \end{tabular}   
* Total Min (TM) Policy [3] selects the task in the source core’s runqueue with the minimal total memory size. It is possible to have the least influence caused by task migration since the selected one occupies the least amount of memory for access after migration. * Most Benefit (MB) Policy selects the task in the source core’s runqueue that can reduce the maximum amount of remote memory access when migrated. This policy considers the memory that is occupied by each task on the source and destination nodes. The task with the maximum difference is selected. The following metric is used to select the target task with the maximum value, in which RSS\(p\)(i) is the RSS value for task \(p\) on NUMA node \(i\) and _dest_node_ and _src_node_ are the IDs for the destination and source NUMA nodes, respectively: \[\text{MB}_{p}=\text{RSS}_{p}(\textit{dest\_node})-\text{RSS}_{p}(\textit{src\_ node})\]
* Best Cost-Effectiveness (BCE) Policy selects the task in the source core’s runqueue for which inter-node migration is the most cost-effective. Based on the MB policy, the BCE policy also considers the maximum cost of page migration, which is the amount of memory occupied by one task on the source node. The selected task is the one that can reduce the maximum remote memory access relative to the maximum migration  
Figure 2: Migrating different tasks incurs a different degree of remote memory access after migration. cost when it is migrated. The following metric is used to select the target task with the maximum value:  
\[\text{BCE}_{p}=(\text{RSS}_{p}(dest\_node)-\text{RSS}_{p}(src\_node))/\text{ RSS}_{p}(src\_node)\]