Skip to content

Commit

Permalink
mm/list_lru.c: revert "mm/list_lru: optimize memcg_reparent_list_lru_…
Browse files Browse the repository at this point in the history
…node()"

Commit 405cc51 ("mm/list_lru: optimize memcg_reparent_list_lru_node()")
has subtle races which are proving ugly to fix.  Revert the original
optimization.  If quantitative testing indicates that we have a
significant problem here then other implementations can be looked at.

Fixes: 405cc51 ("mm/list_lru: optimize memcg_reparent_list_lru_node()")
Acked-by: Shakeel Butt <[email protected]>
Reviewed-by: Muchun Song <[email protected]>
Acked-by: Michal Hocko <[email protected]>
Cc: Waiman Long <[email protected]>
Cc: Roman Gushchin <[email protected]>
Cc: Johannes Weiner <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
akpm00 authored and torvalds committed Apr 9, 2022
1 parent 0347b2b commit b33e104
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions mm/list_lru.c
Original file line number Diff line number Diff line change
Expand Up @@ -394,12 +394,6 @@ static void memcg_reparent_list_lru_node(struct list_lru *lru, int nid,
int dst_idx = dst_memcg->kmemcg_id;
struct list_lru_one *src, *dst;

/*
* If there is no lru entry in this nlru, we can skip it immediately.
*/
if (!READ_ONCE(nlru->nr_items))
return;

/*
* Since list_lru_{add,del} may be called under an IRQ-safe lock,
* we have to use IRQ-safe primitives here to avoid deadlock.
Expand Down

0 comments on commit b33e104

Please sign in to comment.