From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com [209.85.210.200]) (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 DAEA140F75E for ; Mon, 3 Aug 2026 15:03:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.200 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785769424; cv=none; b=MJNeAtO0lyHGRCBh4/GdrQzEhAUPuTW1EKib+dX/n29bJpUrXeRjL2g3szsIj9CtcDtJgeqANt4dWTXFSmle8lMMmN8QK8nRIqGoncmkaUbSG0MFo97fJ3fx4yzotuDJrF+ub1sWobKaQpBkQm3tspBtp9JD3At+tC4Ri+c+UGs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785769424; c=relaxed/simple; bh=xpuun2FpwKl9xPy2b0ojl3YaE6k3z96AypSR1+LJ1mM=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=e5w3PursMrkp31KTM/Nks0VCX0VRG7ir7kklUDaAt9EtFGfpdqNoDixmtN0brbpAtUcOwOOdMk/tfWsQwiFKMhnSGeoyM4JRMihjVKq9uNHxDTlVtJDmTKyWMoFwXBc//QmuYAGDhepbaF9H6SSROOvdTgsQnHVCFhfPOp0tV6c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=GPBteyEa; arc=none smtp.client-ip=209.85.210.200 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=flex--seanjc.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="GPBteyEa" Received: by mail-pf1-f200.google.com with SMTP id d2e1a72fcca58-84e1da97175so5761854b3a.0 for ; Mon, 03 Aug 2026 08:03:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1785769422; x=1786374222; darn=lists.linux.dev; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=kpmlhPaZ29dFNT38yqO3kihwGUlr59oo46zK4tKVuxM=; b=GPBteyEaVJMvY4RtrdAUL5E7hgmvVkwnYHskhvf9M714IZnzaDeSUR+3TpwnIr0UMl HYglba46toe7WChagOAgBZPrBwcfVemjaoeNB+8EZTaeoRdgP8W/92f6vWvSC0IasGQu e1vsjaEfQ3iN8j/W06+hg6IOk9aq4WX8sNRnd8yDGh2DgS8gLnpqohzd1edosBqMF4BB CaZyEciV+WRKfD/nx8gXKIr78zZ2K5nnzEkWrQCGbf/jmVNz7KPJGGlT3gJJZUnbGX3U t0f0KuwWpWEKwXsJOlzq86pFoCxoV4RJRerTimEyMqWpJAg7XBVEHVXPa7v5wt5IKGLo 1tVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785769422; x=1786374222; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=kpmlhPaZ29dFNT38yqO3kihwGUlr59oo46zK4tKVuxM=; b=FAmGq+zqiP6dWhA4kkOnW6kCkeVhN34zyfQsO9dG9ty0pEb1WIUtM8nLXdzPgU8Cdu mcZVgFaiY3bNLkbeNaaysHWaR7jm7feKH2A4tCnFzccj2QCmlEUl6YRfuw+TneKv1aT7 i+aTZG4PZvTAaC1S2lu1iVzqOP/nrzFqJuhr0bmron0CWVRzG9QrEIdqP0qWNNp3HO4v j9aWDM5yQPTov4wWAjk1yGOAPDJsZ5YNEO+/YTU0Kj9Pd8RK1gL9tEYpqSlwM1X/DrYW xvl3dHIjkDLdLJI5K0es4b8zvPq7eANPVp/Ae2RNem5XK2kx9x9Kq562YfUZwQD/vLjM ZEhA== X-Forwarded-Encrypted: i=1; AHgh+RrqJ/vTGRewA7aR97jLSW54TcGdO2YqqfoS+6BCFQtT9SlfnWEprarFbszWV/7sgX5olTD/rWl+X6i7@lists.linux.dev X-Gm-Message-State: AOJu0Yy5wv237+DP+TKzul4mRu1s18jwi2+jE0ulp/8lmsl2edVxB8pE 246Kkw/NbgPq6sK8W4K5DM5xjDhR3SRiGxmX0riF6y+JSxEGBbEbRCuBlhyNZDmH8/0+bFbU/mH a5GQkow== X-Received: from pfbki10.prod.google.com ([2002:a05:6a00:948a:b0:847:7765:a4c3]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a00:1f08:b0:84e:d51d:86c9 with SMTP id d2e1a72fcca58-84ee490ac84mr9200662b3a.44.1785769421725; Mon, 03 Aug 2026 08:03:41 -0700 (PDT) Date: Mon, 3 Aug 2026 08:03:41 -0700 In-Reply-To: Precedence: bulk X-Mailing-List: linux-coco@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260728-gmem-inplace-conversion-v9-0-35f9aec2aed2@google.com> <20260728-gmem-inplace-conversion-v9-14-35f9aec2aed2@google.com> <4460e252-b6de-4df3-bea8-0368a9d0f4ff@kernel.org> <60552bee-3326-4917-b00f-5fb7ba3b8adb@kernel.org> Message-ID: Subject: Re: [PATCH v9 14/41] mm: swap: Introduce lru_add_drain_progressive() From: Sean Christopherson To: "David Hildenbrand (Arm)" Cc: Ackerley Tng , aik@amd.com, andrew.jones@linux.dev, binbin.wu@linux.intel.com, brauner@kernel.org, chao.p.peng@linux.intel.com, jmattson@google.com, jthoughton@google.com, michael.roth@amd.com, oupton@kernel.org, pankaj.gupta@amd.com, qperret@google.com, rick.p.edgecombe@intel.com, rientjes@google.com, shivankg@amd.com, steven.price@arm.com, tabba@google.com, willy@infradead.org, wyihan@google.com, yan.y.zhao@intel.com, forkloop@google.com, pratyush@kernel.org, suzuki.poulose@arm.com, aneesh.kumar@kernel.org, liam@infradead.org, Paolo Bonzini , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Steven Rostedt , Masami Hiramatsu , Mathieu Desnoyers , Jonathan Corbet , Shuah Khan , Shuah Khan , Vishal Annapurve , Andrew Morton , Chris Li , Kairui Song , Kemeng Shi , Nhat Pham , Barry Song , Axel Rasmussen , Yuanchu Xie , Wei Xu , Youngjun Park , Qi Zheng , Shakeel Butt , Kiryl Shutsemau , Baoquan He , Jason Gunthorpe , John Hubbard , Peter Xu , Vlastimil Babka , "hughd@google.com" , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-mm@kvack.org, linux-coco@lists.linux.dev Content-Type: text/plain; charset="us-ascii" On Fri, Jul 31, 2026, David Hildenbrand (Arm) wrote: > I sent a fix for the GUP code that always makes us drain right now: > > https://lore.kernel.org/r/20260731-check_and_migrate_movable_folios-v1-1-e0002d7b791e@kernel.org > > Would the following (agains mm-unstable + fix) work for you? > > > I assume that you'd have to call it as > > lru_cache_drain_for_folio(folio, 0, NULL); > > But maybe there are indeed extra references that are not reflected in > folio_expected_ref_count() that you would have to consider? I doubt it, but please check if > there would be a problem. > > There is a small problem for merging: > > (1) The patch depends on the fix. > > (2) mm/swap.c was moved to mm/folio.c in the mm tree. > > We could write what I have below against Linus' tree and have the conflict be > resolved when merging. Topic branches are unfortunately not yet a thing in MM > land. Are you expecting the aforementioned fix to land in 7.2, 7.3, or 7.4? If it's 7.2 or 7.3, then I would strongly prefer to base v10 on linux-next (where the fix will presumably land soonish), and target 7.4 for in-place conversion. Then v10 can be applied against an early 7.3-rcN and we don't need to juggle branches (assuming Andrew is ok taking the proposed patch through the KVM tree). Irrespective of this small mm issue, it's getting a bit too late in the 7.3 cycle to land the in-place series, and we need to address Xiaoyao's comments, i.e. v10 is going to be necessary no matter what.