Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1444379lqa; Mon, 29 Apr 2024 08:36:31 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX1hzH+vl5WtkMOwyxaA3YY5WrjSuUCZXSPL2Rb05M3RUqZpNe8OgOW9ZsGw3TdQGuLkgum8IdHilLllcNFvvnIdG30VPyJ8GtyCO5BRw== X-Google-Smtp-Source: AGHT+IHt4pPrX3Z0YKhHtGDEIOLDmG3zi+o04KuUBW2aKWqdCq1bVLFnuL8dOJbzBd7rgr+Byp18 X-Received: by 2002:a05:6830:2043:b0:6ee:1fb7:a178 with SMTP id f3-20020a056830204300b006ee1fb7a178mr4959902otp.27.1714404991176; Mon, 29 Apr 2024 08:36:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714404991; cv=pass; d=google.com; s=arc-20160816; b=SvrcE49SpM93KBKCRL6prZsJlGurKGtC8k4nKgGpwBu3faWBK39fzRv64b6kGObPkW vjhZnxXv4WK8HNJpqEoCXltBaaIvjcU58CPyzVLcRBLjCnDvujYnx5fUUi5kPwPcuWA7 j926pNVfP7A8yN768+2DKqGp924w+vKMIk6dlQ5k09H963qA+A79DB+FPfNLh+EJBbOp LF0ypu8MCfzK1r7PlUPpmUHzg0IiSmDM+brhCa7UtHdOwCTfdjBu+cJX83D9Q6QGRXVX eAYKK4yC46ljyeZLEWqL3dQqM0DXsSloexaocnMwH7/lt2K79dcmnQn5Ovcazt0fIeCi NgZQ== 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=7pgIU5d1obfciNK5ZO1w/49MA6EFqpbOPs15zytydTc=; fh=IsuQBNQYhkGChzqSB/vteDtpE7K1Tm5QTidFr5WcaN4=; b=B4S6Xy5CI0quIUaUHKGbV/qfggPlyAYzf0P9+X8i0SVCx1yQ9DdfGWba63ljuF6n9D OejlZssK8856/8/lvUJ7e3Ksg1O9f9Gn1fgFpOiBhln5HbWEjaK2ib3L0iIF1VC3e0z9 sBo8Aifowh/TDUmWuOwKNED+aCS+0TBwa2JUD0dkDm3IijEYcluGjysiinQf3+4Rz3b0 qaviQPzJ2A1KpTxdgOMcGw/2zIg5RyIvJSKT100OS63vHZHTTWfrc/OkCBGvfjeoVBnJ OhwkZ1qXRLWyJQU2XcVIZvSECssReL3+t5YjA1Kxy8Wh8s5j245tDaIdQsZkd+8m2UTV 4WuA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b="U/ADFdM7"; 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-162598-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-162598-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id wh13-20020a05620a56cd00b00790f6c6a1b7si2210087qkn.772.2024.04.29.08.36.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 08:36:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-162598-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b="U/ADFdM7"; 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-162598-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-162598-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 359571C21C8B for ; Mon, 29 Apr 2024 15:36:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B3FDA82863; Mon, 29 Apr 2024 15:36:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="U/ADFdM7" Received: from out-187.mta0.migadu.com (out-187.mta0.migadu.com [91.218.175.187]) (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 AD37F7C09E for ; Mon, 29 Apr 2024 15:36:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.187 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714404983; cv=none; b=Mo2ydMyomv0n/9P2wHLIxN1gMthBGx684RE/CxcYQvGicSorm6nNZT5mZaxhqem/CMFDJcG4DpaLTeQK1jSA7pMObdgR9YSjh+P5W6qTTgkOzQttxKSZyP7XH6aMHGg5I4pwqKq8Up+OkhxKTiM+2zYwyBedTxO0fcHG0oWR5Ig= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714404983; c=relaxed/simple; bh=u2SqR4xY4qqz6czR1VJmSTq5N17r8ruEGaFZQngeBBg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=RViEKrFrAONDwLlzh6FuicoV8aXq0QuaRwcGkpQrH6uNOx7uGqfWz83nAlUJbhlPcdOfreZ0gihc10UKyY12R1JDp4KuMKiVe0X81mRanCb4wsZ7FJTXufu70YujXRm2Qze27VdYV/llnNXiVRFmPnrWyloZgDi57HWZSnm1YQ8= 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=U/ADFdM7; arc=none smtp.client-ip=91.218.175.187 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 08:36:12 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1714404977; 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=7pgIU5d1obfciNK5ZO1w/49MA6EFqpbOPs15zytydTc=; b=U/ADFdM745j3hf4HRTQdWUpmPhb8wVUiIyzqLow8fCO10A54hhEZu6tUEL7b6qBL3Ou5W/ qZ9qenQ3UEK8vQtoKjKTkfGih6rcDrb8BMmzbUjncKkZzatMPVFUWyxsf3/8ktLwcxAx13 +1mLbgkRziwZfUw+QY3UPftp2vEuDFc= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Roman Gushchin To: Shakeel Butt Cc: Andrew Morton , Johannes Weiner , Michal Hocko , Muchun Song , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/7] memcg: reduce memory size of mem_cgroup_events_index Message-ID: References: <20240427003733.3898961-1-shakeel.butt@linux.dev> <20240427003733.3898961-2-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: <20240427003733.3898961-2-shakeel.butt@linux.dev> X-Migadu-Flow: FLOW_OUT On Fri, Apr 26, 2024 at 05:37:27PM -0700, Shakeel Butt wrote: > mem_cgroup_events_index is a translation table to get the right index of > the memcg relevant entry for the general vm_event_item. At the moment, > it is defined as integer array. However on a typical system the max > entry of vm_event_item (NR_VM_EVENT_ITEMS) is 113, so we don't need to > use int as storage type of the array. For now just use int8_t as type > and add a BUILD_BUG_ON() and will switch to short once NR_VM_EVENT_ITEMS > touches 127. > > Signed-off-by: Shakeel Butt Reviewed-by: Roman Gushchin