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 EFA20C369C2 for ; Thu, 17 Apr 2025 15:47:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 07FAB6B02A0; Thu, 17 Apr 2025 11:47:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 030216B02A1; Thu, 17 Apr 2025 11:47:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E37886B02A2; Thu, 17 Apr 2025 11:47:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id C61C16B02A0 for ; Thu, 17 Apr 2025 11:47:38 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id B1D9681AF9 for ; Thu, 17 Apr 2025 15:47:39 +0000 (UTC) X-FDA: 83343965838.23.A64DF29 Received: from out-173.mta1.migadu.com (out-173.mta1.migadu.com [95.215.58.173]) by imf19.hostedemail.com (Postfix) with ESMTP id B441D1A000C for ; Thu, 17 Apr 2025 15:47:37 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=NeKPW5hX; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf19.hostedemail.com: domain of shakeel.butt@linux.dev designates 95.215.58.173 as permitted sender) smtp.mailfrom=shakeel.butt@linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1744904858; a=rsa-sha256; cv=none; b=1mhcwIVLH4YC6zU/d2xTpQh8cLOHg9FrGqtvGI3mC6GGr4oynNfBoCdnTjbOGe6+k3eg9U hTLCzO/l7tKvn/frKzp3NLyuVF4ZwuKkLUQMdhVNr9O/4qZaXUZQ+PU1Luote/pWmHPctb YgmpEz5cyBjpJPEdm1JWH0fbxjKghns= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=NeKPW5hX; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf19.hostedemail.com: domain of shakeel.butt@linux.dev designates 95.215.58.173 as permitted sender) smtp.mailfrom=shakeel.butt@linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1744904858; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=ruQFE5xpLxHt7Tvqwi04Crgxry1+Hia7D//3nhNyUoA=; b=4QAZ42BLzDMiYeYn9jLWyc6dwUNWXbVMm8ru7VTVcbnsoJyEgGlbebqrIXZUHSVsetcucI gsJr3VADP2iUjHOuSRoy5+bKVOKbI6ubZiHXAo1z4KKv0+nyZkn5SBJpmgJANvmEfTvGmm TOGxk6Os8+t4/3lQHdds9C2vz18cQpM= Date: Thu, 17 Apr 2025 08:47:29 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1744904855; 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=ruQFE5xpLxHt7Tvqwi04Crgxry1+Hia7D//3nhNyUoA=; b=NeKPW5hXB3l+LWhLZUmxufOB5QDEo+o0ITy+ugUnSf/O+vSGslykC7ZXDOBTPwWV4jOFNf GUoI9mIMtMaFZOCwJMQT51GrKKvJ+mKdg0b8MlffV1TaONcK0uBDg3CEFvaR8PQ/DpetwZ Py0ZUsbBCW22jex/W0tNpNwxIhzuUkw= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Shakeel Butt To: Suren Baghdasaryan Cc: Usama Arif , Andrew Morton , linux-mm@kvack.org, hannes@cmpxchg.org, linux-kernel@vger.kernel.org, kernel-team@meta.com Subject: Re: [PATCH] alloc_tag: introduce Kconfig option for default compressed profiling Message-ID: References: <20250416180653.3438158-1-usamaarif642@gmail.com> <72pac6pkjebt6xo7engiuuu7r3zr7fu6fh6bj77f22m7gslxgr@3gjawofplas2> 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 X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: B441D1A000C X-Stat-Signature: xu6onm3w8iud85i6ku1u63zq5au9a6bw X-Rspam-User: X-HE-Tag: 1744904857-662805 X-HE-Meta: U2FsdGVkX1+Nn/fvxpvDh0FjDA1kHQxz6riWijTiS0TTx15yDHyP6d3ao74Kq2dHB9H0vGJ3GoaulBlvwMVVDNXhdmIojCIBeqaCcVIFv4wquXuTBbZg3QMBVyzJQ+1c5Q2Xrm9pl8nd715YnAo22qcC3t/JbzKjynZlkDTma9Mw10kVEWvzlI1lNOZ2u8IuZdpRAjmDL1veTjfcwYpQUzOO9227lwQdtmcwEBQBYM8kn8BjYSvbjFtwhUC3f6hUPFuNy3NdsWgOD6BvLAlx3C6ZzIrJeaQkWz1BvrfBi+CrweAIn2PLTys/O78j+ewhwFU5Bt8F8G2n2/5hIKwDcCYAE6uxhg7n16VChDQAKxReo3iOocwUINZMzd8U/l0m6Y70DWICe7/mJHyTM3ZskCOu+7W+l2nr2GO/pzmmMJtWJ9Z+ubloSboRadj9lZA/4RRwclLoWDb5QmpxVw4e6OgXL1ITocKNN7BPQF5B9ybcCdIwKGnO/zpfcb2oBBI88ZAP70SJGGLsTiacrhzMUp9JiCZ83CK+pgQEAKkK01klNopQpRM4n+gwDtZHLvnFW3YPMsAy9n7qbwbxplHwhtm1vk4XMdDIIjpI2W90VHwIpPEWnAeWiqlrfvJ2jMKP/0rDNUTzWwNg9dmmE0xlR+Reym+VnD/AmKMluvUsJhneZeuZMQ6g1uHxmQtWcY3m9CCyZA/qKAiDc6N+e8zWvuT3C2b1S5Da/C0D8w1IYRMxdPAGI1VPH1XTW0mq2Cj7RQ6j3YdYnDMkTwK8Fb2ov99UUmiZsqO6j2YCBSG88tEXDBUVfSl7hS0BW9YcG+BEseFA0F9gR31GgEYsZnHN82BeZshiMI0qzm1DvpC8htBnLT6x+ae7ZViXHs2g5tpZaeGSJXtjVUf480Jn5S6U0gGCQfJ67iHt3aSWw0LpXFQdfx28Q6wbD3cDoNODE4QgvK7aN4clwz6vHWY8r8z qYSQ6H3G wKWPGQexztS5Gr9XsH1EzY7zuXxFSj1vHMKeQ9/GeZUSgLsbl4smY6rrWsTXNW+v4cGx1Ba87DUYYhAWq9/jdOdGjZJrV3zhR1DOL47y/Ty5THgrjaAQ/mIaalEEHGMyAPhJWmx2xBXymCVEEgx6CayJsZUNfnDny5qQAxyB/qMhwFb0wNT9Ll/MPlJB3H2/f/l47OOxwJHDOu/COlB2zjQnNMhr33YIQSQRJQTJqvZJauIoASf23llfgCS0foEALMuIYDZr8QMomY0RLO/xmtRfxCA== 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: List-Subscribe: List-Unsubscribe: On Wed, Apr 16, 2025 at 05:11:11PM -0700, Suren Baghdasaryan wrote: > On Wed, Apr 16, 2025 at 2:41 PM Shakeel Butt wrote: > > > > On Wed, Apr 16, 2025 at 02:08:31PM -0700, Suren Baghdasaryan wrote: > > > On Wed, Apr 16, 2025 at 11:06 AM Usama Arif wrote: > > > > > > > > With this Kconfig option enabled, the kernel stores allocation tag references > > > > in the page flags by default. > > > > > > > > There are 2 reasons to introduce this: > > > > - As mentioned in [1], compressed tags dont have system memory overhead > > > > and much lower performance overhead. It would be preferrable to have this as > > > > the default option, and to be able to switch it at compile time. Another > > > > option is to just declare the static key as true by default? > > > > - As compressed option is the best one, it doesn't make sense to have to > > > > change both defconfig and command line options to enable memory > > > > allocation profiling. Changing commandline across a large number of services > > > > can result in signifcant work, which shouldn't be needed if the kernel > > > > defconfig needs to be changed anyways. > > > > > > The reason tag compression is not the default option is because it > > > works only if there are enough free bits in the page flags to store a > > > tag index. If you configure it to use page flags and your build does > > > not have enough free bits, the profiling will be disabled (see > > > alloc_tag_sec_init()). > > > > Is it possible to fail the build in that case i.e. check the page flags > > availability at build time? > > The difficulty is finding out the number of allocation tags in the > kernel before it gets built. Maybe there is a way to add an additional > post-build stage to run that check. Yeah that would be good to have. > But even then making this option > default and causing build failures does not seem like a good idea to > me but maybe I'm being too cautious? Oh my question was orthogonal to the patch. Basically some users may want build time guarantee for this and they can enable such build-failing opt-in config/check.