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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 34E7AECAAD3 for ; Wed, 7 Sep 2022 23:27:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 607146B0072; Wed, 7 Sep 2022 19:27:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 568A98D0001; Wed, 7 Sep 2022 19:27:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 457526B0074; Wed, 7 Sep 2022 19:27:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 34A396B0072 for ; Wed, 7 Sep 2022 19:27:34 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 091311A08F0 for ; Wed, 7 Sep 2022 23:27:34 +0000 (UTC) X-FDA: 79886878428.22.9DA304B Received: from out0.migadu.com (out0.migadu.com [94.23.1.103]) by imf15.hostedemail.com (Postfix) with ESMTP id 7E440A0067 for ; Wed, 7 Sep 2022 23:27:33 +0000 (UTC) Date: Wed, 7 Sep 2022 16:27:12 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1662593251; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=TaKcAPnW1Rv+P8V2WVmdtPwTsnlpyaGaJZ+gn5WE91Y=; b=ccqnbVj+QPPasLxHBGE6AFu8Yoq671MiQPkkyRGJgyLs7qpb2LL2u4wMhuPhWCx2es0Ow0 vm2SBlmaYjH8gKdhHyNdc9jnyC4Ik2/2sgdVZTnqm7dxc35nofvltU0Mtl84Fx2WLrNhIZ DL6do2sxzUEfuACz0QOFL05zurqThbg= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Roman Gushchin To: Shakeel Butt Cc: Johannes Weiner , Michal Hocko , Muchun Song , Andrew Morton , cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/3] memcg: reduce size of memcg vmstats structures Message-ID: References: <20220907043537.3457014-1-shakeelb@google.com> <20220907043537.3457014-4-shakeelb@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220907043537.3457014-4-shakeelb@google.com> X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662593253; a=rsa-sha256; cv=none; b=dRIdEg3ecYLCbcRuyskJMSW926aBu1o6u7CJuMDFPxqXNBeXibD14lF9RKOx4Gsw6cThkm C612ydtIN7AKmP/3N1NDhxd7HBX0cqYBC8i2BSPd9VmT2pOhCtPBYdcz2jciEz6biMSXT9 TvJRJhMRI34ycahIJo3kvF/rT9rBDEc= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=ccqnbVj+; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf15.hostedemail.com: domain of roman.gushchin@linux.dev designates 94.23.1.103 as permitted sender) smtp.mailfrom=roman.gushchin@linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662593253; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=TaKcAPnW1Rv+P8V2WVmdtPwTsnlpyaGaJZ+gn5WE91Y=; b=OSU/SYv1Bv9iID9YoQPzx5LgrZRR4k1mbONGtpVz56c14qZRHpiKlP9QrMsDtmW8vHNDnM +W+N1pWU3kDUQY4RyS3ecABjVB4/BgvE91z7lObyysxsuEbzk1jMCxhEKOiXZ3cYtdz64v qJWhFS7C5PnmOnlHwrQZE8oUeS1x1bA= X-Stat-Signature: ysnc87d751wwsmgqhydndtdk3e8dhu98 X-Rspamd-Queue-Id: 7E440A0067 X-Rspam-User: Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=ccqnbVj+; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf15.hostedemail.com: domain of roman.gushchin@linux.dev designates 94.23.1.103 as permitted sender) smtp.mailfrom=roman.gushchin@linux.dev X-Rspamd-Server: rspam12 X-HE-Tag: 1662593253-770571 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 Wed, Sep 07, 2022 at 04:35:37AM +0000, Shakeel Butt wrote: > The struct memcg_vmstats and struct memcg_vmstats_percpu contains two > arrays each for events of size NR_VM_EVENT_ITEMS which can be as large > as 110. However the memcg v1 only uses 4 of those while memcg v2 uses > 15. The union of both is 17. On a 64 bit system, we are wasting > approximately ((110 - 17) * 8 * 2) * (nr_cpus + 1) bytes which is > significant on large machines. > > This patch reduces the size of the given structures by adding one > indirection and only stores array of events which are actually used by > the memcg code. With this patch, the size of memcg_vmstats has reduced > from 2544 bytes to 1056 bytes while the size of memcg_vmstats_percpu has > reduced from 2568 bytes to 1080 bytes. This is pretty impressive! Thank you, Shakeel! Acked-by: Roman Gushchin for the series. Thanks!