Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp50527rwn; Wed, 7 Sep 2022 19:50:27 -0700 (PDT) X-Google-Smtp-Source: AA6agR7e5vKwGBhkAllxOQUheHFsJeeRP8Lk7d34O0jvFCDnB5E55IY++LuHuEulzUj1zCPQnx+2 X-Received: by 2002:a62:1ac1:0:b0:535:87d:d63f with SMTP id a184-20020a621ac1000000b00535087dd63fmr6851056pfa.74.1662605427381; Wed, 07 Sep 2022 19:50:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662605427; cv=none; d=google.com; s=arc-20160816; b=jwWc9J6pHsiR6DLZuXKTOfy2t7DmfnHM0VYbJ4oQ+KPswNIEhunOj2+7fuPY087/aL 6OJiDjir1jIIbJy/SoQcOWwA1qMOzpDUaaFNXkkv2UA3JAN2oZSuR4VSvK3SnzYjrzXf HpilEsK9mrfhLcwtNDCcT/BrvtO2cSXl2mXKNTrEdfnHsURnwrRK+0mVKDqbHNjYKeXM Y0kah4R8vOODbSkRimnnJkmniVLnPDN1BeKY/FLTR9Au87BH32151LRu25Fr8TgoCynR 5+cZjbw+YZpJ+JaovJTKK6DNGo2WubSNHtRQ/klF7vuJFxe66kF9pXGvXQAUPnHklmbd +taQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=Ky2nnvwk5aMRpug1OiXdRVfX6OZ/Blwf8y/RgQf3zCU=; b=0Tt2CHTIbxL+IqQ53mBwFUMhI4qjl5xEwBZ+MzbYTVXbr9Ipp3esjQkCK942zi50Sp Wel+amd4I0v1iBisgprY8q6Tm9ifYnio0e0ePG5iMjV3gK0fqHKF2EgL31OW+SEfZOir YaNg/7j5PBgKQOHIM9dRGCoWxcmQcKrJlr5RXH4BF97r2H5oYFxknrEuvNe3THEgqetf VSd3G8Syej4MOmv1QFpWPbfruwMAzwB2T1doarJ0wmMxBkHhl5ex8EzGzSwcNpSSPH/J xPLS357dcX92nJq1PV8WOTOa62obGUWLOPPj05H02moC+FkkFdhXSLWIF/xyEkLMs3IF VRuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=IfqRKpQJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i1-20020aa78d81000000b00535c451053esi18312087pfr.296.2022.09.07.19.50.11; Wed, 07 Sep 2022 19:50:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=IfqRKpQJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229535AbiIHCfY (ORCPT + 99 others); Wed, 7 Sep 2022 22:35:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229488AbiIHCfX (ORCPT ); Wed, 7 Sep 2022 22:35:23 -0400 Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com [IPv6:2607:f8b0:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4469195E5E for ; Wed, 7 Sep 2022 19:35:22 -0700 (PDT) Received: by mail-pf1-x42b.google.com with SMTP id z187so16475104pfb.12 for ; Wed, 07 Sep 2022 19:35:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=Ky2nnvwk5aMRpug1OiXdRVfX6OZ/Blwf8y/RgQf3zCU=; b=IfqRKpQJZLtUUw3FK0nalBJ+FjJYspG6C1fY/6m//4cf4HJJhIsIsPGoRoTTNsCnQS 7nDJRuNF1imN5jNzf1YM9DNRaGaBVS8u6DC8VjpdD21adZbQ2kRVjn0a8VcZc1183KRg 2rXc26R4gdOX0PTflk+HqGryZp4BUoLR5cBn30bUaqne7zTicctxBSgJs9JtzcnYXyZL eRBGv7Lp6b5LRD1WAHxDRG+vdsi5AHQ5lB6HeYq6qn4StAAY1Di5cQn9AePJ9KKqSKPs z6NWDM0fVXaufe1qxDay/6XZqvQJgXE6wAeA8OLyScix0+vjawVxHPhgPncsveXFTinG czFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=Ky2nnvwk5aMRpug1OiXdRVfX6OZ/Blwf8y/RgQf3zCU=; b=sco+nQVRdEy+Fm68fsStbRpANVvRmfyVp8nIof9/1uBWE8YpPb1484GsEu8G5gJEAs /oDivsYM15AKIZOeDwtNBDidJc9twdnRa8kOkisRNQO1OOUIHrWsRucnlKW5RZeKb12E BpH8y5tTcsgr095gJ9z/PM4Vr9Ka6WcJ8ToqZE6edfTb4wlT9NZudt++GT6OFks/Z04B hIEQgImXfAtAaVR0f11O9cEbffvYb/NJixO1GSSVhNP4XJYbySLWbFHNyOwnxkB8beCA a0XEgFE5gdHxndoWk7hQ/3rflqK9tZdGK9eik80qfya2Roqh7Nx4d25YKtFU4tEAWlVY 6+9Q== X-Gm-Message-State: ACgBeo2rer9Xq8/h1wMdywpQPfWGskYrlR47X5hYLBVG8FPXpDK62O2U nuRez6tJabBbDbf3+5MFDotuBvq1vTVP8kDshny9SA== X-Received: by 2002:a05:6a00:2385:b0:53a:cad4:79de with SMTP id f5-20020a056a00238500b0053acad479demr6913798pfc.8.1662604521620; Wed, 07 Sep 2022 19:35:21 -0700 (PDT) MIME-Version: 1.0 References: <20220907043537.3457014-1-shakeelb@google.com> <20220907043537.3457014-4-shakeelb@google.com> In-Reply-To: <20220907043537.3457014-4-shakeelb@google.com> From: Shakeel Butt Date: Wed, 7 Sep 2022 19:35:10 -0700 Message-ID: Subject: Re: [PATCH 3/3] memcg: reduce size of memcg vmstats structures To: Johannes Weiner , Michal Hocko , Roman Gushchin , Muchun Song Cc: Andrew Morton , Cgroups , Linux MM , LKML Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 6, 2022 at 9:36 PM Shakeel Butt wrote: > [...] > > static unsigned long memcg_events_local(struct mem_cgroup *memcg, int event) > { > long x = 0; > int cpu; > + int index = memcg_events_index(event); > + > + if (index < 0) > + return 0; > > for_each_possible_cpu(cpu) > x += per_cpu(memcg->vmstats_percpu->events[event], cpu); Andrew, can you please replace 'event' in the above line with 'index'? I had this correct in the original single patch but messed up while breaking up that patch into three patches for easier review.