History

mm: memcontrol: track LRU counts in the vmstats array

Patch series "mm: memcontrol: clean up the LRU counts tracking". The memcg LRU stats usage is currently a bit messy. Memcg has private per-zone counters because reclaim needs zone granularity sometimes, but we also have plenty of users that need to awkwardly sum them up to node or memcg granularity. Meanwhile the canonical per-memcg vmstats do not track the LRU counts (NR_INACTIVE_ANON etc.) as you'd expect. This series enables LRU count tracking in the per-memcg vmstats array such that lruvec_page_state() and memcg_page_state() work on the enum node_stat_item items for the LRU counters. Then it converts all the callers that don't specifically need per-zone numbers over to that. This patch (of 6): The memcg code currently maintains private per-zone breakdowns of the LRU counters. This is necessary for reclaim decisions which are still zone-based, but there are a variety of users of these counters that only want the aggregate per-lruvec or per-memcg LRU counts, and they need to painfully sum up the zone counters on each request for that. These would be better served using the memcg vmstats arrays, which track VM statistics at the desired scope already. They just don't have the LRU counts right now. So to kick off the conversion, begin tracking LRU counts in those.

Johannes Weiner committed 7 years ago

Commit e0ee0e71 parent 132bb8c1 file · +1 −1Browse files

Showing the changes to include/linux (1 of 1 file). Show all

Unified · Split

include/linux/mm_inline.h+1−1
@@ -29,7 +29,7 @@ static __always_inline void __update_lru_size(struct lruvec *lruvec, · 28 unmodified lines
29{29{
30 struct pglist_data *pgdat = lruvec_pgdat(lruvec);30 struct pglist_data *pgdat = lruvec_pgdat(lruvec);
31 31
32 __mod_node_page_state(pgdat, NR_LRU_BASE + lru, nr_pages);32 __mod_lruvec_state(lruvec, NR_LRU_BASE + lru, nr_pages);
33 __mod_zone_page_state(&pgdat->node_zones[zid],33 __mod_zone_page_state(&pgdat->node_zones[zid],
34 NR_ZONE_LRU_BASE + lru, nr_pages);34 NR_ZONE_LRU_BASE + lru, nr_pages);
35}35}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t