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 0C53DC54E90 for ; Thu, 22 May 2025 15:38:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3D92F6B0083; Thu, 22 May 2025 11:38:21 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 38A8C6B0088; Thu, 22 May 2025 11:38:21 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 27A146B0089; Thu, 22 May 2025 11:38:21 -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 07C626B0083 for ; Thu, 22 May 2025 11:38:21 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 7023D141933 for ; Thu, 22 May 2025 15:38:20 +0000 (UTC) X-FDA: 83470950360.07.A160206 Received: from mail-qv1-f49.google.com (mail-qv1-f49.google.com [209.85.219.49]) by imf25.hostedemail.com (Postfix) with ESMTP id 8938DA000A for ; Thu, 22 May 2025 15:38:18 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=gourry.net header.s=google header.b=UY87eDTk; spf=pass (imf25.hostedemail.com: domain of gourry@gourry.net designates 209.85.219.49 as permitted sender) smtp.mailfrom=gourry@gourry.net; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1747928298; 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=vf4u9GHOU695icofw0nCN1mD7rhaEWr6wLsjiu2s4Ys=; b=K9OEj2gU6hJkXEycfBVBl8SmF/2P3b7B56zX2ryUU11DnUJwSugO99bpnSsb8sDjuGqoUe IhbjsQHIu2/cWz9YaMvsxPX/P5I9fLTu8KVuczSGFb32A4MsIm2FLWQ5zT6XtZ/koPcFeN bVUwwopZ/c/Gw6dYrU78DmTrQ4DFvJM= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=gourry.net header.s=google header.b=UY87eDTk; spf=pass (imf25.hostedemail.com: domain of gourry@gourry.net designates 209.85.219.49 as permitted sender) smtp.mailfrom=gourry@gourry.net; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1747928298; a=rsa-sha256; cv=none; b=VpI2y5WdQVJo50ZCZeCk7jd2DFpum6h/dXbA3kuJ7XxQbZhd9PSvgJHjanvj2pAYfU3Oa/ ju3jZL3lUfKkP7rTznoLk8Nnl01s+2B3rji2Lewl+eG4BWygoFyLYXsdQX519bnuYCzW6N cdRx92XdcUykhMzuokFs8/talIH+SjQ= Received: by mail-qv1-f49.google.com with SMTP id 6a1803df08f44-6f8d663fa22so69500686d6.0 for ; Thu, 22 May 2025 08:38:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1747928297; x=1748533097; darn=kvack.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=vf4u9GHOU695icofw0nCN1mD7rhaEWr6wLsjiu2s4Ys=; b=UY87eDTkfTrGZe47uqc2uKVx7QsndGZzoG+0R6YfOHFj0wgAgHNbRqJZ0hdebWDl5r ZidvPO+PAhyHvxsafv6ne81YxS+P0l4btyHbXDeOpXd5usG/KpD5BT4VdDPndGuAQ8ht wAYq8F7rkRhsc6RoK+Ler9ovqo+Z+IrZM7f4T20Mj0IQ7dBKAV5huY4l+HWcf3qT5KrG nFD6GDZLrtWZdWdMAOnn3iX/KtvH5lEApQc9x9yLVQEyj1YpJwi7PeYDZd/mQkLk7q3b h4lyPtUf5TT2jEGUj2YRn4B50+8B4bi5JK5J9R2RxwXhwF7Jhsp6L15CTTkzYc7rLLF6 gBnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747928297; x=1748533097; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=vf4u9GHOU695icofw0nCN1mD7rhaEWr6wLsjiu2s4Ys=; b=MOcnYx+KC/bey9cqbw4jM98hQKyYJL/Jo03Sw4S55RSuhkEbuWEVZOjvFQBWzlUSus NJmHx75HtMuCmbgDxCnTcUoW/x+16uSMmUr7KCg9UxgMBw2rIfwsIXbwdcfrmaume9VN WLCnLa9CUi3QHruMTZxDgIKqXnGs4jNKXYPgAT1vq3z0bwah6Is9tydpKUvJB9xxbibr 5LYuIEBnuq+hEi23UeeFBm977R74N7d5kMRxqREhvvIuzF5mm72/wF3pO0ESWZw0owSc /IeqAisdkXKoXX+78WfJSe2e31UC3SrBxY0NHV3h8nLWkFFSYCYwLTwOvdLQVF9yiutB jm6g== X-Forwarded-Encrypted: i=1; AJvYcCUxZBRiZwdIS3E/9LnQd6XZIOY0+NK5ToExlmsH25+GFvSpnJOOe6qFZUhFuVCWhFd8I9aJVzEvjQ==@kvack.org X-Gm-Message-State: AOJu0YzQHLZX9Cv7EtWNwrxzktW5K5kME53fYBx2yndZ9s1JeSRwkGjH Wuhi5XYhNg315m5TlCtiNHt9AUeyXR3L5WLb13ANw5ObwtXmPeaUQVnSMDpOCMvIlk4= X-Gm-Gg: ASbGnctLa6jNTn15gA/fUc/OHmDUEvS2QUhAaY/990/K44cT95QMl/sQnRWXPq/VHdR WsAjjSYBzCkMMRQ+rxYYwEEtni95+iHjFu5Qq/j3L6BGB/y+m+Qc7ZXmilaszN8Gb5+fubcUlLe +u9nLwcwyCIU31Lcn/DinctodV2zJV4eVt+K0ASn/ARfAE5lWnF+sDVkX3h4fuNzk1aN3TRHTWW BYoxR92icT/bltS8atWFKHbCEYyIKqAlf3j1JisHpQFcBQ/K02BuMGzx15pqevEbdCpXIzXrNrQ BRpQNPwqy7Cg+otZtMtGLOjLu/k9664blsP0GJjwafS5lxyJjPUwDrKwJ7/km4oeYmrSbOo1yJT ps3ss0EdTIVH/4zoNop86ih/xuA1EELc= X-Google-Smtp-Source: AGHT+IHgTy5wIi4p5xqLShtVbp3TEEC5U39xpmJidezDTtapAbojcCLBXRwyRF8gIl9qzCGM+7De1A== X-Received: by 2002:ad4:5ec8:0:b0:6f5:35f0:c89a with SMTP id 6a1803df08f44-6f8b2c69772mr419279366d6.18.1747928294388; Thu, 22 May 2025 08:38:14 -0700 (PDT) Received: from gourry-fedora-PF4VCD3F (pool-96-255-20-42.washdc.ftas.verizon.net. [96.255.20.42]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6f8b098757csm101004296d6.118.2025.05.22.08.38.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 May 2025 08:38:13 -0700 (PDT) Date: Thu, 22 May 2025 11:38:11 -0400 From: Gregory Price To: Bharata B Rao Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Jonathan.Cameron@huawei.com, dave.hansen@intel.com, hannes@cmpxchg.org, mgorman@techsingularity.net, mingo@redhat.com, peterz@infradead.org, raghavendra.kt@amd.com, riel@surriel.com, rientjes@google.com, sj@kernel.org, weixugc@google.com, willy@infradead.org, ying.huang@linux.alibaba.com, ziy@nvidia.com, dave@stgolabs.net, nifan.cxl@gmail.com, joshua.hahnjy@gmail.com, xuezhengchu@huawei.com, yiannis@zptcorp.com, akpm@linux-foundation.org, david@redhat.com Subject: Re: [RFC PATCH v0 2/2] mm: sched: Batch-migrate misplaced pages Message-ID: References: <20250521080238.209678-1-bharata@amd.com> <20250521080238.209678-3-bharata@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Stat-Signature: rcs8uyobrpx39wscbtfwmhd1z8wd7qrq X-Rspamd-Queue-Id: 8938DA000A X-Rspam-User: X-Rspamd-Server: rspam02 X-HE-Tag: 1747928298-522970 X-HE-Meta: U2FsdGVkX1+QkMKv1UfFIocEFQ5tuU2H0WwCSGNC0o3kLYd2b9LElOGBfze0KBBt4IgC+C6YlmUJehhZjD9R+yep2/8LZXYnrV1yJ8ag70eBG948KYRsBDrz/oMXAI/zTq9oZwQSXi5Q7q5WSK5JZvOygSnmkzsmu9u+Q8SaeYaYkT1txlbWHX8z73clpaSJyT8DqT/AKnFrboc55/oBuqZufIngmIGX2cDG1lihuWst3fw9il6xXWwL+JDQ1T7Kvl82G/2yXKcQFV/B9b8MBQzpe2DlkNTf2Te+UvfPdgNlwkSh+8Y4b/lSvsfzcmL9GW1FPPyJlkk5KS0uaZ7+Xrn3oRK/joBjIlKUd9o+FxD2fs95j6aabb2hrFbGo+9+SPi8jrUy/u+euA4LBiqSvqm++Vf79nuY5FRqT8p67tL3hUrojQ+XKa0JGhbvywhGLBj4SfUA2i4Ytv9tWp9cjmf9CArQ5CavmRj7Jbj2dGcg5UyQHWFEirDkSrvNGcPoeGt4+soBxQQMauJJT14rNrc12yfKxeOIZXBE5OelyepZ+ckfyCmNfNCDoLkU/lDy8sGpj534Nnl5i77ER8loWTkJSLhyuMF/yKIDeKeCbHExG8GAfWawu8BFVsO9PQHpL5D1kKCtHvaW2Gyg70Qptvp96xKI/Tmw5GEany4IWi97snujAdnL0COprMYQ/K5llXpJfBgDspHHrlKVX+Lra9PRwmsrGG3lNxlWyn6FVNxWXZw6TcxG0neIRvvx8rZ02WshuEpAfFTwbFt/MT3U7k+t5hoxPwuHygpiKvOPk+VOzpiUktVZfnY0RWaAXGjXwr/zOaL6vARys4vjGA+3Lpu1pSyZ5RPZ3sLL6Ytw8k+HOnD/+KpiLb3x4/kPAJ0hmK1zFqJ86cqhU6tmSUJNJoCnkZRpSZGr+xiYxJ0BEVoGJdrfEXn5Y/pAf3x5F8GjsyshU+JMshMQmhl9KDV W3hFBkll lEaOTPLB99yCe79hiBSS1Ogol9MJD2VNPL+QEXmy4HfgNpWq9iAdZ508cL0gdcFlcsU8E8J00/2X+uR4adTSlFwp19Z0nWO6sA6H68l/PVm4kzs0= 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: On Thu, May 22, 2025 at 01:03:35PM +0530, Bharata B Rao wrote: > On 22-May-25 9:25 AM, Gregory Price wrote: > > > > So i think this, as presented, is a half-measure - and I don't think > > it's a good half-measure. I think we might need to go all the way to a > > set of per-cpu migration lists that a kernel work can pluck the head of > > on some interval. That would bound the number of isolated folios to the > > number of CPUs rather than the number of tasks. > > Why per-cpu and not per-node? All folios that are targeted for a node can be > in that node's list. > On systems with significant number of threads (512-1024), these lists may be highly contended. I suppose we can start with per-node, but I would not be surprised if this went straight to per-cpu. > I think if we are leaving the migration to be done by the migrator thread > later, then isolating them beforehand may not be ideal. In such cases > tracking the hot pages via PFNs like I did in kpromoted may be better. > This seems like not a bad idea, you could do hot-swapped buffers to prevent infinite growth / contention. One of the problems with PFNs is that the state of that page can change between candidacy and promotion. I suppose the devil is the details there. ~Gregory