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

From: Alex Shi
Date: Tue Aug 11 2020 - 23:26:44 EST

在 2020/8/11 下午9:56, Michal Hocko 写道:
> On Tue 11-08-20 20:54:18, Alex Shi wrote:
>> >From beeac61119ab39b1869c520c0f272fb8bab93765 Mon Sep 17 00:00:00 2001
>> From: Alex Shi <alex.shi@xxxxxxxxxxxxxxxxx>
>> Date: Wed, 5 Aug 2020 21:02:30 +0800
>> Subject: [PATCH 2/6] memcg: bail out early from swap accounting when memcg is
>> disabled>>
>> If we disabled memcg by cgroup_disable=memory, the swap charges are
>> still called. Let's return from the funcs earlier.
> They are not, are they? page->memcg will be NULL and so the charge is
> skipped and that will trigger a warning with your current ordering.

Hi Michal,

Thanks for comment! Looks like we both agree the memcg wasn't charged, but funcs
just are called. :)

> Let me repeat again. Either you put it first in the series and argue
> that we can bail out early or keep the ordering then this makes sure the
> warning doesn't trigger.

Is the following commit log fine?