linux 内核页管理和lru list locking 优化

linux 内核页管理和lru list locking 优化

Linux memory managerment base pages, to support large vary memory size, linux developed a complicate system to manage it's memory, one of key component is lru list, which is the basement of page management and the core of memory rebalance strategy. To protect the lru list integrity, there needs a spin_lock named lru_lock.
Current lru_lock is one for each of node, pgdat->lru_lock, that guard for lru lists, but now we had moved the lru lists into memcg for long time. Still using per node lru_lock is clearly unscalable, pages on each of memcgs have to compete each others for a whole lru_lock. A new method try to use per lruvec/memcg lru_lock to repleace per node lru lock to guard lru lists, make it scalable for memcgs and get performance gain: about 250% times of old performance data. https://lkml.org/lkml/2020/8/26/212
The new feature: per memcg lru_lock is developed from Hugh Dickin's(google) from 2008, and rewrite by Alex Shi (alibaba). Now the whole patchset composed by Alex Shi, Alexander Duyck (intel) and Hugh Dickinks. It is in active reviewing status on way moving to upstream kernel.https://lkml.org/lkml/2020/8/24/1008