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 61D2CC0218C for ; Mon, 27 Jan 2025 07:01:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C271828011D; Mon, 27 Jan 2025 02:01:30 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BD6FF28011C; Mon, 27 Jan 2025 02:01:30 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A9E1B28011D; Mon, 27 Jan 2025 02:01:30 -0500 (EST) 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 8B98D28011C for ; Mon, 27 Jan 2025 02:01:30 -0500 (EST) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 42D541C6DBC for ; Mon, 27 Jan 2025 07:01:30 +0000 (UTC) X-FDA: 83052335940.06.7460E35 Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) by imf25.hostedemail.com (Postfix) with ESMTP id 61191A000B for ; Mon, 27 Jan 2025 07:01:28 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=aJjvtM3u; spf=pass (imf25.hostedemail.com: domain of rientjes@google.com designates 209.85.214.179 as permitted sender) smtp.mailfrom=rientjes@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=1737961288; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=d6nwyRUKCsNWbGoX5iljVTur3taYBTQI5qEJ7uoSJSk=; b=09/M8E+J7UHnlLJO9RMTEQM7zeGLargCpPj7CUJoKju0oSyLl3eL9WPli1/ql41QtIohi/ O1ic+pMBitaxtnGP8oNYUgcAT8zA0uSH2YK4wJEtcVlEvBk6NwG57USq/8QWmPMlojRUmS V+EIzyFF/ewysnTkPXwYghKlo70VCVA= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1737961288; a=rsa-sha256; cv=none; b=NGlgpId9DcN8IPfqrQiFBu95iemO7hmnXX+37pEH28HEJC8G1ooRg8+hGnVSjntvBHiDM3 flb5/MXd6GDv3e/QC6A00iX+7G5YXk7ZV2N9icDAmTuXxCupZ4NEP7yAxVgdWEt2ZxXX+u AIa8RWmmyGn3q7ENNH/2W4u4e88cdrg= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=aJjvtM3u; spf=pass (imf25.hostedemail.com: domain of rientjes@google.com designates 209.85.214.179 as permitted sender) smtp.mailfrom=rientjes@google.com; dmarc=pass (policy=reject) header.from=google.com Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-219f6ca9a81so138945ad.1 for ; Sun, 26 Jan 2025 23:01:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1737961287; x=1738566087; darn=kvack.org; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to; bh=d6nwyRUKCsNWbGoX5iljVTur3taYBTQI5qEJ7uoSJSk=; b=aJjvtM3uJOlQfcT5c+kEoQeoLWrQxiVz8HCX3FS5lRqEC5zofpfqY0XJgcR5VwUQ0S NLQqjN/ddJ++PjHxHfksqqHeMYB6SwOAf2BIN6YwgSJJWtru2jpE2TMYDdTDOxmtcaFD 35KhMZa6Swo+fkqZN//yV4KTyjVMTaCvuNhIUNb90A3v0X8gy4WMnWNf4mj24BCu+0CP bkbp09n/LB+CL/NrBfEUXIw70wsEwNmIShdBZkhrStzfSHPpNY02jn/NB+68ISReaP6g VWHLXZfPZGRUtY5bdjDIARH33j3cHZgUEGLMHazXrnZ5zvVHD3JdKaC8ZoKsTOdPPj+c ldbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737961287; x=1738566087; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=d6nwyRUKCsNWbGoX5iljVTur3taYBTQI5qEJ7uoSJSk=; b=NGeDjjTlsHgvejgfAXOCL5F4UPV9ma8NtSJ+NYjolw86soK4iky9AzWqx/Ictk/dHM be4R2qsfKECEgJvFacXTD7E/Vj1Op4hz7Vo3ro03kNTVIMvN4Zi8UTJP2ixqHvD9UalT sO5cpqr4rmgvkVatpuoyT1epJECq4XdcD0UaqLMO+Kd4C6kxzq2cQU9WoHk9CLDPmisQ QDUjus8CZkZyiaK81Cov8ARtNEGYBiiG5ITQIRASmoHAFm0GCBs8XWxSMeCOnsVphCzs 9Uv2n8IDoeMFJUKDMEMSETe2gY7FJ4HcGeg3+rIALDUyWB55kDlVYztfQDNpGF7p9/u0 ktIg== X-Forwarded-Encrypted: i=1; AJvYcCUtR59FAWfqkFGXNBO3xPbg5CSSHtvfJCFkLt7fGyLHyaQUaohYROlWtH+Be9Bu6fSivqdZ+xhlLQ==@kvack.org X-Gm-Message-State: AOJu0Yy+EzgcD99HxRI4iL0Lf+VuLPXGj7Ny6x5RAVevTHYcGxWn+5Mj vvUd/DE1RFLbyUenW2PtGDyzt1SFopjW9G/bBux+STuVa2SUfxPDbHzFe+VTqA== X-Gm-Gg: ASbGncsBicjaPksx1eT02XPJ6q0voL7RSZa8mKd42RV6E5rBmPABUmBpKmgub0p29zt /GidEzhZ+v08PkBd4IDrdvLsHAL2y7Xc5QXwtxKxLmnGxnjjD/a3676/oBM4XQv3Kdpr6aCAQtz RekitHGtEU/5hpqnH2LvZ9u7SWdXUKFXj4BdmBo1PIK9HzhtbZP4E8q1wNQV9FImmq62wd4Zwhh MyAemRHZ8kFInSF5YhvV1P2gNs+J5aF+bITiB+9/WCv+RGPFbsple0TSum7JlPY/TLbiW7YOA4l 5N/ytywhzXpcjjjY5wTC/4DNirj/Bartf/8= X-Google-Smtp-Source: AGHT+IEX+vMbPpgOyhqwtT8txMxa/aJ6xnhP7cnm2jQB9azYEibJeaVQ1w0SGNCFluWdQ5i8Sbe37Q== X-Received: by 2002:a17:902:cf03:b0:21a:8331:c23b with SMTP id d9443c01a7336-21daf172701mr2940885ad.28.1737961286787; Sun, 26 Jan 2025 23:01:26 -0800 (PST) Received: from [2620:0:1008:15:a895:32e7:423e:b2d8] ([2620:0:1008:15:a895:32e7:423e:b2d8]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21da414cc61sm55454425ad.164.2025.01.26.23.01.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Jan 2025 23:01:26 -0800 (PST) Date: Sun, 26 Jan 2025 23:01:25 -0800 (PST) From: David Rientjes To: Raghavendra K T cc: Hyeonggon Yoo , "linux-mm@kvack.org" , "akpm@linux-foundation.org" , "lsf-pc@lists.linux-foundation.org" , "bharata@amd.com" , kernel_team@skhynix.com, 42.hyeyoo@gmail.com, "gourry@gourry.net" , "nehagholkar@meta.com" , "abhishekd@meta.com" , "ying.huang@linux.alibaba.com" , "nphamcs@gmail.com" , "hannes@cmpxchg.org" , "feng.tang@intel.com" , "kbusch@meta.com" , "Hasan.Maruf@amd.com" , "sj@kernel.org" , "david@redhat.com" , "willy@infradead.org" , "k.shutemov@gmail.com" , "mgorman@techsingularity.net" , "vbabka@suse.cz" , "hughd@google.com" , "shy828301@gmail.com" , "liam.howlett@oracle.com" , "peterz@infradead.org" , "mingo@redhat.com" , "nadav.amit@gmail.com" , "shivankg@amd.com" , "ziy@nvidia.com" , "jhubbard@nvidia.com" , "AneeshKumar.KizhakeVeetil@arm.com" , "linux-kernel@vger.kernel.org" , "jon.grimm@amd.com" , "santosh.shukla@amd.com" , "Michael.Day@amd.com" , "riel@surriel.com" , "weixugc@google.com" , "leesuyeon0506@gmail.com" , honggyu.kim@sk.com, "leillc@google.com" , "kmanaouil.dev@gmail.com" , "rppt@kernel.org" , "dave.hansen@intel.com" , yuanchu@google.com Subject: Re: [LSF/MM/BPF TOPIC] Overhauling hot page detection and promotion based on PTE A bit scanning In-Reply-To: <0571919b-52e1-4981-8d34-bcc781c0561a@amd.com> Message-ID: <4c805e3c-4d5d-6880-7e65-cce1041f7d35@google.com> References: <20250123105721.424117-1-raghavendra.kt@amd.com> <0a9914f8-bec7-4e58-ab12-a87fe3876187@sk.com> <0571919b-52e1-4981-8d34-bcc781c0561a@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Stat-Signature: mxr6wsu8cu8sczxe89ifaejg7ndszqi1 X-Rspam-User: X-Rspamd-Queue-Id: 61191A000B X-Rspamd-Server: rspam03 X-HE-Tag: 1737961288-751299 X-HE-Meta: U2FsdGVkX195CCFPWnc4UXLcxNr5rM2a4Vy7xc2OdAvCWQ7BS3xdXyVdmPxnk9ZTCZFBRPO8a+XU/3YrKBvbymCzCI6ro4wi0FOLMSC2GT8K3sVITE/7SwfQWXPcEmmhsjmNqPoZLIgvf3MXUVy1bf+bbOC5n8WrzczWuBzLWpATcJ0VnHev329487R/MRSNvxRUGsjnCuKhuFfOovreca45A7dXjgMAOJQkVl23jBYlrCkMWo5fLcBcs6yVQDTP26oycEwWPStRBKZkp8Ox2Q7J8PEXzYYfYiNRCkNgC+4wgYjGvu1CQR7I8FszyGH3I5kDm91RSeMJlqIKbis46Tdz8GmMKLnmrjVYdIQl6VHxTxSH1qKOrjamGwByNiRoUbnKOEV3egeSrIufia8GlcaEWCC+N1zfaAhUy7Ut/Su33OMs+D0yv7an/QibVNx23G9tg7rsPZmfYV+0a7aHe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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, 24 Jan 2025, Raghavendra K T wrote: > On 1/24/2025 11:23 AM, Hyeonggon Yoo wrote: > > > > > > On 1/23/2025 7:57 PM, Raghavendra K T wrote: > > > Bharata and I would like to propose the following topic for LSFMM. > > > > > > Topic: Overhauling hot page detection and promotion based on PTE A bit > > > scanning. > [...] > > > Here is the list of potential discussion points: > > > 1. Other improvements and enhancements to PTE A bit scanning approach. Use > > > of > > > multiple kernel threads, throttling improvements, promotion policies, > > > per-process > > > opt-in via prctl, virtual vs physical address based scanning, tuning hot > > > page > > > detection algorithm etc. > > > > Yuanchu's MGLRU periodic aging series [1] seems quite relevant here, > > you might want to look at it. adding Yuanchu to Cc. > > Thank you for pointing that. > +1. Yuanchu, do you have ideas for how MGLRU periodic aging and working set can play a role in this? > > By the way, do you have any reason why you'd prefer opt-in prctl > > over per-memcg control? > > > > opt-in prctl came in the MM alignment discussion, and have added that. Are you planning on sending a refresh of that patch series? :) > per-memcg also definitely makes sense. I am not aware which is the most > used usecase. But adding provision for both with one having more > priority over other may be the way to go. > I would suggest leveraging prctl() for this as opposed to memcg. I think making this part of memcg is beyond the scope for what memcg is intended to do, limitation of memory resources, similar to the recent discussions on per-cgroup control for THP. Additionally, the current memcg configuration of the system may also not be convenient for using for this purpose, especially if one process should be opted out in the memcg hierarchy. Requiring users to change how their memcg is configured just to opt out would be rather unfortunate. > Overall point here is to save time in unnecessary scanning. > will be adding prctl in the upcoming version to start with. > Fully agreed. Thanks very much for proposing this topic, Raghu, I think it will be very useful to discuss! Looking forward to it!