mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-26 21:54:11 +08:00
mm: memcg/slab: fix slab statistics in !SMP configuration
Since commitea426c2a7d
("mm: memcg: prepare for byte-sized vmstat items") the write side of slab counters accepts a value in bytes and converts it to pages. It happens in __mod_node_page_state(). However a non-SMP version of __mod_node_page_state() doesn't perform this conversion. It leads to incorrect (unrealistically high) slab counters values. Fix this by adding a similar conversion to the non-SMP version of __mod_node_page_state(). Signed-off-by: Roman Gushchin <guro@fb.com> Reported-and-tested-by: Bastian Bittorf <bb@npl.de> Fixes:ea426c2a7d
("mm: memcg: prepare for byte-sized vmstat items") Acked-by: Vlastimil Babka <vbabka@suse.cz> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
472e5b056f
commit
be458311cd
@ -312,6 +312,11 @@ static inline void __mod_zone_page_state(struct zone *zone,
|
||||
static inline void __mod_node_page_state(struct pglist_data *pgdat,
|
||||
enum node_stat_item item, int delta)
|
||||
{
|
||||
if (vmstat_item_in_bytes(item)) {
|
||||
VM_WARN_ON_ONCE(delta & (PAGE_SIZE - 1));
|
||||
delta >>= PAGE_SHIFT;
|
||||
}
|
||||
|
||||
node_page_state_add(delta, pgdat, item);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user