Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp180876imj; Fri, 15 Feb 2019 21:07:30 -0800 (PST) X-Google-Smtp-Source: AHgI3IZpN+VPlpnoeQCav0x8L1I5cT3vHy+HR4wEkIqhGgj8LfHMItswiMVvsx7kn+yNurx9Uny6 X-Received: by 2002:a63:6a07:: with SMTP id f7mr8712044pgc.118.1550293649978; Fri, 15 Feb 2019 21:07:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550293649; cv=none; d=google.com; s=arc-20160816; b=o2liMNTaMk3GFvVxtbCVK91+iEHNR8jREuGOpHulqb3GgfXx+UiJD0jQQCZBXAZ2+S BKlQQzPg7kaZ8avURcl90fHx1iZRH9B+Oa5s0T0IaY8j6/p3kltOB3b7LsLDaMye2U7N MKTaQi6xawtsAyp0ez32SV2/sB+Gariwi5engDm4eEWFw5r1m6U0X8gR2C5TQIB8Y/rY tObOqju5CJlZkEjcPew5n/It51j1NmWWZqJ7CzuTFCzQnjLurLSYedfuHLEsGzpFeZTG YytIJOOZNZBhDSaePouItTeDzsHPpE3qcLyLcYDqgvT2gh2pUNahjYjE6gcHebbvDK9I G2aQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=NSVRB4KCxOzLiCcKtVzLdp3bqBiDRMqjw6+T+tZutHo=; b=r8be0jyxGCRakRXG9SA1AfNf1JEsIBgmqD8JzL/zCJkYAVEfKjlCIOHq5Uw4JjB03S MccVpRYUKL7xYgdKrzDiG46LjXFuAWuJI7GzOG9UGbT5fgCDUhtGhxG4SE/28/m5fmYb J6nKdMQaQNu5xmuoSVE1STCoCPROs2ja6vJJ3FDN2a+86u3jqfYzxqpz86dT3xVsgvkp VI27cVKukkCmSg3CkF9ylMmbfKo0PPbo2w8NO1y7lLs6+F+b1bs8gQRvGva0CQN3DMb6 QJTGDspqBjMPvjJx/6biQBrSlcjEVdn6eVaXVLJJk6KmCvPwILXYcMRq4+52zEgwXqRK fjfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b=bKmg92sU; 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=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g63si7236643pfc.60.2019.02.15.21.07.13; Fri, 15 Feb 2019 21:07:29 -0800 (PST) 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=@cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b=bKmg92sU; 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=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731951AbfBOSOg (ORCPT + 99 others); Fri, 15 Feb 2019 13:14:36 -0500 Received: from mail-yb1-f195.google.com ([209.85.219.195]:33759 "EHLO mail-yb1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731847AbfBOSOc (ORCPT ); Fri, 15 Feb 2019 13:14:32 -0500 Received: by mail-yb1-f195.google.com with SMTP id w2so4158937ybi.0 for ; Fri, 15 Feb 2019 10:14:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NSVRB4KCxOzLiCcKtVzLdp3bqBiDRMqjw6+T+tZutHo=; b=bKmg92sUiX5H/aar4+WmpOfQmxy/hG1c2YHfPUxNtki4sheyTomFyVrzH9ntdCRAyx WMef03M9PiBmcDvaDgiyaJdE3worIGUODUmyeQUiwXDn71kT5mpQ3K+F72km/7vMxHgy qyAJdWh9IBCOY7HBWtwuWspK227bmgvl9cvZEw+iU4fXonyASI0DzvnLcU5B1GD8iu3h JZfIHl+MyP1yGWCCOHxU3Tfh3CSQNvbxVXxC3+vnDvUWdFnamgPTq9sckkgQalxoa1zn 9+Ox8YJd/kmPVpOlKAcgEfei6I5y+YerssXk7839LFJ9gDZAAkteIWz8EFKtCe3v+15h CBUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NSVRB4KCxOzLiCcKtVzLdp3bqBiDRMqjw6+T+tZutHo=; b=ApMh5Ik1s0fU0AGzNtkw0E7I9fdnOtfGoJyjW7GVA5oJ39QV9LTB/RYJtFkh0PHIeo 6T86TdYh/sjz21NKg0k5yE/mFuKBpdCmOg8+zp7wWg6ZTHUoAYlu+BZ42ZxwFpCntoMH G9docVYw5nuYK1FI0QQnQsTse3Qqivmqz97YczotRVAfuaRLAPmdaiiLc3OWevo7IeSu ccZlZ5qkxmRXVqUjdxWvVvJxDDI58g5F4xrPUTG/N8gUY31aMBsNPjSPrViWi8zrn21n /inL6tSHFOm6HKoTcE1pHTrxhiC6NDtU5/bLhVR64OU/r0fqG1CeuB0W/C4+odDbYe4f CgZw== X-Gm-Message-State: AHQUAubqUxCukz4Cp3nQ2sUGkWb1PAOHVau1MNrM8KQgcZaQmr3UAsJP ryAp43p23+mUHXZl7Y8M+hxmLQ== X-Received: by 2002:a25:6e8b:: with SMTP id j133mr8968247ybc.220.1550254471365; Fri, 15 Feb 2019 10:14:31 -0800 (PST) Received: from localhost ([2620:10d:c091:200::4:33c1]) by smtp.gmail.com with ESMTPSA id h205sm4730096ywh.85.2019.02.15.10.14.30 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 15 Feb 2019 10:14:30 -0800 (PST) From: Johannes Weiner To: Andrew Morton Cc: Tejun Heo , linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@fb.com Subject: [PATCH 1/6] mm: memcontrol: track LRU counts in the vmstats array Date: Fri, 15 Feb 2019 13:14:20 -0500 Message-Id: <20190215181425.32624-2-hannes@cmpxchg.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190215181425.32624-1-hannes@cmpxchg.org> References: <20190215181425.32624-1-hannes@cmpxchg.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The memcg code currently maintains private per-zone breakdowns of the LRU counters. This is necessary for reclaim decisions which are still zone-based, but there are a variety of users of these counters that only want the aggregate per-lruvec or per-memcg LRU counts, and they need to painfully sum up the zone counters on each request for that. These would be better served using the memcg vmstats arrays, which track VM statistics at the desired scope already. They just don't have the LRU counts right now. So to kick off the conversion, begin tracking LRU counts in those. Signed-off-by: Johannes Weiner --- include/linux/mm_inline.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/mm_inline.h b/include/linux/mm_inline.h index 04ec454d44ce..6f2fef7b0784 100644 --- a/include/linux/mm_inline.h +++ b/include/linux/mm_inline.h @@ -29,7 +29,7 @@ static __always_inline void __update_lru_size(struct lruvec *lruvec, { struct pglist_data *pgdat = lruvec_pgdat(lruvec); - __mod_node_page_state(pgdat, NR_LRU_BASE + lru, nr_pages); + __mod_lruvec_state(lruvec, NR_LRU_BASE + lru, nr_pages); __mod_zone_page_state(&pgdat->node_zones[zid], NR_ZONE_LRU_BASE + lru, nr_pages); } -- 2.20.1