Received: by 10.213.65.68 with SMTP id h4csp1312814imn; Sat, 24 Mar 2018 09:10:43 -0700 (PDT) X-Google-Smtp-Source: AG47ELu3bE7LQmgYZUxnIKEKiYKp1vIkfsKCg4ViRoNnJz13FxjcidEBvsoAOjSu2AelyXzHKfWl X-Received: by 10.98.53.195 with SMTP id c186mr27760189pfa.199.1521907843700; Sat, 24 Mar 2018 09:10:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521907843; cv=none; d=google.com; s=arc-20160816; b=bTxgNT+sMP16Syn/Fy967d7s8cpahhFje3I5G9aQIst/Ze8d02rnTkgSvm+xVvix+i RIbrDUdAcUiJWlbXfrEV7GUdTBqTg87zRUNtpNITi4jcMnkHGBbpIenIUm7O0yRvI+0H Xqw1XvheqiIqS/ZADjlaklN/YNlSeC7fDp0ruwKUmNNV6JvmdtRolM53OYS3TS4k38IJ KwnSdnTLDH2WiRahnWgHsr9LiwnEd4JNjbuEMhfC+upB5KKGKPjjI5i8zYeOuR/76phq F2ITNONY+En/L9aAP+yOArQEPJFgYiWLJMdag9msGfttt7XbFBeNM24ybwXFLpnOU0Lz Km1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=/5W4tEGuJl5F9fX/iG/2IRtqWFchG4MaGrcZdTv8sqc=; b=oRIKE7/im74ZqroEDJBcNwD1lq6Su1vxLKRvXOtMH9zKgcKXooQptf9zdLurWZZd41 nPMOC/QnZi7tqNwSrK78h9CaK2M0a+wxP51Dwxlgzrg6LS7kGa/pyj/IDbb27H/hsmaI U8uCqEOGJBRHlgecacKkPfCUiwDJ4NQKkgShytsJ4HgpwE+GPEo+DhbtRsLSrp2Q/gDk NPZErZ18Gx6V65Mfh/OfT1S80YtXcQIhdGSCEvBKpz29mv4jA9bm5RABRGRwpztt+vEf CsHkbT4eDl14vpsBWCSkd5JbWtfypxxt7lCxwF7U6Dm9AgLiDvVN3/vRuzKGZNzykwdD 2z5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=BviaKImO; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 7-v6si11254253plf.552.2018.03.24.09.10.28; Sat, 24 Mar 2018 09:10:43 -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=fail header.i=@gmail.com header.s=20161025 header.b=BviaKImO; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752469AbeCXQJa (ORCPT + 99 others); Sat, 24 Mar 2018 12:09:30 -0400 Received: from mail-yw0-f194.google.com ([209.85.161.194]:39132 "EHLO mail-yw0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752120AbeCXQJ2 (ORCPT ); Sat, 24 Mar 2018 12:09:28 -0400 Received: by mail-yw0-f194.google.com with SMTP id q66so4303095ywg.6; Sat, 24 Mar 2018 09:09:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id; bh=/5W4tEGuJl5F9fX/iG/2IRtqWFchG4MaGrcZdTv8sqc=; b=BviaKImOmm2q26OJdXhINMQKyiibSB1uhy2ICPFgHW8fmFzE0xlq6Huk4h7vdiwLsk 0QayE38roXocikOdtNaNM191EvUFQ7b30yyEelEVBJFDCxoJDQ2nhfCc9vpJG9o/ne5g OoHenddekoWGYVPcsr9Kt/clnYZozG5BmH7aWXKKjL++5ks0L605OLS4cv/pCI7iJA8x Opjbm4aVk1wAg781bJx5BnRcPgQt8j20m3LUXKQdda0F4ufrR1o5YUsNWxsSO7rj79FC YmVP8yBA+cqBvM51tq5nIswyXyAOojT5ZAovuaMZ5JgoAXNWkUfm+waPPtrm+ZyoDirr +0Xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=/5W4tEGuJl5F9fX/iG/2IRtqWFchG4MaGrcZdTv8sqc=; b=L4X5nx57xkJzCCkCT+ecSJL/1Sc0udy3pmA8O2z68kg+kS4baXwCusdJrlX3ZduDFw opjg/4vPxMykvHRV+bq/23pN2CYbTsFhtCY1ouK/W9HGqkjDJ1O9ODB5GfsjgorrcNaY NmCQTa7KIp6ZY7rZukPu2Z0HnM+CikGHTPKqVVO+q9Zf3yj03o8eOC81OcUb864ImSW6 Q9ywg5iXQwvAnbcV0fMakZGv5ZIRodJPUR5PdWDlTg2HmRX14Y79uCLE3sYBXkFxCf8Y myDzqQ4IGDnHraH8KKpk8Z88tX0jceBeDZhUCTXeBWYpRT4LxMQISsbJ4TlL2zlF6b9q DcKg== X-Gm-Message-State: AElRT7FqbyYBysV+lHTMVrUJR67lLRMSdSsOMSrP9tJ47WdJ7ZGzdo/E r/0eDd4Ko1BvSRg/58XNE5o= X-Received: by 10.129.37.209 with SMTP id l200mr13550528ywl.343.1521907767626; Sat, 24 Mar 2018 09:09:27 -0700 (PDT) Received: from localhost ([2620:10d:c091:180::1:524]) by smtp.gmail.com with ESMTPSA id s130sm4403281ywc.69.2018.03.24.09.09.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 24 Mar 2018 09:09:26 -0700 (PDT) From: Tejun Heo To: hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com Cc: guro@fb.com, riel@surriel.com, akpm@linux-foundation.org, linux-kernel@vger.kernel.org, kernel-team@fb.com, cgroups@vger.kernel.org, linux-mm@kvack.org Subject: [PATCHSET] mm, memcontrol: Make cgroup_rstat available to controllers Date: Sat, 24 Mar 2018 09:08:58 -0700 Message-Id: <20180324160901.512135-1-tj@kernel.org> X-Mailer: git-send-email 2.9.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, Since a983b5ebee57 ("mm: memcontrol: fix excessive complexity in memory.stat reporting"), memcg uses percpu batch-overflowing for all stat accounting. While the propagation delay is okay for statistics, it doesn't work for events. If a notification for an event is sent out, the relevant counter must reflect the event when read afterwards. With the percpu batching, it's easy to miss, for example, an oom or oom_kill event because it's still buffered in one of the percpu counters. cgroup already has a mechanism to efficiently handle hierarchical statistics in a scalable manner, cgroup_rstat, and it now can be used by controllers. This patchset addresses the forementioned problem by converting event accounting to cgroup_rstat. While the stat part isn't broken, it's also converted for consistency and a few other benefits. Also, while trying to convert lruvec_stat, I found out that it has no users. Remove it too (not sure whether it's needed for some non-obvious reasons tho). 0001-mm-memcontrol-Use-cgroup_rstat-for-event-accounting.patch 0002-mm-memcontrol-Use-cgroup_rstat-for-stat-accounting.patch 0003-mm-memcontrol-Remove-lruvec_stat.patch This patchset is on top of the "cgroup/for-4.17: Make cgroup_rstat available to controllers" patchset[1] and also available in the following git branch. git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup.git review-cgroup_rstat diffstat follows. include/linux/memcontrol.h | 131 ++++++++++++------------ mm/memcontrol.c | 238 ++++++++++++++++++++------------------------- mm/vmscan.c | 4 3 files changed, 180 insertions(+), 193 deletions(-) Thanks. -- tejun [1] http://lkml.kernel.org/r/20180323231313.1254142-1-tj@kernel.org