Re: [PATCH] mm/memcg: remove useless check on page->mem_cgroup

From: Alex Shi
Date: Mon Aug 10 2020 - 03:44:50 EST




在 2020/8/9 上午5:43, Roman Gushchin 写道:
>>> mm/memcontrol.c | 6 ++++++
>>> 1 file changed, 6 insertions(+)
>>>
>>> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
>>> index cb07a48d53aa..65f2b42d25af 100644
>>> --- a/mm/memcontrol.c
>>> +++ b/mm/memcontrol.c
>>> @@ -7163,6 +7163,9 @@ void mem_cgroup_swapout(struct page *page, swp_entry_t entry)
>>> VM_BUG_ON_PAGE(PageLRU(page), page);
>>> VM_BUG_ON_PAGE(page_count(page), page);
>>>
>>> + if (mem_cgroup_disabled())
>>> + return;
>>> +
>>> if (cgroup_subsys_on_dfl(memory_cgrp_subsys))
>>> return;
>>>
>>> @@ -7228,6 +7231,9 @@ int mem_cgroup_try_charge_swap(struct page *page, swp_entry_t entry)
>>> struct mem_cgroup *memcg;
>>> unsigned short oldid;
>>>
>>> + if (mem_cgroup_disabled())
>>> + return 0;
>>> +
>>> if (!cgroup_subsys_on_dfl(memory_cgrp_subsys))
>>> return 0;
>>>
>>>
>
> Hi Alex,
>
> this patch looks good to me. Please, feel free to add
> Reviewed-by: Roman Gushchin <guro@xxxxxx>

Thanks a lot!
>
> What's the second patch?
>

It's the patch,
https://www.spinics.net/lists/linux-mm/msg222228.html
or