From patchwork Fri Jan 8 15:58:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shakeel Butt X-Patchwork-Id: 12006909 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=-16.6 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT 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 19C86C433DB for ; Fri, 8 Jan 2021 15:58:34 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 84DD1239D1 for ; Fri, 8 Jan 2021 15:58:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 84DD1239D1 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 76F018D0187; Fri, 8 Jan 2021 10:58:32 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 71D4E8D0156; Fri, 8 Jan 2021 10:58:32 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 65C558D0187; Fri, 8 Jan 2021 10:58:32 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 500B48D0156 for ; Fri, 8 Jan 2021 10:58:32 -0500 (EST) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 19C3E3643 for ; Fri, 8 Jan 2021 15:58:32 +0000 (UTC) X-FDA: 77683065264.22.judge33_0b1061b274f4 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin22.hostedemail.com (Postfix) with ESMTP id C253118038E6A for ; Fri, 8 Jan 2021 15:58:31 +0000 (UTC) X-HE-Tag: judge33_0b1061b274f4 X-Filterd-Recvd-Size: 4256 Received: from mail-vk1-f202.google.com (mail-vk1-f202.google.com [209.85.221.202]) by imf36.hostedemail.com (Postfix) with ESMTP for ; Fri, 8 Jan 2021 15:58:31 +0000 (UTC) Received: by mail-vk1-f202.google.com with SMTP id j67so5579967vkh.15 for ; Fri, 08 Jan 2021 07:58:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:message-id:mime-version:subject:from:to:cc; bh=TmS2aUSU9Nc+jbusxkpkx6bWx9vKLPLSx0ah1Mh9yyI=; b=MqO7QoO5t1t19B+AEl6h5z4tw+zU7KM6GwbNk/Mp1PFVGy9rfrtGYSbX/d9+eAzZhn 85nVIeuPCcrIsHLF6pmDeiMskOl5gL8hrRpWLw2fiRK1XfHVrtlIhB3jtVuaOAuYAkX9 y6PXWQyxwiovuUX4CqBWFUXWa2W+xhkln/xfwF05D6fSP6Ciqky7dTJuFFfn+UdmRkds KWeq7o1ESWlHIt80X8LW5vaHOnrLQeNZ4AhBLpgI54SeMWH/RtWLb2vuIH8DG7ux9OWT VZV7UjrCJGnJuc7mg18IjSCC1lMGzxZnMGNHFI+bg4cgIzRnzex0r+3is36+V51S9R/d SeWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:message-id:mime-version:subject:from :to:cc; bh=TmS2aUSU9Nc+jbusxkpkx6bWx9vKLPLSx0ah1Mh9yyI=; b=udismUQ0WbyTydjLOofbnjEFvQm2HwaYzJ6///NM4+pWcMdWt3Ae26SaB+mBXK7Kt4 BPXpVA17OlCPlKmVtdfiT1zUdeh2Z01McpVVQilQKsOj99se1qYoad9FsXXovB41mrg/ jSqFw97tQOX9Lq2/5MNpFhKLNC2spL2S8qlke7FtHBBGIlDVAZfInuZOtiKe9SpKHrq/ Q1Wjxo9y4EaXRBYpLh1kO3dh8ieZTyLL9HxVFfZL3gBJO6yy8jrcfo/P+48m73aw6hFS 3tqhyxZqOn7F4fv1dxg+qRZnhij+AzfnpVF92h7sf88q7T8/LPxf7icT/MXMB0JSr4Dd V8Yg== X-Gm-Message-State: AOAM531mx3W2VHe38YOZ1lTmn0UvJAFOt9OJwOB+4KSjlCUrOLqReRt/ fPE14+jUmmvNetFHnWZXmZFj6uuodngQZg== X-Google-Smtp-Source: ABdhPJynj45gvGpcLiTW+x0xQm2G4v8WqiYUR+6AYBe2nYQlf67mjxvgOrcX3T27vNrGyNrdY/nPHbHkBhPcuQ== X-Received: from shakeelb.svl.corp.google.com ([100.116.77.44]) (user=shakeelb job=sendgmr) by 2002:a67:8d46:: with SMTP id p67mr3453396vsd.36.1610121510398; Fri, 08 Jan 2021 07:58:30 -0800 (PST) Date: Fri, 8 Jan 2021 07:58:11 -0800 Message-Id: <20210108155813.2914586-1-shakeelb@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.29.2.729.g45daf8777d-goog Subject: [PATCH v2 1/3] mm: memcg: fix memcg file_dirty numa stat From: Shakeel Butt To: Johannes Weiner , Roman Gushchin , Michal Hocko , Yang Shi Cc: Andrew Morton , linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, Shakeel Butt , Muchun Song , stable@vger.kernel.org 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: The kernel updates the per-node NR_FILE_DIRTY stats on page migration but not the memcg numa stats. That was not an issue until recently the commit 5f9a4f4a7096 ("mm: memcontrol: add the missing numa_stat interface for cgroup v2") exposed numa stats for the memcg. So fixing the file_dirty per-memcg numa stat. Fixes: 5f9a4f4a7096 ("mm: memcontrol: add the missing numa_stat interface for cgroup v2") Signed-off-by: Shakeel Butt Reviewed-by: Muchun Song Acked-by: Yang Shi Reviewed-by: Roman Gushchin Cc: --- Changes since v1: - none mm/migrate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/migrate.c b/mm/migrate.c index ee5e612b4cd8..613794f6a433 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -500,9 +500,9 @@ int migrate_page_move_mapping(struct address_space *mapping, __inc_lruvec_state(new_lruvec, NR_SHMEM); } if (dirty && mapping_can_writeback(mapping)) { - __dec_node_state(oldzone->zone_pgdat, NR_FILE_DIRTY); + __dec_lruvec_state(old_lruvec, NR_FILE_DIRTY); __dec_zone_state(oldzone, NR_ZONE_WRITE_PENDING); - __inc_node_state(newzone->zone_pgdat, NR_FILE_DIRTY); + __inc_lruvec_state(new_lruvec, NR_FILE_DIRTY); __inc_zone_state(newzone, NR_ZONE_WRITE_PENDING); } }