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 8F5BCD15DB7 for ; Mon, 21 Oct 2024 16:16:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 02BF86B0085; Mon, 21 Oct 2024 12:16:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F1F226B0088; Mon, 21 Oct 2024 12:16:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DE70E6B0089; Mon, 21 Oct 2024 12:16:28 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id C4DBF6B0085 for ; Mon, 21 Oct 2024 12:16:28 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id D99DD1A1A41 for ; Mon, 21 Oct 2024 16:16:00 +0000 (UTC) X-FDA: 82698111342.01.40FD59B Received: from mail-qt1-f170.google.com (mail-qt1-f170.google.com [209.85.160.170]) by imf26.hostedemail.com (Postfix) with ESMTP id 8F9F8140022 for ; Mon, 21 Oct 2024 16:16:15 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=pA7IeDre; spf=pass (imf26.hostedemail.com: domain of surenb@google.com designates 209.85.160.170 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=1729527310; a=rsa-sha256; cv=none; b=6lL5ls8rmVSQobcaNQ9sCPKxPlSbzscVClGuEmsEXuytRFTOWgI0/MF+qgJ9kad/9xwjvU Wlfe44pLtGHLchcdF1yXhGmfOoHBeRVGqtRxKY+YVEuhqSne5A8s5hMv16LRq4eYFAQluk nKM8iF7uCNBpgL+ZT4Z0kr8DPh/zXUg= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=pA7IeDre; spf=pass (imf26.hostedemail.com: domain of surenb@google.com designates 209.85.160.170 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=1729527310; 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=ayXmbob9V4y/ySOfVlxsuHYrsBNUOW7x+7DtgnXABUo=; b=ezb9AmBEIFLc0gZeUvARWKWS/gq+X4QC884njB62v6qVsXPV72PAl67vVBuM08w+jwGRgT pPTV1yumq7ckr6/1eHQ1lZCkjfF/0hSUxGPvzh5aIZmAGe/6/nzWNsxyqf9f/f7KMWASvH dlAGd7uYn4+vAoTT6XJlcQ9EwVbl+xI= Received: by mail-qt1-f170.google.com with SMTP id d75a77b69052e-460a8d1a9b7so350441cf.1 for ; Mon, 21 Oct 2024 09:16:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1729527386; x=1730132186; 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=ayXmbob9V4y/ySOfVlxsuHYrsBNUOW7x+7DtgnXABUo=; b=pA7IeDreK8No8YXpyjxQ5uv4i45mhiVrsjReoThXfA//2WtKKgBsa77emwYqR8R+0Y P0AK8LBTOyuB43YWt/FJB10kwP/uo9i0B2jQjR/XEJT6WUPXiYkNBpwGZ3oPcYrOLE1J VHAQCfvnEhLmXrfyUpqqTOL5AwLA4VvUDKiFGXbY/uzIDioi9gWcSqMfTlI/NCQk4dLI ekGb5Ll4iEnboEz24dKa6OuyRCp7UJUECQneUYVxRKIKC26V1lvWcTpqW9VmpCy9vrvX 8GxnLr1hhwo+6EnmcHmibTI5jXr7oQiSKKgGTThHjOOA9BcS7I/6Iys2gOVZEEWtSGfQ 0WCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729527386; x=1730132186; 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=ayXmbob9V4y/ySOfVlxsuHYrsBNUOW7x+7DtgnXABUo=; b=wI40Ffca1OzHt7h15zKGqjlvWo3s0vPy5GdIx3gFw/foAqgCghRo+yvDLypPWwzt+k Ap+p0y1XaeAC3ZjtoCbOSCWZc5RHftqXVYqyKIIg4OuIkb2u4rP4w8qNlnZ7SjcDSmpS nt56AL3fMigOqB7BB3vjbqWGztdXi6eWeZkqwSkyWJs6gdXGN9A+2IwGbmjTNuOCAYuf SlKPgHfNWzf4k2l+u/uZSlWoWdQmWJjo9SnKdiZEeRvd45sc4qIAIeveYa1uMV/RxqvB GrzHeuAmC1wBTzmzSx1cyCkxAuPSh7wjQDpKZ0KQC2kO7WS1PUP6O7VPp7hFzMgH5DPA BIyg== X-Forwarded-Encrypted: i=1; AJvYcCUwwjySb7StkH9Q2ypOZcgWayDTQ0dZeGP76C+w+gr47XmTH8zr2k0v3s7s/wuGbU+U/yFtBr1YJw==@kvack.org X-Gm-Message-State: AOJu0YwjgrxAL3d42GnJx4ct3thptdrc+A9BHIkUFyeJlVbe1wFn58Rs M2HpFj9wL885wcVHgnBxRVPWSYEOkbTCpK6ZeWypqmotmQxxR55kQ/NaHtjwobBIKnCIa76WfkR 7YqUgV5hDES5wkRwJkUFwRcJUdpWkfthEb3v6 X-Google-Smtp-Source: AGHT+IHu5uuCEIILVBFJcgGkovHuVbQvTad5oHeICGXHHCDN4MgHytihaDQwCWVdBHrIMPwEdvBuRY5y34KQCj9Y2Os= X-Received: by 2002:ac8:5a16:0:b0:460:8406:2c2c with SMTP id d75a77b69052e-460be5cb3c7mr3983251cf.25.1729527385509; Mon, 21 Oct 2024 09:16:25 -0700 (PDT) MIME-Version: 1.0 References: <62a7eb3f-fb27-43f4-8365-0fa0456c2f01@redhat.com> In-Reply-To: From: Suren Baghdasaryan Date: Mon, 21 Oct 2024 09:16:14 -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-Stat-Signature: 91mr4u37hjapowknxa448nou8zkgqefk X-Rspamd-Queue-Id: 8F9F8140022 X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1729527375-13338 X-HE-Meta: U2FsdGVkX19wZAmH6ynL6Pfq/8ypr87jb5dacj/3p9pw8krZYpqf07KCGUXRQOfqGTKUNHCM0lcqmcZ12+uvkbp1btENWOegj1zgrCaUw4sdB8Rhb51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rdigpzscget5IzmYWLtEe6/PnPGjENZC3GwM3/9vrwAwVowfnAR6bleCiMFwdFtkFaJ8rSTr1Rnf69uVIOaaP0H6W0RN0fqC131S4= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000001, 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 Mon, Oct 21, 2024 at 8:57=E2=80=AFAM Michal Hocko wrot= e: > > On Mon 21-10-24 08:41:00, Suren Baghdasaryan wrote: > > On Mon, Oct 21, 2024 at 8:34=E2=80=AFAM Michal Hocko = wrote: > > > > > > On Mon 21-10-24 08:05:16, Suren Baghdasaryan wrote: > > > [...] > > > > Yeah, I thought about adding new values to "mem_profiling" but it's= a > > > > bit complicated. Today it's a tristate: > > > > > > > > mem_profiling=3D0|1|never > > > > > > > > 0/1 means we disable/enable memory profiling by default but the use= r > > > > can enable it at runtime using a sysctl. This means that we enable > > > > page_ext at boot even when it's set to 0. > > > > "never" means we do not enable page_ext, memory profiling is disabl= ed > > > > and sysctl to enable it will not be exposed. Used when a distributi= on > > > > has CONFIG_MEM_ALLOC_PROFILING=3Dy but the user does not use it and= does > > > > not want to waste memory on enabling page_ext. > > > > > > > > I can add another option like "pgflags" but then it also needs to > > > > specify whether we should enable or disable profiling by default > > > > (similar to 0|1 for page_ext mode). IOW we will need to encode also > > > > the default state we want. Something like this: > > > > > > > > mem_profiling=3D0|1|never|pgflags_on|pgflags_off > > > > > > > > Would this be acceptable? > > > > > > Isn't this overcomplicating it? Why cannot you simply go with > > > mem_profiling=3D{0|never|1}[,$YOUR_OPTIONS] > > > > > > While $YOUR_OPTIONS could be compress,fallback,ponies and it would ap= ply > > > or just be ignored if that is not applicable. > > > > Oh, you mean having 2 parts in the parameter with supported options bei= ng: > > > > mem_profiling=3Dnever > > mem_profiling=3D0 > > mem_profiling=3D1 > > mem_profiling=3D0,pgflags > > mem_profiling=3D1,pgflags > > > > Did I understand correctly? If so then yes, this should work. > > yes. I would just not call it pgflags because that just doesn't really > tell what the option is to anybody but kernel developers. You could also > have an option to override the default (disable profiling) failure strate= gy. Ok, how about "compressed" instead? Like this: mem_profiling=3D0,compressed > -- > Michal Hocko > SUSE Labs