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 04BD8CFC277 for ; Tue, 15 Oct 2024 14:59:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 721DB6B007B; Tue, 15 Oct 2024 10:59:24 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6CEBB6B0082; Tue, 15 Oct 2024 10:59:24 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5BDCD6B0083; Tue, 15 Oct 2024 10:59:24 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 402846B007B for ; Tue, 15 Oct 2024 10:59:24 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 1A46481734 for ; Tue, 15 Oct 2024 14:59:16 +0000 (UTC) X-FDA: 82676144586.20.7F2FA2B Received: from mail-qt1-f175.google.com (mail-qt1-f175.google.com [209.85.160.175]) by imf05.hostedemail.com (Postfix) with ESMTP id CB9C4100005 for ; Tue, 15 Oct 2024 14:59:07 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=pMYpNDGM; spf=pass (imf05.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=1729004288; a=rsa-sha256; cv=none; b=Iqiygt/dnX1QViTRRtkHC0sKyGALNyp2TyCFJvHhDzkTTxU09wsGx6LJZovjmjQ+iTbpgB XBlJ7jw7CocGqsPXi712OIWOwB/dPa5puaS7MGMby8FT8WDIaVkk6ijMJz+91Zn36kbZKc 5zI+KN+B9ZJ4acGvI1BUD742uz4IlSI= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=pMYpNDGM; spf=pass (imf05.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=1729004288; 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=ReNaXLa7EDSRsWOehh9otylGaRM81/DA1a4vQfbmQsM=; b=J+X4IvxhOGDW+IQp30j1DmPwhFXRzTQrrFWI7QWTE6OyGw+917r11RUsDg/I287vM0zkwH k9W5Gy5k+l7840eFoXaOPazNfobIwT3jmOw3Vqn7D2Ok835C8btDa+1BDOTA4+Jn9L6H81 jMHiYPWYiYWLB3Fsf96j6B0EIrq46SM= Received: by mail-qt1-f175.google.com with SMTP id d75a77b69052e-460395fb1acso758571cf.0 for ; Tue, 15 Oct 2024 07:59:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1729004361; x=1729609161; 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=ReNaXLa7EDSRsWOehh9otylGaRM81/DA1a4vQfbmQsM=; b=pMYpNDGMOtRfT79qTlpXYyzonVVp2cVcgl7eEYG4VWAbFvbIG9TAbW477M/bCO8Wqy P/9I3iQw+ykuq2wooZM7BO7mwg5sLfIwx6a50bvZaA8+EcBP3PZOZZ4yoQ7Uiy77h/D4 pSoUFp90mq3kOPUemfTYVVGlcNeNF/DVmBed+orJivSR2RG+YcJ4inJmOHi6tCfF261c x3n309E0vEv/eRkgIVtacHSyQRvRIF8KGZweSMadrWjaSZ8T8rsOV0YHFRx0C2Ssg1w4 6R3ez/4sosCqrIw05FzOBF3CK0bA8L/uULe3DFkLV5t8LU6vtRU99jkozSakVG0fNomb cTvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729004361; x=1729609161; 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=ReNaXLa7EDSRsWOehh9otylGaRM81/DA1a4vQfbmQsM=; b=NxrLDG05v1fmhk3MBnby24iK4mqg6X0cjI98y0BjzCi/22lF/Sf24DAg1tQEJy1RxM OBYUPk++NJUyxFTMNUexKw6YfD2dlQvM7YXoVWp4bpdFyj2AAKsSI1ARN16fD8OoxzZZ 13yoBlpv+Atm/S46cBzr3P8+/JcOA2+MOVR9NLX89LGAgLxu+VzUJ6kEn2/mTwnqlNsU VIh5lKmCaE3rc8f7E5RFsqyPlnsiRbM4vUPphJcN72YYVXYoRYPcxjP45L8NZTp0eCtm Z3ZoemjGA6yqGMo9SM+/bta9YWwWJoYgBuuRWPtABD3c3Xo4w/YgmL0FXEtRfFty/Ay9 eohA== X-Forwarded-Encrypted: i=1; AJvYcCWUCD5RxA4sltsXCOovm0zxeRxO88bvv63Iem9sQyQiekF+mhH8Ke91k1Yn3RPbQPCwoZR4GzQn6g==@kvack.org X-Gm-Message-State: AOJu0YxY4qJG2X9thp7ZTTVZJl1GHrevVYNZxPNgKMBF5fOyKdsOnYmC y3K3rL91d3GeFw0w5Taxed6vuzxS6IFmif1kJS/Ca/Hit5BficEl/U9HJr0qFNZNQV6dOnQyflC MsTvEFDeArEak4SzusWQPxEmNcZiLF6YHlWVF X-Google-Smtp-Source: AGHT+IHJlsYKE0BFpFyNwkK2d4xoCapcyo0nTBR4tuj5bDK0HvMMgpUVhfrZLI7tVRfTncBnkVgj2gcuDf9UaJ6fHp0= X-Received: by 2002:a05:622a:5489:b0:460:4841:8eb5 with SMTP id d75a77b69052e-46059c77626mr8399751cf.19.1729004360796; Tue, 15 Oct 2024 07:59:20 -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> In-Reply-To: <6a2a84f5-8474-432f-b97e-18552a9d993c@redhat.com> From: Suren Baghdasaryan Date: Tue, 15 Oct 2024 07:59:08 -0700 Message-ID: Subject: Re: [PATCH v3 5/5] alloc_tag: config to store page allocation tag refs in page flags To: David Hildenbrand 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, mhocko@suse.com, 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: 9s3epfwwcgr73peqyamkroitcqhaf43p X-Rspamd-Queue-Id: CB9C4100005 X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1729004347-642871 X-HE-Meta: U2FsdGVkX19A1iCJfTDNqHkGDSJ5QhJbkQYdkBJIwm5Mpp5g8uIh54QOHx2M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0CaN5nUp9F8ZUiFWcblKDbock0MS02VPROBX1Y7CNORkJXmCfvQxy2BH9lBLeosYncoMLvaWRY41JB5dGKaXBXjz8i50BSRPpE9JNVfPkyjQetk6VUmNWoHRhCcqE1/qtaM1h5P8UX X-Bogosity: Ham, tests=bogofilter, spamicity=0.000377, 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 Tue, Oct 15, 2024 at 12:32=E2=80=AFAM David Hildenbrand wrote: > > On 15.10.24 01:53, John Hubbard wrote: > > On 10/14/24 4:48 PM, Yosry Ahmed wrote: > >> On Mon, Oct 14, 2024 at 1:37=E2=80=AFPM Suren Baghdasaryan wrote: > >>> > >>> Add CONFIG_PGALLOC_TAG_USE_PAGEFLAGS to store allocation tag > >>> references directly in the page flags. This eliminates memory > >>> overhead caused by page_ext and results in better performance > >>> for page allocations. > >>> If the number of available page flag bits is insufficient to > >>> address all kernel allocations, profiling falls back to using > >>> page extensions with an appropriate warning to disable this > >>> config. > >>> If dynamically loaded modules add enough tags that they can't > >>> be addressed anymore with available page flag bits, memory > >>> profiling gets disabled and a warning is issued. > >> > >> Just curious, why do we need a config option? If there are enough bits > >> in page flags, why not use them automatically or fallback to page_ext > >> otherwise? > > > > Or better yet, *always* fall back to page_ext, thus leaving the > > scarce and valuable page flags available for other features? > > > > Sorry Suren, to keep coming back to this suggestion, I know > > I'm driving you crazy here! But I just keep thinking it through > > and failing to see why this feature deserves to consume so > > many page flags. > > My 2 cents: there is nothing wrong about consuming unused page flags in > a configuration. No need to let them stay unused in a configuration :) > > The real issue starts once another feature wants to make use of some of > them ... in such configuration there would be less available for > allocation tags and the performance of allocations tags might > consequently get worse again. Thanks for the input and indeed this is the case. If this happens, we will get a warning telling us that page flags could not be used and page_ext will be used instead. I think that's the best I can do given that page flag bits is a limited resource. > > -- > Cheers, > > David / dhildenb >