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 70F10C369BD for ; Thu, 17 Apr 2025 00:11:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 954D7280157; Wed, 16 Apr 2025 20:11:24 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 900D5280156; Wed, 16 Apr 2025 20:11:24 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7CC96280157; Wed, 16 Apr 2025 20:11:24 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 5C210280156 for ; Wed, 16 Apr 2025 20:11:24 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 643191CCCD5 for ; Thu, 17 Apr 2025 00:11:25 +0000 (UTC) X-FDA: 83341606530.09.641D331 Received: from mail-qt1-f175.google.com (mail-qt1-f175.google.com [209.85.160.175]) by imf21.hostedemail.com (Postfix) with ESMTP id 85C6D1C000B for ; Thu, 17 Apr 2025 00:11:23 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=JDq1ZhwV; spf=pass (imf21.hostedemail.com: domain of surenb@google.com designates 209.85.160.175 as permitted sender) smtp.mailfrom=surenb@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1744848683; 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=w1BDSlGQSuTccuHPUciANQC7+kFvBKHpDf/vnt1wHnE=; b=v/7g+Oflh7NwJuGGVpuG9DHTnX1PPvm+spxeJJfuhoKr4775tQEPqZyChpXc0TcUPi4xnl C67kVfFrFvj0Z+ZdwkQle44h0yTc6Z0lgBC4tV9tH9Rlyx1BzHB0oayeLXfUu+Zk7vp8Xx BxxBB0Wini57FGVMyFspfxK8+HNruaQ= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=JDq1ZhwV; spf=pass (imf21.hostedemail.com: domain of surenb@google.com designates 209.85.160.175 as permitted sender) smtp.mailfrom=surenb@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1744848683; a=rsa-sha256; cv=none; b=UlYrDquuQ8EkkGhnxnD1sNDkXSSySwFLxHXiERUIj6expW3qtTqfwbGSYr5VYW94bP0evR b3EVzyHphs1Np30jagERTWJft3YM9FZpx5rLgP7HLJYSBYvSsXIljlOJjKXDd8quapBJN9 QLZoIeaJGwF+ZOJDEBhlqinXvsnx98I= Received: by mail-qt1-f175.google.com with SMTP id d75a77b69052e-4769e30af66so95841cf.1 for ; Wed, 16 Apr 2025 17:11:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1744848682; x=1745453482; darn=kvack.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=w1BDSlGQSuTccuHPUciANQC7+kFvBKHpDf/vnt1wHnE=; b=JDq1ZhwVUMjdnPvGYqI9gh4pB6tXZrM58ISc2MrYStJ8UGgVElB/Lx+aI/+aDTB+/k aS+pYQiabZ0UJFq0sTxO0hjJ945Y330/aVlxmre+aOwrBag9kzDwB8hgrH6UJcNPDlkV tuuxZ4hy8LYS5EDp8p1ZnI4q4uc5jQfjNcN1GHQVL+d8VI5wbyGHKeRfr/PzjXUDcKDw nWQjwnVzrqVTKi7nPmzOLiT/UnRKpAH8WgVkZ+0kBIAOgALFV2izZ6Rog/6Rvsg6jrw/ W09N+CR2vG9c+x1TbRulv58n+SvL840/ht5NdGSmTxg9Re0Y5cFT5lCulz9oTEXzk5Bk lC7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744848682; x=1745453482; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=w1BDSlGQSuTccuHPUciANQC7+kFvBKHpDf/vnt1wHnE=; b=DHDvA2Y8iEMu/38GaofFdfBAacisRxSNZDiqQN07nFcFGw3y/LlRFOj79AXG6Ocivp xYPy5KtZSvYtjytuLzyHkpD+anzeWsUEF8Hnc03E52CgKKJMSF6v6I1nIminffXxysj/ g0L9+igXmsUEjJNxIhYSlnTBSq+kiyefWYlQGYcSNCp61T8IysgzTnhRZwjkdNtRFOSM U3EbAo6D2WI5C1sZfUCBc4bEYHJE+gdOVGoQRnB4fG5CUmZ/8JBGil0lEUO7505ABUNW oBL8uKcPBYKjM2+03nWb7Hsuv5GBMvLTIVoGVH2ej5jR7h8hEX6AeoLehsdLQXmjt7hy XdrQ== X-Forwarded-Encrypted: i=1; AJvYcCUtXrLjZvLCylK/QYPtVFEQxpxYHmG2gJYfcqEivP3dGbRVrxn57CfntHYrZtL9ViKXS8suT9Dk3Q==@kvack.org X-Gm-Message-State: AOJu0YzWbWyY/8TmQAbmnbJMb1GYwLs0AnH4hE4T4uYoq6E1kIhltOsB zJMXF2AyY7/UHXJNkNs8rD7WoCElZeg16BR6Wu5vjSHJ51ZN5IDd69JOIumI73Q33+yGuhnGM0j I+tg+oQTXCBNdZ1fK/1SujY0Xry6zxTiC2cUb X-Gm-Gg: ASbGncsug/bVTYr6qFWxs2l0vkpolfO9BCnvie/5DXqdC/F9wo2PdI+IYLxErqspYAj zCsfxeDBTxAueXLbqdJ5zJ36CzWeienBfOtn8eBVmggQ9JI9DvZjqFjN1GUyx+pjPHrAVuwJlm3 +tGKn3YgdNS10c6l0zF1g4 X-Google-Smtp-Source: AGHT+IHSICZJaJDQa5wUIbxX/a79r/JHtgBdixHts/IERewVZ1fKnH9pWrijJQ7J8EbRQCA9x4SKKaHAoQsx+a5+75w= X-Received: by 2002:ac8:7fd0:0:b0:471:9480:a14b with SMTP id d75a77b69052e-47ade60c5aemr1802501cf.12.1744848682352; Wed, 16 Apr 2025 17:11:22 -0700 (PDT) MIME-Version: 1.0 References: <20250416180653.3438158-1-usamaarif642@gmail.com> <72pac6pkjebt6xo7engiuuu7r3zr7fu6fh6bj77f22m7gslxgr@3gjawofplas2> In-Reply-To: <72pac6pkjebt6xo7engiuuu7r3zr7fu6fh6bj77f22m7gslxgr@3gjawofplas2> From: Suren Baghdasaryan Date: Wed, 16 Apr 2025 17:11:11 -0700 X-Gm-Features: ATxdqUHWXeU1hb0SN-sebVEyHfUhDtTAxpoeCPHWnHtrz8sk-skFNWe3liRyneU Message-ID: Subject: Re: [PATCH] alloc_tag: introduce Kconfig option for default compressed profiling To: Shakeel Butt Cc: Usama Arif , Andrew Morton , linux-mm@kvack.org, hannes@cmpxchg.org, linux-kernel@vger.kernel.org, kernel-team@meta.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Stat-Signature: 7kjhqp6x3eaukmnhhq8xs39thgyqdhd1 X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 85C6D1C000B X-Rspam-User: X-HE-Tag: 1744848683-456009 X-HE-Meta: U2FsdGVkX1++CmfBcJtTsH1CTD5HR4ZCVYOS1QuGlzCETjGLAdH08p+48VQam/oSq3nmmYRMpEFpVr/Mx6UPYW3bcdbYMKKHKlA2w374IRVqKfEz0Atq4Zu6OYyEfAfR5NJ3JF4K3JYiDHcdsA5Fs6CaiwpkUhGa4u+A7Vmq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RHPfzWvalKgEijSNJuXDf/4= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000109, 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 2:41=E2=80=AFPM Shakeel Butt wrote: > > On Wed, Apr 16, 2025 at 02:08:31PM -0700, Suren Baghdasaryan wrote: > > On Wed, Apr 16, 2025 at 11:06=E2=80=AFAM Usama Arif wrote: > > > > > > With this Kconfig option enabled, the kernel stores allocation tag re= ferences > > > in the page flags by default. > > > > > > There are 2 reasons to introduce this: > > > - As mentioned in [1], compressed tags dont have system memory overhe= ad > > > 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. Anot= her > > > 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 s= ervices > > > can result in signifcant work, which shouldn't be needed if the kerne= l > > > 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. 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?