Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp825923ybi; Wed, 17 Jul 2019 05:31:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqzZ29SGo+kbbobO2eKaeGI6wnp0mYFzQ+R9WiKlQB6CBb6Z9htefpsBLNpbm+0qVbd2x/Ep X-Received: by 2002:a65:55c7:: with SMTP id k7mr8883149pgs.305.1563366677423; Wed, 17 Jul 2019 05:31:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563366677; cv=none; d=google.com; s=arc-20160816; b=eGOORlmG3Hdv2p6XI/PIUSMoFHIX6XdJ+u51hBuLM1pC6fA/PmKP+DFNbWpeedX3ba bn3Al7MUq0vB+tJJVvBe6jA2UbrXtFfYa92h0bG9TxEUiob8qRCR6UzauwhWTxVXbL27 El9bH1OfWDnCd65yn3/o5LcBEd6SqjhGGD0NkNQqdWe2yuyiHOJ3gMbl1no86bq3RVHX adWUhqf/hLqzwQWzQ4o1AlsMKf4mXOVmr6VnDSdnBccWs4pRMiSBuRwowVZmSl8ty3LH aHpjJfRVcWY7h2UXNfxNFrRUPWG9aIwrWdzezckWuMairW3o2XKBT0CrP5sek1nvc+Os ROYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:message-id:date:cc:to:from:subject:dkim-signature; bh=GkI1vFOT++uyatsCF9OkZ7BsUl/lwbKpS28Kcx4smEY=; b=vNIkTZa14lVfeHAxT2OZp1qPNnzRT9w5jJiIsp4Yay/0dIw9DYImSu5ySA54pluJn7 cF+qZUunlChWrH84TS7rDQX3y7caYC27FGX7uzddz2Bx4XjihVhhSYY9jtfCDdv4nlLz Gzg62dUr1X16X0rrxC3qWwx44N0Ya/eC3nfinS3lFigyV4XZmFe7eHgdsQzJHU5ayvEo Tt4H0deU4GbTYJ8HAKhvLUAs5Iekns1hTgLNb6hK5JFTNj1uLPSPbefCLQvdZKjhDKjm +Csd7lmB3+wIf4C1VV890ZQxIj6ks/h8WDGN5wZLArCx87lzFMqg4VDV2UBQQjjo4ngr uEUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yandex-team.ru header.s=default header.b="zUT/Ch2F"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=yandex-team.ru Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c7si8569968pfj.79.2019.07.17.05.31.00; Wed, 17 Jul 2019 05:31:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@yandex-team.ru header.s=default header.b="zUT/Ch2F"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=yandex-team.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727050AbfGQM3W (ORCPT + 99 others); Wed, 17 Jul 2019 08:29:22 -0400 Received: from forwardcorp1j.mail.yandex.net ([5.45.199.163]:54584 "EHLO forwardcorp1j.mail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725936AbfGQM3V (ORCPT ); Wed, 17 Jul 2019 08:29:21 -0400 Received: from mxbackcorp1o.mail.yandex.net (mxbackcorp1o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::301]) by forwardcorp1j.mail.yandex.net (Yandex) with ESMTP id 9B7102E14E7; Wed, 17 Jul 2019 15:29:18 +0300 (MSK) Received: from smtpcorp1o.mail.yandex.net (smtpcorp1o.mail.yandex.net [2a02:6b8:0:1a2d::30]) by mxbackcorp1o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id ttVOnIowdA-TIiK6lFj; Wed, 17 Jul 2019 15:29:18 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1563366558; bh=GkI1vFOT++uyatsCF9OkZ7BsUl/lwbKpS28Kcx4smEY=; h=Message-ID:Date:To:From:Subject:Cc; b=zUT/Ch2FRAuXKeKsUy2GKoCVeAkDxPWMsQKVKduAaqW60pGTqyj+A45AGb1DawgVP MhAIsZPLGfda0d8ynwBQb/V2+vASQeWhVGFkFNW0577I3VsRlsH4Y6q0imiXzx1uA7 O/PaU60Bb7ohzDoMklbMGaba3gSt68RBzaw0dLfQ= Authentication-Results: mxbackcorp1o.mail.yandex.net; dkim=pass header.i=@yandex-team.ru Received: from dynamic-red.dhcp.yndx.net (dynamic-red.dhcp.yndx.net [2a02:6b8:0:40c:38d2:81d0:9f31:221f]) by smtpcorp1o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id Q1tjHAsjiv-TI98o0cW; Wed, 17 Jul 2019 15:29:18 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) Subject: [PATCH 1/2] mm/memcontrol: fix flushing per-cpu counters in memcg_hotplug_cpu_dead From: Konstantin Khlebnikov To: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Johannes Weiner Cc: Michal Hocko Date: Wed, 17 Jul 2019 15:29:17 +0300 Message-ID: <156336655741.2828.4721531901883313745.stgit@buzz> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use correct memcg pointer. Fixes: 42a300353577 ("mm: memcontrol: fix recursive statistics correctness & scalabilty") Signed-off-by: Konstantin Khlebnikov --- mm/memcontrol.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 249671873aa9..06d33dfc4ec4 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -2259,7 +2259,7 @@ static int memcg_hotplug_cpu_dead(unsigned int cpu) x = this_cpu_xchg(memcg->vmstats_percpu->stat[i], 0); if (x) for (mi = memcg; mi; mi = parent_mem_cgroup(mi)) - atomic_long_add(x, &memcg->vmstats[i]); + atomic_long_add(x, &mi->vmstats[i]); if (i >= NR_VM_NODE_STAT_ITEMS) continue; @@ -2282,7 +2282,7 @@ static int memcg_hotplug_cpu_dead(unsigned int cpu) x = this_cpu_xchg(memcg->vmstats_percpu->events[i], 0); if (x) for (mi = memcg; mi; mi = parent_mem_cgroup(mi)) - atomic_long_add(x, &memcg->vmevents[i]); + atomic_long_add(x, &mi->vmevents[i]); } }