From mboxrd@z Thu Jan 1 00:00:00 1970 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=-11.3 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_IN_DEF_DKIM_WL autolearn=no 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 01D34C433E0 for ; Wed, 17 Jun 2020 15:55:37 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id BCB512088E for ; Wed, 17 Jun 2020 15:55:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="SHDEFFc7" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BCB512088E 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 607606B000A; Wed, 17 Jun 2020 11:55:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5B8736B000C; Wed, 17 Jun 2020 11:55:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4F5406B000D; Wed, 17 Jun 2020 11:55:36 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0145.hostedemail.com [216.40.44.145]) by kanga.kvack.org (Postfix) with ESMTP id 373A16B000A for ; Wed, 17 Jun 2020 11:55:36 -0400 (EDT) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id DB8D9181709A5 for ; Wed, 17 Jun 2020 15:55:35 +0000 (UTC) X-FDA: 76939153830.23.tramp40_4e03e6126e08 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin23.hostedemail.com (Postfix) with ESMTP id A2D22107595 for ; Wed, 17 Jun 2020 15:55:35 +0000 (UTC) X-HE-Tag: tramp40_4e03e6126e08 X-Filterd-Recvd-Size: 4378 Received: from mail-lj1-f194.google.com (mail-lj1-f194.google.com [209.85.208.194]) by imf12.hostedemail.com (Postfix) with ESMTP for ; Wed, 17 Jun 2020 15:55:35 +0000 (UTC) Received: by mail-lj1-f194.google.com with SMTP id i27so3447699ljb.12 for ; Wed, 17 Jun 2020 08:55:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=P+rzqdnz8r3FAqXWwD1gDVePdUHQDJi/4YgwPQMfMFA=; b=SHDEFFc789vRYeW1su2Gaa8bZ+QIDqGELGMbXne2rOAla35jtL8FX73T2NXQHskY3h 6hc2UDPyaQ2YqQircog+cI4jNEOVGlVfGh6jrYWBEFkffTeAuWDll25swry/t778LTwU GvpxSODR6Lbwfu4Ylt8yAW11JYZ0dGlw/M6PfBvOXk44Wl/zcBwDWA9K1O+JiCHMapnc OexX/f6ORWFBGGXc1eZ36asCHwoMLiP0cHPsAmjirFOol94jug7hM4dixnP8T3gkNE1s jCGXOeV8ZNheEOSjWn6y3RPlrEVDkVuxgbHIuz8zuRhVQNWpjMeMCLYn8Tp6qj4OMnal 8feg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=P+rzqdnz8r3FAqXWwD1gDVePdUHQDJi/4YgwPQMfMFA=; b=GI3+4N+OUwbzHMf4vpIYfKZaHaNq/IQ/EtIoX/j1vSEsKUZTWGtS+xPJsCK1Jh+HKt ijhTo98UuhgO2jaVvzyObR21WjFMzN6PK6+GiAOmFIwLy9mR2wmWmL/m/YVynvCNEOoT 7aUg3VsqaaAAES4mZzE2NoyzYzL5ey1yZ+6VeP/Vp7qSYoJXts+Mv6g2NQSBW6bjWH8t N2u2WFrDmSbme1lNu4lJVD22T4ySq8L+EEsFsUraxBAw5Ptavln0YvYGFeQiJvlaL8bj 97v8FOj7bwo/vyUulYCrmtbdwRQvom+P9M2VMCgWDTUklonIPcdknBO3M3gNEBrcJE16 yDmg== X-Gm-Message-State: AOAM530ryUEkrdN5K7xvt3VcNav5PpsWWxMBqW94MVQyeBJWutdl1D1H 4zQsJwVQ46so7acJHjwgf1htKePbo3GzioAlnMJeIA== X-Google-Smtp-Source: ABdhPJyFhfn2qdOtcu73QdZkHzTrokzYqN5wBiGecH2VRaWa2n9acLfwuRxjivsjawol+3dNCv3nZCVpDFATIMu2jDA= X-Received: by 2002:a2e:a58a:: with SMTP id m10mr4496325ljp.347.1592409333511; Wed, 17 Jun 2020 08:55:33 -0700 (PDT) MIME-Version: 1.0 References: <20200608230654.828134-1-guro@fb.com> <20200608230654.828134-3-guro@fb.com> In-Reply-To: <20200608230654.828134-3-guro@fb.com> From: Shakeel Butt Date: Wed, 17 Jun 2020 08:55:22 -0700 Message-ID: Subject: Re: [PATCH v6 02/19] mm: memcg: prepare for byte-sized vmstat items To: Roman Gushchin Cc: Andrew Morton , Christoph Lameter , Johannes Weiner , Michal Hocko , Linux MM , Vlastimil Babka , Kernel Team , LKML Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: A2D22107595 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam02 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: On Mon, Jun 8, 2020 at 4:07 PM Roman Gushchin wrote: > > To implement per-object slab memory accounting, we need to > convert slab vmstat counters to bytes. Actually, out of > 4 levels of counters: global, per-node, per-memcg and per-lruvec > only two last levels will require byte-sized counters. > It's because global and per-node counters will be counting the > number of slab pages, and per-memcg and per-lruvec will be > counting the amount of memory taken by charged slab objects. > > Converting all vmstat counters to bytes or even all slab > counters to bytes would introduce an additional overhead. > So instead let's store global and per-node counters > in pages, and memcg and lruvec counters in bytes. > > To make the API clean all access helpers (both on the read > and write sides) are dealing with bytes. > > To avoid back-and-forth conversions a new flavor of read-side > helpers is introduced, which always returns values in pages: > node_page_state_pages() and global_node_page_state_pages(). > > Actually new helpers are just reading raw values. Old helpers are > simple wrappers, which will complain on an attempt to read > byte value, because at the moment no one actually needs bytes. > > Thanks to Johannes Weiner for the idea of having the byte-sized API > on top of the page-sized internal storage. > > Signed-off-by: Roman Gushchin > Acked-by: Johannes Weiner > Reviewed-by: Vlastimil Babka Reviewed-by: Shakeel Butt