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 65708D3DEA0 for ; Fri, 18 Oct 2024 17:08:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8BB796B007B; Fri, 18 Oct 2024 13:08:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 86C466B0082; Fri, 18 Oct 2024 13:08:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7332A6B0083; Fri, 18 Oct 2024 13:08:27 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 55D856B007B for ; Fri, 18 Oct 2024 13:08:27 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 44F0C1411ED for ; Fri, 18 Oct 2024 17:08:14 +0000 (UTC) X-FDA: 82687356360.15.27C943A Received: from mail-lj1-f172.google.com (mail-lj1-f172.google.com [209.85.208.172]) by imf15.hostedemail.com (Postfix) with ESMTP id A1E62A0012 for ; Fri, 18 Oct 2024 17:08:13 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=suse.com header.s=google header.b=DHbwcSUE; spf=pass (imf15.hostedemail.com: domain of mhocko@suse.com designates 209.85.208.172 as permitted sender) smtp.mailfrom=mhocko@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1729271110; 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=OWlja0ncpRimS1KnaLy3/LNPFh3lK39/ETwogwVX5bI=; b=so9YSjgMQXaZUnzQvx8M+0ejGFVa7PkMBBy3wbYo8ELbeR+VVfuDtUPDvJraUpMas7futj eN6X3NExUutRbbu6QQKnbmFQpOvvx7bvF8i5q8vPZwV396GJSBicY8b8jnqgK61pE7EzRN Rn2z33MBxsKeZd0h1ZYGvY+UK/149rY= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=suse.com header.s=google header.b=DHbwcSUE; spf=pass (imf15.hostedemail.com: domain of mhocko@suse.com designates 209.85.208.172 as permitted sender) smtp.mailfrom=mhocko@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1729271110; a=rsa-sha256; cv=none; b=JsNGlUz/Dyv65AGTgxfJU3wy3DRbb93WO/Cupe2BbkVn0eyXV6ZOptrmO6mCqnwZ96EeMs p8hYRUyM/zHSb4Wb3xnkukXPCNP4vX3WB8tXWEmqf+Y3q2SnUWIa6FS6zbNb9ZmzLiGrD2 Nrt7HLu+XYzCwq9xBv22mHzHwKQi5pg= Received: by mail-lj1-f172.google.com with SMTP id 38308e7fff4ca-2fb50e84ec7so21001501fa.1 for ; Fri, 18 Oct 2024 10:08:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1729271303; x=1729876103; darn=kvack.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=OWlja0ncpRimS1KnaLy3/LNPFh3lK39/ETwogwVX5bI=; b=DHbwcSUEA2yNbgf+Neebb/vGkDa++9bWcOrzK009TF+6F1lxZ4918RJTXn9Rd7hcvd shUqiechrdussXaP5ef41UFNivOZVHz6y/llX423rCoVda5GFqQC+Bn1gjrU8nSdI7Nf w6AiouG/dSe4pYXyjxHZj8veuRUPrG3kbOiTL4iddQePqLH0E2IgsYRyW+6FDrSH0n+m oRI2nPRfetDf5p7F2VwTrHyjqVbd1/fyxwS3uhw8blg3WOZFUPeJWHWqYDjPORQzCJk7 daufJFPYg4MhtvDGDaULG6hMuNQ0t7CrWTmkz86mjSuduUkxV6dawQMXXLC2kI06lyaD kx0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729271303; x=1729876103; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=OWlja0ncpRimS1KnaLy3/LNPFh3lK39/ETwogwVX5bI=; b=WC6P2/kwxLQyr7qh90LgzLtpfh4x5O2hFd6eLIrbHr0DYMleS970hkCoHxEJNKRm5S 8l2x0m0kJw/TFFWCa87NofLZRvhbKqrsBLFw5Y0Jx3i98gGQi6V1sb4lsxcQiqeMGYKf Doqs8J1WIq56pxR6HPC1vnydYSX6JRmUyM2HZccLXIRdYscVUqMlSBpD+TUBkpvcYhPN imucstluyvnJ4gCRTLFwM5FBWIqFJpzwAsX+BUPNV5fdaeJ4JYUfV2lwrxyD8QgvFaCp TvkXhRxHfxk8AY94O11dLqxjJHO26KFNlYKialW2txqat0MCCRrHDQeIB6Z2WtUFUeuU xePQ== X-Forwarded-Encrypted: i=1; AJvYcCXbgNSEak/O2xWERsFI8OGqVWrQB2t2rRZfO/TNfOBgdnIjGileBLfoGVJLtQykNMhr/k4J6nZp2A==@kvack.org X-Gm-Message-State: AOJu0Yw0nto05yjs7ydl1xga72lMk14oaJFOl7gvIy2f3rwTngqS6Aae Bhg1/M2va7oahPysnLGMCv6hnyYxRP4zefT+JxD2X1r8pxAKjeJkR8Dv7Hynb9U= X-Google-Smtp-Source: AGHT+IEoOYixU3j4FTjyHEPmwQ4j8jzTk9Gr33/mgkWnbpSfAHz7OIgIar5gJpwNSHyBDhu8Ljp8CQ== X-Received: by 2002:a2e:bc03:0:b0:2fb:5168:1a0c with SMTP id 38308e7fff4ca-2fb82eb03eamr17936621fa.19.1729271302829; Fri, 18 Oct 2024 10:08:22 -0700 (PDT) Received: from localhost (109-81-89-238.rct.o2.cz. [109.81.89.238]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5ca0b08caa6sm953220a12.56.2024.10.18.10.08.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Oct 2024 10:08:22 -0700 (PDT) Date: Fri, 18 Oct 2024 19:08:21 +0200 From: Michal Hocko To: Suren Baghdasaryan 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 Subject: Re: [PATCH v3 5/5] alloc_tag: config to store page allocation tag refs in page flags Message-ID: 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> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: A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NDxMdicTWD9u3TYafRFZk7JY5DpBljIKbmm+5aNmHMfjo1sgUFdmwArDt7GSkpGBtwnxOCq2TjEPcLuKwMcAC6cW18+NCFyjAlrDwnAwH/wA2km80KkOia5K2qOmJR7vNqh+D7CW/3sdREon1QHH9kpuKMApBtOhpQbeRXMHCi+2Nm1VMQsCA8wuv8a4+ejPgV8PPGAeCSHXBbS/52FfWqup6J3Ki2cvpOFalkL593yVktIhWBmOzd6q1yPM9AdZ3bcJpKHy+ndsET3Yd0deII0XTPBn574JS/DuhQu3+fWtcpRVVHrQwrSCre+tPExyOYz88T0Uhy/Hvetp/iY9cRyo7OGW9GACKz+gNJDFZFSR49B+KYK5/rMYBFHrR/3bSkkP5nJoCngvgL9BSQ53bMn0M/UHxvSXios42zMqtVzTIrY+pccGprpaKit1Ee1aoxpv6TBoaYvgfu3SE 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 Fri 18-10-24 09:04:24, Suren Baghdasaryan wrote: > On Fri, Oct 18, 2024 at 6:03 AM Michal Hocko wrote: > > > > On Tue 15-10-24 08:58:59, Suren Baghdasaryan wrote: > > > On Tue, Oct 15, 2024 at 8:42 AM 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=n 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. You are asking users to workaround implementation issue by configuration which sounds like a really bad idea. Why cannot you make the fallback automatic? -- Michal Hocko SUSE Labs