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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0B85BECAAD3 for ; Wed, 7 Sep 2022 23:27:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229552AbiIGX1j (ORCPT ); Wed, 7 Sep 2022 19:27:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229720AbiIGX1h (ORCPT ); Wed, 7 Sep 2022 19:27:37 -0400 Received: from out0.migadu.com (out0.migadu.com [94.23.1.103]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2644A95AD3; Wed, 7 Sep 2022 16:27:33 -0700 (PDT) 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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!