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 8B5DBD30019 for ; Fri, 18 Oct 2024 16:04:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C07826B007B; Fri, 18 Oct 2024 12:04:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BB7626B0082; Fri, 18 Oct 2024 12:04:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A7F606B0083; Fri, 18 Oct 2024 12:04:39 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 8AD1D6B007B for ; Fri, 18 Oct 2024 12:04:39 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 5ED761A0974 for ; Fri, 18 Oct 2024 16:04:17 +0000 (UTC) X-FDA: 82687195752.29.F898C3A Received: from mail-qt1-f172.google.com (mail-qt1-f172.google.com [209.85.160.172]) by imf12.hostedemail.com (Postfix) with ESMTP id 1A23540014 for ; Fri, 18 Oct 2024 16:04:31 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=JkKPn5Yu; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf12.hostedemail.com: domain of surenb@google.com designates 209.85.160.172 as permitted sender) smtp.mailfrom=surenb@google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1729267358; a=rsa-sha256; cv=none; b=vV+yYDArmBCYYLl5Vlkbh1TY1tqHoo6WweKdQi5bMxDyT2elFwlmpmx8fq70QRRhwzEgYu JYsFR/u1pSnkCOPFR7Af5SuFt8UBkZ0FmYAn3x2dL304zwK7Oh3mNgbzv1tkZFTvXYFZ38 FXR1jG+cTfRuHkoiTlzSgbFa7xlwPjw= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=JkKPn5Yu; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf12.hostedemail.com: domain of surenb@google.com designates 209.85.160.172 as permitted sender) smtp.mailfrom=surenb@google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1729267358; 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=txzJ41KP+IG2jzYwjNeONh64Ul17CPWMb2WeMlBT1K8=; b=wQ2AvfskUC1icStSFZu+4juwevnlt3EfWARDfDDXjA1GtP4RR7c8iscuDINzW2+UtdsLO6 i4wUhMXLZF/A0VWvwnB9fge6GrJWWhvdGSnIAzvOxsaSXyS54E3NWUSpFPNtBlHDGDhSye 8FDoA/Maw5N+Jm8X0oEpvdLUpdmFLNA= Received: by mail-qt1-f172.google.com with SMTP id d75a77b69052e-460a8d1a9b7so253771cf.1 for ; Fri, 18 Oct 2024 09:04:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1729267476; x=1729872276; 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=txzJ41KP+IG2jzYwjNeONh64Ul17CPWMb2WeMlBT1K8=; b=JkKPn5Yu7mzjhTG1c2vQtgpM2WT+za6ynhnqsYbHqSQKAwyYFgX7RP429d1l+68ag1 mGqV0D05SFDUCzgg7W+rydwyxx3EH87ywrx9SjQ0D51PpE9y+MlLF96Re0ttVtdHJWkp L33P9nOVaoVFlIGWpnTv0eWWirfie1poxFnImq2n3yxOXlm2zDPHR6XvpcTs28oPWumZ d2WeZwUYAUC0UzSpR/gAZsyGQOA9KGXoYhVg4HpoA6cDCHhynnjeO/yXAqQkJxFu0ShQ f9sBLc/GXorLeTezWJHktNg+XF4WXUzhoWV4X85D+0LCUem0PfqmnngLMUMh/XSjKG9q 7Txw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729267476; x=1729872276; 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=txzJ41KP+IG2jzYwjNeONh64Ul17CPWMb2WeMlBT1K8=; b=mOwSvVjI4kEWFL4dcLEpx7BnpNH2mQObmR+FmR8yGHpYB7+B8NRqQ9Nw9LbW7tOYN7 2SgYepo8nMAH6tm2rDtNKoJQ7pR9yn5mKD2i0kvik0/28LRTVIjSGLHn+Uaa2AybBzfY ILSfpA5l1L+49VR+LpzxFxwFDNtI+zqBjyC3LEUoJHrzw7oLDfGOkjmey8xdxIIZu3WV 5HATwGZVP+vrqoLg2NbBsZfWZkZddLYmiBmbDD7o3HLwJp9VqwuAC8rp9Fe9yBl5Ammt LYwfgU00Fb4dzd+iVebxxbMjPyg8WIAPe53DTanLLqsLEyawNJsX7RzZGpMftscYSz3F lmEw== X-Forwarded-Encrypted: i=1; AJvYcCWvmvl9ASvTVERgrcwpgK+qo0mjSa8rUTm02vFsTsifgBmYi7q0pe70cxyjI9R3nPq44FKyOF2ehg==@kvack.org X-Gm-Message-State: AOJu0YxRFg/A3nNkFb1debgw1mA46zO9cObOU0fsgxEa5/g/cO1tNC30 3eWS9neb7XPezbCIh05GaXWGiyKBmNnirj5GRwgGB4sJ6vNhtolS2/GTv8SSBVx6anvDRXfpAAz 6lvNG2O13zL9oo8/hPJqK3MENE0VKN4XhtPLM X-Google-Smtp-Source: AGHT+IFQG+EGiekTkeB05IxiF0O0r7KvtKqW4HJXohUooeRpV2q0MrbuBuWAeTds5JJTI5Aqfm71otuz2Ld2rT6smr0= X-Received: by 2002:a05:622a:7b0a:b0:460:46a8:9e67 with SMTP id d75a77b69052e-460ad735ad8mr3690811cf.10.1729267475834; Fri, 18 Oct 2024 09:04:35 -0700 (PDT) MIME-Version: 1.0 References: <20241014203646.1952505-1-surenb@google.com> <20241014203646.1952505-6-surenb@google.com> <6a2a84f5-8474-432f-b97e-18552a9d993c@redhat.com> <9c81a8bb-18e5-4851-9925-769bf8535e46@redhat.com> In-Reply-To: From: Suren Baghdasaryan Date: Fri, 18 Oct 2024 09:04:24 -0700 Message-ID: Subject: Re: [PATCH v3 5/5] alloc_tag: config to store page allocation tag refs in page flags To: Michal Hocko Cc: David Hildenbrand , John Hubbard , Yosry Ahmed , akpm@linux-foundation.org, kent.overstreet@linux.dev, corbet@lwn.net, arnd@arndb.de, mcgrof@kernel.org, rppt@kernel.org, paulmck@kernel.org, thuth@redhat.com, tglx@linutronix.de, bp@alien8.de, xiongwei.song@windriver.com, ardb@kernel.org, vbabka@suse.cz, hannes@cmpxchg.org, roman.gushchin@linux.dev, dave@stgolabs.net, willy@infradead.org, liam.howlett@oracle.com, pasha.tatashin@soleen.com, souravpanda@google.com, keescook@chromium.org, dennis@kernel.org, yuzhao@google.com, vvvvvv@google.com, rostedt@goodmis.org, iamjoonsoo.kim@lge.com, rientjes@google.com, minchan@google.com, kaleshsingh@google.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, linux-modules@vger.kernel.org, kernel-team@android.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 1A23540014 X-Stat-Signature: bu1mbwksj3thyi5brnoo11r3j99tzy9n X-Rspam-User: X-HE-Tag: 1729267471-354006 X-HE-Meta: U2FsdGVkX1+XCHOlhUzHqMioswJZE00/2ZQ2w5+aRU6jwWvNl7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em36DW3wHbwdL4nNX3ycmQPSI2htHyw/mrLgzaWyXof6DXDv33WvFbkqwBKaDVpwrgvIw7AsoEV1fUqPuHuJhqjlbjEnvJOjhtrW+huvgGGEozIlJ0t643IRuDOZbfQ23tZSG59TfhuZhXq+mnAH0VHrTo7pxwwK7Ajq5f4yEiGZhSMSNaLejo2zwwwU= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000007, 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 Fri, Oct 18, 2024 at 6:03=E2=80=AFAM Michal Hocko wrot= e: > > On Tue 15-10-24 08:58:59, Suren Baghdasaryan wrote: > > On Tue, Oct 15, 2024 at 8:42=E2=80=AFAM David Hildenbrand wrote: > [...] > > > Right, I think what John is concerned about (and me as well) is that > > > once a new feature really needs a page flag, there will be objection > > > like "no you can't, we need them for allocation tags otherwise that > > > feature will be degraded". > > > > I do understand your concern but IMHO the possibility of degrading a > > feature should not be a reason to always operate at degraded capacity > > (which is what we have today). If one is really concerned about > > possible future regression they can set > > CONFIG_PGALLOC_TAG_USE_PAGEFLAGS=3Dn and keep what we have today. That'= s > > why I'm strongly advocating that we do need > > CONFIG_PGALLOC_TAG_USE_PAGEFLAGS so that the user has control over how > > this scarce resource is used. > > I really do not think users will know how/why to setup this and I wouldn'= t > even bother them thinking about that at all TBH. > > This is an implementation detail. It is fine to reuse unused flags space > as a storage as a performance optimization but why do you want users to > bother with that? Why would they ever want to say N here? In this patch you can find a couple of warnings that look like this: pr_warn("With module %s there are too many tags to fit in %d page flag bits. Memory profiling is disabled!\n", mod->name, NR_UNUSED_PAGEFLAG_BITS); emitted when we run out of page flag bits during a module loading, pr_err("%s: alignment %lu is incompatible with allocation tag indexing, disable CONFIG_PGALLOC_TAG_USE_PAGEFLAGS", mod->name, align); emitted when the arch-specific section alignment is incompatible with alloc_tag indexing. I'll change the first one to also specifically guide the user to disable CONFIG_PGALLOC_TAG_USE_PAGEFLAGS. When these happen, memory profiling gets disabled automatically. These two cases would be the main ones when the user would want to disable CONFIG_PGALLOC_TAG_USE_PAGEFLAGS to keep memory profiling enabled. I also think when we auto-disable memory profiling at runtime like that, I should make /proc/allocinfo empty so that it's apparent it is disabled and the user does not use stale data. > -- > Michal Hocko > SUSE Labs