Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp145167lqa; Fri, 26 Apr 2024 18:16:46 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW+LZ49qBOntQQpzcUwDP7mjrccwjRMRKa+cO79vqPXIwblpcbHMJoK2Rcrpc4/pQQYu770rXQSLVHkgt11NdRNNEqwrcXqSpbFP5845w== X-Google-Smtp-Source: AGHT+IHm3xrgGBEz8EZS/aAQVkHyrcu/fQZPZov0cYGHXHsPDZMNHP7jK0viNpiC4s+qKIm1GnWZ X-Received: by 2002:a05:6870:610d:b0:22a:e91:2d9c with SMTP id s13-20020a056870610d00b0022a0e912d9cmr4533695oae.56.1714180605671; Fri, 26 Apr 2024 18:16:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714180605; cv=pass; d=google.com; s=arc-20160816; b=06tk2VVboEaryDJS8A8yfIlFw8dwqLqXQjLFX51BEgnRBwtIR/OVYjccIf9foKvQt5 hNgzIPBiqGf1JhRxKmeg0jqV0jDV6A+an0v94h+de5M0N/EA++PQC+A9moJXBU2v0e+9 C/J33jxc8UR6baV8ssy3nf+N4ap1EfkX+a+btHezVCUK5+UyAXdQbf/4tjrqWcJbKFqx /gpzSQPh+1Nxgq8TAqSn6RGmNHXNMX4xJj6hugI/BvXJXgEoVf28Exv4WZb97lHBzw1W S90/8142aM5u3g4hbupOCocV6Gk3AUHk7BY2zpZaXnw6SyO5xqr9JEfF2nPLHim4CZaZ OoBw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:dkim-signature:date; bh=Dw9CXe+SmxN1TDy435qbdzl8HGL75SSMRvyUbyXE2xA=; fh=ifesyHm7lGxO6oBP0o4ljVxzoEpCEqENJ0ry8d3xcQE=; b=TQDAlBzMrLBMLk/9Vje85B3zyXOS1spbwM7x6Y7dJEU9rDA2rk+olrt8blRK4tNn6X 0tuvtscDYZY/Fk/bCalLsqXBa+oIyhgP96b9eXWOWFwBkvvOMcKSjNkZBuOugHo4EKfX IP3DTsx/Wa+T+ty8ej0dROBXJM2rP2qXXfVJ21ZA8RqG970pHmMicwrd85LOzja3Vs7j J5HGwf2YL6qAEzLCwv8jP8PwuwJjWvKvH3FyNa+FCIP9JkUxCtMg+bGpndx3p3g/3gcr XfB9TMGdWTwxTYFPtRpinqtsVGl5sQRqkAI2PvK0ShCMpWS8JqYM7wCBFR8SpCbj7yJd VkzA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=rCbwiDGH; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-160839-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160839-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id a23-20020a62e217000000b006ed2baf9b5fsi15852812pfi.134.2024.04.26.18.16.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 18:16:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-160839-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=rCbwiDGH; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-160839-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160839-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 45EA8283A96 for ; Sat, 27 Apr 2024 01:16:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 032992E651; Sat, 27 Apr 2024 01:16:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="rCbwiDGH" Received: from out-186.mta0.migadu.com (out-186.mta0.migadu.com [91.218.175.186]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 48CD72C6BB for ; Sat, 27 Apr 2024 01:16:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.186 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714180600; cv=none; b=m06YExCZzZuNB0NTYoFBs7y3RC7pc4KJKulxl8W8nMXh9Z9SRP6IdkVVyoplkRzDazr+iia7zW5ow3K6ng9/+6XCTMJS5YCFIPqs2JhRFI7eqPaexUxevTNHdwM11ZADSJ/vPML1tGeqZjA/tSSHkLzUSoUnuwEpjyFYYdO0wSA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714180600; c=relaxed/simple; bh=35LKY7Ge563urcdAjPWNirdL2Ze4zZ9nGJan4ILzT3Q=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=EkODs6Y/tcTZh+LMSvj7ocmKpPgd9roCQjeYC0tVv+mI1WL3+yWL5L+rIY1t3ioPwnJEiMIzNpWm7oSppSkq/TWAO1xVPHXPznspzML2MztPzbGnwDJTIZ1WL+xl+yVT2Cx3u9C+BuzKYS6fmpeI856WXa2aLasmpKaDxcdZO4k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=rCbwiDGH; arc=none smtp.client-ip=91.218.175.186 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Date: Fri, 26 Apr 2024 18:16:32 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1714180596; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Dw9CXe+SmxN1TDy435qbdzl8HGL75SSMRvyUbyXE2xA=; b=rCbwiDGHCO+X1lYKKamtp1knSDpnUWhysMFPCiO7cUuKr6CeRmkM+Kb8LwAowZ19Qec1AP wxht7p6bqUg4mqYsCjAigIMyrG4uFGDlnfXj7D+3K6MfnatGerx8IDbLro6iDAbtrea/6f j8mHp2qf0hC7Rpg58h0nLMqmYHG3UlQ= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Shakeel Butt To: Yosry Ahmed Cc: Andrew Morton , Johannes Weiner , Michal Hocko , Roman Gushchin , Muchun Song , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 3/7] memcg: reduce memory for the lruvec and memcg stats Message-ID: References: <20240427003733.3898961-1-shakeel.butt@linux.dev> <20240427003733.3898961-4-shakeel.butt@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Migadu-Flow: FLOW_OUT On Fri, Apr 26, 2024 at 05:51:23PM -0700, Yosry Ahmed wrote: > On Fri, Apr 26, 2024 at 5:37 PM Shakeel Butt wrote: > > > > At the moment, the amount of memory allocated for stats related structs > > in the mem_cgroup corresponds to the size of enum node_stat_item. > > However not all fields in enum node_stat_item has corresponding memcg > > stats. So, let's use indirection mechanism similar to the one used for > > memcg vmstats management. > > Just curious, does the indirection table cause any noticeable > performance impact? My guess is no, but the update paths are usually > very performance sensitive. > > I guess lkp will shout at us if there are any noticeable regressions. Yeah and that is the reason I made the indirection table smaller (i.e. int8_t) to keep more entries in a single cacheline.