Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1593345lqa; Mon, 29 Apr 2024 13:00:24 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXx51IbK4H4q9v4GngG+5JSflZ6/vMfeXVFkINE/7Dt4GZKFZ6BnWzv/K5zlje22JgCdlleqo6CawtppnKO//mIWgq5EtRs8w/XKfypTA== X-Google-Smtp-Source: AGHT+IG+YRC7uEjfi1xNdXAss/jO3wbPqg+8ATU6lnBxQs+Qfh0YGQDsv8Ca200DC7zpORttRBHi X-Received: by 2002:a19:2d54:0:b0:51b:abde:b18e with SMTP id t20-20020a192d54000000b0051babdeb18emr5147960lft.61.1714420824776; Mon, 29 Apr 2024 13:00:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714420824; cv=pass; d=google.com; s=arc-20160816; b=NuoJGZYcP9QYYSZ05i8fMPBdhea9uaDKQOw4WoGTJo5SoWbHTsYiUNBJWV9wWs8req d8hyfYB9P67IUm7Z+OXET/h/2mZ2jQxXPeH2cTHKvkUMdHIWWEl/OcySs0jiLHV/RpJA /A8NkMmborGbeaveYCFM8G8zNgXANQEvKI2s/1EKhW5KbWV8jlp4fTvu3YPWJSsGiSlU lqIQp5rVX3JC7V3gq7TLGF1ksZ+GLTdJeDkMbUx/l1iXQH+bcYI8qLZj3BgEejFTUfEI 67q8bRFoy/pDUmiWdnjEk7+qKw1YRWhZ8cx6e9SGHlD2TNJ6a3uI/BxeyrEnH9KqInlb UtAQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:dkim-signature:date; bh=QQ5FcjaYCyg1Mr1CGy79zC22GmrlSZ/10SszbgWtzIY=; fh=EtmzgUDl7YWyKMNs6TjPGPlxEbIQxspZo+ZGll7FwB0=; b=PNheR3IWnaQ9swP55/MojfSSqQZ687lFtSCBahaGb4fLObeQi6VfZYljjRhDWXUjAZ sz1TbxZgkKX9CweU1kEhBVOK/CQK/qQLZM519G1imKkb4t19PN8d3l5m1GWf11E7OirS 9G0trSdgHeVkfgXDt7q9Z2+AyfPg1B33oGWnvuJ/bBQExjT+pAlSI/hrnOdVmSW2dsS9 K/TVZL+rQ/QjKpefLaKW5q/ot1HGOOQoLDc/+cWhHy12zdIU5XQqaShJBGyMfXBoCxRY EqtGsmCS9Ic6M0nGAFV5a7i30vCSkhO9GDZe73pCKLNt3LCvNnSJHmVcXEG/x4nmcRQw b6DQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=upUBjJS8; 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-162982-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-162982-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id gn37-20020a1709070d2500b00a5575f7435dsi15363963ejc.748.2024.04.29.13.00.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 13:00:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-162982-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=upUBjJS8; 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-162982-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-162982-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 7A3281F2120F for ; Mon, 29 Apr 2024 20:00:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 14FD113FD6F; Mon, 29 Apr 2024 20:00:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="upUBjJS8" Received: from out-171.mta1.migadu.com (out-171.mta1.migadu.com [95.215.58.171]) (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 2E06613C3D3 for ; Mon, 29 Apr 2024 20:00:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714420817; cv=none; b=cpz0dEiQDg2yPGUakyK42720AoTLPu2LKFbUnA0hGPmzz/DxSn6eH75cZTRPcZC7ndDkHtK3j0QG9vtdpIPWcqOPBSBpm9YQKgGfSbmwdbcSknaczVhMZzmyqpWHCEdGJfmaWOPVWGwnzGskT6XAH5mh6UA3QBORC+Kp2UizqBA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714420817; c=relaxed/simple; bh=c4mB7o8/yzEVcwo2o6r+iqRTnzaM2sN+BU+6NpT2eFI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Zpv4frtDDqWWaGgi7aZNMkZXOE8dhkYTIjJT//o94SgU0S+1wgRmn72fri7CJ1J4ZO1ZOQK6rg3ErRvjWlz7SLq7t5L+7tz1JA0ofGcszW1iQtcdbw+Dub3eW5a2ZzpY8EKX9pLggmL1ABHwrfzKnAq7s/c0clwkrQC69icbmqo= 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=upUBjJS8; arc=none smtp.client-ip=95.215.58.171 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: Mon, 29 Apr 2024 13:00:06 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1714420813; 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=QQ5FcjaYCyg1Mr1CGy79zC22GmrlSZ/10SszbgWtzIY=; b=upUBjJS8WJNxYCju+dzj7JEkoZILGvcJRS/jL9TRfeDHDAhNO80uHktKWufdqJaVXvz37c Na3/fPiwWSmrWlcX32RkGMqkuq3gWdF+v0x5XCozLMfbCGz5N/0wHNuhF7VwnIWSygCI0f ECuVybXOUfs0o4AsVHmfPlkt7GUCASU= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Shakeel Butt To: Roman Gushchin Cc: Andrew Morton , Johannes Weiner , Michal Hocko , 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=us-ascii Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT On Mon, Apr 29, 2024 at 09:00:16AM -0700, Roman Gushchin wrote: > On Fri, Apr 26, 2024 at 05:37:29PM -0700, Shakeel Butt wrote: [...] > > Hm, I'm slightly worried about the performance penalty due to the increased cache > footprint. Can't we have some formula to translate idx to memcg_idx instead of > a translation table? > If it requires a re-arrangement of items we can add a translation table on the > read side to save the visible order in procfs/sysfs. > Or I'm overthinking and the real difference is negligible? > No, you are not overthinking and the update side is very performance sensitive. On my simple testing I do not see any regression but I am hoping that the Intel's performance bot will tell us if this is really worth exploring. > Thanks!