Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp450229ybk; Wed, 20 May 2020 03:53:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxTW9CF9KusMIzALoY/V/uLmQEnggFZgHOXljrzN6h9+y7u2HlcW4zw9iL/JjnDvpPPUYhq X-Received: by 2002:aa7:c543:: with SMTP id s3mr2712886edr.328.1589972032868; Wed, 20 May 2020 03:53:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589972032; cv=none; d=google.com; s=arc-20160816; b=ZOd8LaVWf7b8SsyiB5GxH3aWBBVhrDUT3ij/QDut5kJAeQ4rf6nXzBAA8OsTm2OmoX PDF9rEtwGkClU/GZS2gBNmH/00wL/k3ZQm3v6Vais25xzOaV+1P8wvRlsest5J+smY4l vM8mUGfmOtG60/PCTAgQce3Oc8lzdefRWijKzp0ib20kveuMPMqkteLauHRHBJE0xJpE Lc33io8Y4lJdPs4R54YvBMtPdqTKB3jOXOPAGo6rLTWowDUmihkvoQ6Gxb+0OH1mYJtQ gBSropD55JvgZNnr0wtx0CT3K5NIP6je9oRtrtTAdEHwlNx/Qf4bQ1n22MOdGJ5kxL2p 1IRA== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=Rr3csxuHVvJy8UIfhLkAwPRlq8SAwTnlq/cf+54hY/o=; b=snrQDV+fcuNd1aMWdhf0JLyjvf5BhIbwpJNuqDIm+Z4AVsOlJ3PuLxepLJ1KqEnIbB saN1kxdIdPCZlkYWx8LeWLysCK24y84O1vuj8iIUR99DGq7uuPl+Pw0n1c7T5h1FAerM sgL/dz9TKa05OC0bCTgpUu/PrMFW1lKqFA8NvGy6nx08W2YPtADQtGVORmUOSewl5WQU iep2LQdzIT4rCl6mCZC9uLygR5mBPwmmcPOsvGa0Q70eIlysKGutx3vPnD9572IPXfBx WSUJB4yhGmwWyKcfqzOPiRO+W1bMtkaBZa6aRC444SRzhAUsDVpY7A9p6GevAy910PgA KKuQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i12si1313917edf.273.2020.05.20.03.53.29; Wed, 20 May 2020 03:53:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726827AbgETKts (ORCPT + 99 others); Wed, 20 May 2020 06:49:48 -0400 Received: from mx2.suse.de ([195.135.220.15]:50746 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726224AbgETKts (ORCPT ); Wed, 20 May 2020 06:49:48 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 8C096AD4D; Wed, 20 May 2020 10:49:49 +0000 (UTC) Subject: Re: [PATCH v3 01/19] mm: memcg: factor out memcg- and lruvec-level changes out of __mod_lruvec_state() To: Roman Gushchin , Andrew Morton Cc: Johannes Weiner , Michal Hocko , linux-mm@kvack.org, kernel-team@fb.com, linux-kernel@vger.kernel.org References: <20200422204708.2176080-1-guro@fb.com> <20200422204708.2176080-2-guro@fb.com> From: Vlastimil Babka Message-ID: <7a94d35e-c148-2471-6c6a-b213f220ed9b@suse.cz> Date: Wed, 20 May 2020 12:49:45 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20200422204708.2176080-2-guro@fb.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/22/20 10:46 PM, Roman Gushchin wrote: > To convert memcg and lruvec slab counters to bytes there must be > a way to change these counters without touching node counters. > Factor out __mod_memcg_lruvec_state() out of __mod_lruvec_state(). > > Signed-off-by: Roman Gushchin Reviewed-by: Vlastimil Babka Nit below: > --- a/mm/memcontrol.c > +++ b/mm/memcontrol.c > @@ -713,30 +713,14 @@ parent_nodeinfo(struct mem_cgroup_per_node *pn, int nid) > return mem_cgroup_nodeinfo(parent, nid); > } > > -/** > - * __mod_lruvec_state - update lruvec memory statistics > - * @lruvec: the lruvec > - * @idx: the stat item > - * @val: delta to add to the counter, can be negative > - * > - * The lruvec is the intersection of the NUMA node and a cgroup. This > - * function updates the all three counters that are affected by a > - * change of state at this level: per-node, per-cgroup, per-lruvec. > - */ > -void __mod_lruvec_state(struct lruvec *lruvec, enum node_stat_item idx, > - int val) > +void __mod_memcg_lruvec_state(struct lruvec *lruvec, enum node_stat_item idx, > + int val) > { > pg_data_t *pgdat = lruvec_pgdat(lruvec); Looks like the pgdat can now be moved into the MEMCG_CHARGE_BATCH if().