Skip to content

Commit fac0516

Browse files
Wei Yangtorvalds
authored andcommitted
mm: thp: don't need care deferred split queue in memcg charge move path
If compound is true, this means it is a PMD mapped THP. Which implies the page is not linked to any defer list. So the first code chunk will not be executed. Also with this reason, it would not be proper to add this page to a defer list. So the second code chunk is not correct. Based on this, we should remove the defer list related code. [[email protected]: better patch title] Link: http://lkml.kernel.org/r/[email protected] Fixes: 87eaceb ("mm: thp: make deferred split shrinker memcg aware") Signed-off-by: Wei Yang <[email protected]> Suggested-by: Kirill A. Shutemov <[email protected]> Acked-by: Yang Shi <[email protected]> Cc: David Rientjes <[email protected]> Cc: Michal Hocko <[email protected]> Cc: Kirill A. Shutemov <[email protected]> Cc: Johannes Weiner <[email protected]> Cc: Vladimir Davydov <[email protected]> Cc: <[email protected]> [5.4+] Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent f1037ec commit fac0516

File tree

1 file changed

+0
-18
lines changed

1 file changed

+0
-18
lines changed

mm/memcontrol.c

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5340,14 +5340,6 @@ static int mem_cgroup_move_account(struct page *page,
53405340
__mod_lruvec_state(to_vec, NR_WRITEBACK, nr_pages);
53415341
}
53425342

5343-
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
5344-
if (compound && !list_empty(page_deferred_list(page))) {
5345-
spin_lock(&from->deferred_split_queue.split_queue_lock);
5346-
list_del_init(page_deferred_list(page));
5347-
from->deferred_split_queue.split_queue_len--;
5348-
spin_unlock(&from->deferred_split_queue.split_queue_lock);
5349-
}
5350-
#endif
53515343
/*
53525344
* It is safe to change page->mem_cgroup here because the page
53535345
* is referenced, charged, and isolated - we can't race with
@@ -5357,16 +5349,6 @@ static int mem_cgroup_move_account(struct page *page,
53575349
/* caller should have done css_get */
53585350
page->mem_cgroup = to;
53595351

5360-
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
5361-
if (compound && list_empty(page_deferred_list(page))) {
5362-
spin_lock(&to->deferred_split_queue.split_queue_lock);
5363-
list_add_tail(page_deferred_list(page),
5364-
&to->deferred_split_queue.split_queue);
5365-
to->deferred_split_queue.split_queue_len++;
5366-
spin_unlock(&to->deferred_split_queue.split_queue_lock);
5367-
}
5368-
#endif
5369-
53705352
spin_unlock_irqrestore(&from->move_lock, flags);
53715353

53725354
ret = 0;

0 commit comments

Comments
 (0)