  Last Level Cache (LLC) is a precious and critical resource that impacts the
performance of applications running on top of CPUs. In this paper, we reveal
the significant impact of LLC on the performance of the 5G user plane function
(UPF) when running a cloudified 5G core on general-purposed servers. With
extensive measurements showing that the throughput can degrade by over 50\%
when the precious LLC resource of UPF is not properly allocated, we identify
three categories of performance degradation caused by incorrect LLC usage: DMA
leakage problem, hot/cold mbuf problem and cache contention. To address these
problems, we introduce the design and implementation of 5GC$^2$ache that
monitors the LLC status as well as the throughput performance and dynamically
adjusts key parameters of the LLC resource allocation. Our experiments show
that 5GC$^2$ache enables a commercial 5G core to increase its throughput to
76.41Gbps, 39.41\% higher than the original performance and 29.55\% higher than
the state-of-the-art.
