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 58D94D0E6D1 for ; Mon, 21 Oct 2024 09:14:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BB83A6B007B; Mon, 21 Oct 2024 05:14:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B68156B0082; Mon, 21 Oct 2024 05:14:00 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A081C6B0083; Mon, 21 Oct 2024 05:14:00 -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 82F236B007B for ; Mon, 21 Oct 2024 05:14:00 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 3AFDD141839 for ; Mon, 21 Oct 2024 09:13:44 +0000 (UTC) X-FDA: 82697046978.30.E8234E7 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf16.hostedemail.com (Postfix) with ESMTP id 52366180011 for ; Mon, 21 Oct 2024 09:13:43 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=f0tb2U6p; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf16.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1729501873; 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=laNZkwIbOwCUsbOEzRR8/YU1OhJt9JdhAA++t+a3gVA=; b=UBLreLQLoGyejauPQPbR4r1aX8YNlwyvhxzKxcDRvvRa9v8OB+x+t+lt8UU6Hvo90LlxVi Ir01dLgVSPDvgc1A29oJnrI3f5WfLt5jZT4gN+Tt2hGeR5npS2enFIZGaD9tTCaNhE6Eib GxRfhzVOPvOc6vAx2skEWJ2UM+UY/TI= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1729501873; a=rsa-sha256; cv=none; b=J+etTeyJYjZ7+H0Oga4NHKGVieFPvoZDd+cPXGlsLbtTFSi8ZCJ/AfpzgQDdk448tMCdtO pDp7k5UNr5zePsPlNtkDmtCkDCFA7mEUkiIf9ZWjPtirVY9i1qG9hqVw0NTOHzzkEOw0yZ jd9Szwi4FJKfmGgwHntW3o+tC5j4Aro= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=f0tb2U6p; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf16.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1729502037; 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=laNZkwIbOwCUsbOEzRR8/YU1OhJt9JdhAA++t+a3gVA=; b=f0tb2U6pc/0AbXetj9cCU/Vv8vR4iDQBhbe8A2o+FqR5LqK8xvXlAcoAYpT0Fmw1K3j2TB kyobQ69Q33lImMaW1ydAdMqAnvJmqifhlYco7TUYEuiA8xggnYAe9FGJMOxibQeklWz89G NfAWnIIErlZ0LVmQaMETTqF+e21u+68= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-34-TfvxE_qJP0WhBtmwpKggJg-1; Mon, 21 Oct 2024 05:13:52 -0400 X-MC-Unique: TfvxE_qJP0WhBtmwpKggJg-1 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-37d589138a9so2314946f8f.1 for ; Mon, 21 Oct 2024 02:13:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729502031; x=1730106831; h=content-transfer-encoding:in-reply-to:content-language:from :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=laNZkwIbOwCUsbOEzRR8/YU1OhJt9JdhAA++t+a3gVA=; b=fd7FZS18M9sfD6AgcPWGu+vZ17JOww3LhgsU7qR2u42E5iupoDzYS5OcIoooAn9BxT kgPIjvsr6xYB8RyYF4sIylK2w+uBxOnJfKqvA2UWV2b4IU+Bd1dbmNoqUFAnHtFGqiHV nz7oMfvmoNHB5S2MYlGWIXbhhXLfPyOobnbLSt3+pLoE8/9Rc8L5wTWPwm3/Z+fA5LKj OLUV3pJM0jchaozuTzdwTcTRPTnoWAoDRqJ2X5FUR1dRYE4AeRTO+WuUTe+TmQhWs+dw j0JIMBvqiFDm5xOZRaOr95kzZeB87Ef4YiKvs5Jyk46eorzdte5qeqlyFI1PPEtAqULf saIA== X-Forwarded-Encrypted: i=1; AJvYcCUUp53mNL0QVizqV2cv/b2DFjB/16R9OYFwD+P8EDhnRCsVW0s+FuOv8Wfx30txr1f+iL80sgSwTg==@kvack.org X-Gm-Message-State: AOJu0Yx3owW0U6R5fJt528BOJ/mwBJxBwa9iqBc5sJcszuX2AfJGyIsQ /0ss9fxCRmgwsHh6BDgaY/4S+1ygqHH4h8Zf1jUqfnaVmwKwj3GfVnC3jcWUlvYPIVLCG1ygMC9 95cEkpAtGWGnRJDaq3+Vk/JjYGgJXA1MPbtxRVKrPQmnzMTn7 X-Received: by 2002:a5d:60cd:0:b0:37d:52d0:a59d with SMTP id ffacd0b85a97d-37eab72732cmr6823858f8f.10.1729502031065; Mon, 21 Oct 2024 02:13:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGf2q3ct7vDUcpXfTgq4f/Ogs1pSXSIZFsokW+/dUVWCwOUrBI/1w/NWhFvrEEHU/F3TQLS9Q== X-Received: by 2002:a5d:60cd:0:b0:37d:52d0:a59d with SMTP id ffacd0b85a97d-37eab72732cmr6823825f8f.10.1729502030651; Mon, 21 Oct 2024 02:13:50 -0700 (PDT) Received: from ?IPV6:2a09:80c0:192:0:36d3:2b96:a142:a05b? ([2a09:80c0:192:0:36d3:2b96:a142:a05b]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37ee0b944fbsm3841034f8f.72.2024.10.21.02.13.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 21 Oct 2024 02:13:50 -0700 (PDT) Message-ID: <62a7eb3f-fb27-43f4-8365-0fa0456c2f01@redhat.com> Date: Mon, 21 Oct 2024 11:13:48 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 5/5] alloc_tag: config to store page allocation tag refs in page flags To: Michal Hocko , Suren Baghdasaryan Cc: 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 References: <6a2a84f5-8474-432f-b97e-18552a9d993c@redhat.com> <9c81a8bb-18e5-4851-9925-769bf8535e46@redhat.com> From: David Hildenbrand In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 52366180011 X-Stat-Signature: imx75eokhcjsbhzmaeywo8gdra8rh6g5 X-Rspam-User: X-HE-Tag: 1729502023-966815 X-HE-Meta: U2FsdGVkX183zkiY2fWN7wZFqPQMIyLYaDPIBhuDEokDNwN5yfRiB0Yx33EMVGvK9pCG2u9ApYCFunvD1n3JfSmbJ8C0kbCjrWRpE1UrMx7+vcbKWFlih3AAJy3nWbKvhQR6IruG4Gv6wjEmeLTxK6QvE6p72BRQkFC0arPp6tTb3XHNhB8uAvMOpTHbW6rGGNXYjBnSrLAkUheOcV/CA819jaf6JNPfbsXxDeCT4QF9cVn8UaIo8whZI//Z4/5DLLLzmOUfEgA1/NXk1usLLbUa6P9fwQ6neBz0xLRjMGvN1Z4hXnZMGFjM1iNsveUoZCR1urD4iCtCR4cDv8e54HSYWx82BznnWflfRDeM3cC9DQNhLLifCDKU3ueoGCooO243GYdYzNis/O63zVPwob+7ZXAoJsSYRLN6opSBpG/xhcv7cQqCGnjWf3zPLqo7MHtdgxNizDyxf7td/yuWW8rGxJTRr4hCuBBzXqOT/sTLKqKoFJlc8X6fZUov15lmmDbao6ZOD4jjoK9UIl/cZiHictzeVf4VjC/nNDjMibWxSddgYv6NM3jogBpuPaWVf9iZiXc3N/T/8w/7zwvKWUXxsjQ4rcmI1EXuACoNCorAZVl4YPsLgV734gTkcLShF5UHzvSHt6uTtWZzR0q+FTfZDb+2yju3UFS5zCTBEfyBRuuzKKRRYUcp3ov+Fvnt0Y6divv0HO9OBzUqmvVpwc0XqyacoDFs291EtBzRFuWiDsy6pelMFDr8VLBuG0KdRgd0sZ6WAnvmbEoJxQkYTqSTQbZE5XaXlxLUc8zQ+FRs8+7r6kgUOmEjj9NA88iOYUdyxT4qSCdz5WN2rp8PiIH6wWezfEaijBEDc1GDE7ASGAVYhVBNHIljhMEe6P/PK/LSiXCN1xdc+iKQGDnuaJQrgaiPtiOBrRa0hrjDq6QzDPFTr8VL8k0Y3/ve7hFZwqTAPTVBo3PPmBHOUQz Pbt3d7YQ ibsFi5dURcYe7YD3BZxzh+3lY96298vW8CtzxssPuUR04Szj//VRbmu9lmHwYRrjIpXlhoi3ldujtF//3ou2ccx85vSjWEOPWOqH35GT5Oo17U5csZtCuIeTT8Ab7l4elj69rFIzwZbqWFcP+N+/dTQrsxDi7OswefN4Y2l5qowUMhzAksZlOWtH5iFr6cPZhz7P06sXA8AC5ZVI+21azvHQguoypNz3D/lhJ3BHcqU3Trp7ASXJUpxDMKOOy0zrnxufKzAhotBb6EQDj8AbguGKtFHtaGqDDfSubuwp537kREN5BiXnMeHwfXJSyjCQQ1ZV5Cz5PdJgpmo7aj5pVhYnVldzxxa4i4e8lKVO8l5oVg25QfmZ7Up2Kk1eY8zWWSxjGTyaC+gliAqRByuXPrey1qqpTzwpFYznfjg79DlMpoEaRgmD+t6ulRuEbcjcsDindKNon226PyeM5Ni+hyOl1Yoy/RBUsmHrn0uVLcoNbVfS0tQ5rH629R9WhpKYOSD2fomWA0efd3HHsJtn757JPwPNpzAp7q8eCEgxZ/kPuwMYNEeB5QduxbJBNlrs1c1ZxYQpCV6HH1d4= 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: Am 21.10.24 um 09:26 schrieb Michal Hocko: > On Fri 18-10-24 14:57:26, Suren Baghdasaryan wrote: >> On Fri, Oct 18, 2024 at 10:45 AM Suren Baghdasaryan wrote: >>> >>> On Fri, Oct 18, 2024 at 10:08 AM Michal Hocko wrote: >>> >>> Automatic fallback is possible during boot, when we decide whether to >>> enable page extensions or not. So, if during boot we decide to disable >>> page extensions and use page flags, we can't go back and re-enable >>> page extensions after boot is complete. Since there is a possibility >>> that we run out of page flags at runtime when we load a new module, >>> this leaves this case when we can't reference the module tags and we >>> can't fall back to page extensions, so we have to disable memory >>> profiling. >>> I could keep page extensions always on just in case this happens but >>> that's a lot of memory waste to handle a rare case... >> >> After thinking more about this, I suggest a couple of changes that >> IMHO would make configuration simpler: >> 1. Change the CONFIG_PGALLOC_TAG_USE_PAGEFLAGS to an early boot >> parameter. > > This makes much more sense! > >> Today we have a "mem_profiling" parameter to enable/disable >> memory profiling. I suggest adding "mem_profiling_use_pgflags" to >> switch the current behavior of using page extensions to use page >> flags. > > I do not want to bikeshed about this but to me it would make more sense > to have an extension paramater to mem_profiling and call it something > like compress or similar so that page flags are not really carved into > naming. The docuemntation then can explain that the copression cannot be > always guaranteed and it might fail so this is more of a optimistic and > potentially failing optimization that might need to be dropped in some > usege scenarios. Maybe we can reuse the existing parameter (e.g., tristate). Only makes sense if we don't expect too many other modes though :) > >> We keep the current behavior of using page extensions as >> default (mem_profiling_use_pgflags=0) because it always works even >> though it has higher overhead. > > Yes this seems to be a safe default. Agreed. > >> 2. No auto-fallback. If mem_profiling_use_pgflags=1 and we don't have >> enough page flags (at boot time or later when we load a module), we >> simply disable memory profiling with a warning. Sounds reasonable to me. -- Cheers, David / dhildenb