From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DB249C432C2 for ; Tue, 24 Sep 2019 12:27:50 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B1C1F2168B for ; Tue, 24 Sep 2019 12:27:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B1C1F2168B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 46B876B0006; Tue, 24 Sep 2019 08:27:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3F5D26B0008; Tue, 24 Sep 2019 08:27:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 30B476B000A; Tue, 24 Sep 2019 08:27:50 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 097436B0006 for ; Tue, 24 Sep 2019 08:27:50 -0400 (EDT) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with SMTP id BB09582437D2 for ; Tue, 24 Sep 2019 12:27:49 +0000 (UTC) X-FDA: 75969740658.06.light71_a14e48d32562 X-HE-Tag: light71_a14e48d32562 X-Filterd-Recvd-Size: 1600 Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) by imf09.hostedemail.com (Postfix) with ESMTP for ; Tue, 24 Sep 2019 12:27:49 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id F0D6DB0E2; Tue, 24 Sep 2019 12:27:47 +0000 (UTC) Date: Tue, 24 Sep 2019 14:27:47 +0200 From: Michal Hocko To: Baoquan He Cc: akpm@linux-foundation.org, tj@kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v2] memcg: Only record foreign writebacks with dirty pages when memcg is not disabled Message-ID: <20190924122747.GQ23050@dhcp22.suse.cz> References: <20190923083030.6442-1-bhe@redhat.com> <20190924111138.GA31919@MiWiFi-R3L-srv> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190924111138.GA31919@MiWiFi-R3L-srv> User-Agent: Mutt/1.10.1 (2018-07-13) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue 24-09-19 19:11:51, Baoquan He wrote: > diff --git a/mm/memcontrol.c b/mm/memcontrol.c > index f3c15bb07cce..84e3fdb1ccb4 100644 > --- a/mm/memcontrol.c > +++ b/mm/memcontrol.c > @@ -4317,6 +4317,9 @@ void mem_cgroup_track_foreign_dirty_slowpath(struct page *page, > > trace_track_foreign_dirty(page, wb); > > + if (mem_cgroup_disabled()) > + return; > + This doesn't seem correct. We shouldn't even enter the slowpath with memcg disabled AFAIC. The check should be done at mem_cgroup_track_foreign_dirty level. -- Michal Hocko SUSE Labs