From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CFB3425A65E for ; Mon, 27 Jan 2025 07:01:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737961299; cv=none; b=HblltUtILJa6qiACmRpHiOcIX+bh9qLi9D9Z1jHyGgvkZxq0OWEhTTOZoq8SJ2ny9CffAsOpq03Ia1kinHowcWREwkLEyaMQkV7gxq4IoruiotNG1F1fTHxT/ADanpY4iFR1CGRD1v3bS+s63DdO3gUsEYb1U+wJqZMF9DkkSZs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737961299; c=relaxed/simple; bh=XAO7HMaCtt7hsPZg/MhP7t0n2z1/cDPQJjtRI4hddXI=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=dhzUzaZihgJ4nJ3A9v2a8uxV4tjHt2uuy+3l5lB4AXafG3yOJVvw+jspIuT0Z5xC078zrkutVup6sbMIIn6O9MBOfBYdb5yjFLvxejD3apMQAJBHFSrM1uZIvi5vm6WlBD03/fT61+ojsH6WhZLawoawZJo4Y2sCWa7wdojQWdU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=0MD6vLiG; arc=none smtp.client-ip=209.85.214.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="0MD6vLiG" Received: by mail-pl1-f181.google.com with SMTP id d9443c01a7336-215740b7fb8so191575ad.0 for ; Sun, 26 Jan 2025 23:01:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1737961287; x=1738566087; darn=vger.kernel.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=0MD6vLiGCc5am8I3eMGGE2ui3L6n+Z7g3mLsTKDKcvlPrTMaawBGIOwtHvjzZoA5YZ lP3W71nxXA6Hyyf0w7UGxd7ro9bzpBMeIBJSIczm3sEHt1sP3UD4FDEBLLc74PNGEaBe KZxwwHmzfMtuuc0hvX5DGIOAQCbFmSKC5G5tpKwK/5PehXoQlFIj+p5y55EtOVH7A/Bz Tig+xclGhWxeP8IAKslLDAaaFW61zuuAFa0IOq9zHNJLZAIRwxw3ulkj6rwBINqZRK7B dWul8nKqrg8HllJ1m8cCeGKXtsRKUOINnlXN1UrqX6LJRkY3z3jlJIF/2JDE9eoUEIQ9 ulqg== 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=nHfRCFYrEMGYvXADQyW0KrqT/fV08pxdlikrfDhaN9JGyjDscT6hLm83DFnQU+n41q Ot8OxntbPBOtRTW7IaOCBOCmwF2KaAg9Da+Z1tuJnic/OHmcSy5t1EW3zsnjIENIrHaT pVvx2e8ngs/If4lKdz6aHIW0et5mq7oMOP1pni1N9Th/FtpXB/l1exEWHl62OSSG+3Og Hfk9OIMl6oJS2HnMp1Jj5iNu8cSLLXMyyaXhu94gff8qlp5xHbLwo1Hm3HT1r6QWfeXW 7U8E7DWpVDLmo3IliqkLvMYsA3Z5baNsqgmUVID4B+M9NZjgAvVZLNXQqAGLfgaOoHv1 3lqQ== X-Forwarded-Encrypted: i=1; AJvYcCUmvbEsVxxyOVF7HwdwRMYVWDqYJRi3s3yqSLrH0hIYmsQCQ3P6gXKhAuM9BW9YX49wzgP7w6AZ9jj3Yfg=@vger.kernel.org X-Gm-Message-State: AOJu0Yyhag6TNp5eU8rJXpzhszyRH93TF7mT0svlqZvLwflNls8kOz8k KfWy4hEZzA3n9uW/KxXes4DRUz5gfiYXkz2iCufq1h0EaBDLMzXTwbSITEOxWA== X-Gm-Gg: ASbGncsR9BUV7wE9lDgz/Ca4Q7U7mzAgZToW1QkGEOKRZfMKWiYQfqMbjeWPrFpdU/Z sRIxGqXEACRpRHkfsnF5UiYSOb1f9MFzdkGC7c9A9qfF82U9YOJ8GIoXBZTRZ+Hhyfyc76UmYwR JFmSTu9pYKXvC6y8hYI87b+vNrAiT7YLyenBalfTW3yuPciuEjUsJFDfOSRYpUNK7rB6lz9hpMK s8VOE+FAe8g2RyjUKM004JyxkIKY0CMjwip2LaRhzYYHxbNBs6tYBRa89cI0zSAqTyD1SBj7LFe l3LEJpl9jg/hjbKcdFuVNAthnzGq6GZO0pQ= 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII 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!