From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f51.google.com (mail-qv1-f51.google.com [209.85.219.51]) (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 B724F35CB82 for ; Fri, 9 Jan 2026 16:42:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767976938; cv=none; b=D5Rq2rOFmet83kVwMonjr1PcjTFa4m8bZciyAyOIrLz6/W2L+hxctEVlGYi1Iv4V0p0W+HUZekbRkrieW+BJFV9lE+I7/Ud4BNAWBSscz3Vte3D6y10Rf4NpxRDuUngB53MurkGMxM5JHji/emH7bQohIrad438gq5TUEwkofHA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767976938; c=relaxed/simple; bh=zWd85D/LWl7Jxyw+kkzDn+QsuMGv2MvZLb3GfdnALaQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=nyizIERvpqnfP71ozDpovbs2wvcFxz+2Xn3IP7Mft2EYSlDY/lnlRFE8Li1zNJGTfElEdRkygra+czDfhWSFCT2t4Bf6vK02aPVcIDULr6GmDv/Sojz7BsXtZWXAC3bOe3pMSKnRb+FbRv0Zip6VSn3pm5e2Yjef+/2ocCRN9i4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gourry.net; spf=pass smtp.mailfrom=gourry.net; dkim=pass (2048-bit key) header.d=gourry.net header.i=@gourry.net header.b=FlzPCulu; arc=none smtp.client-ip=209.85.219.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gourry.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gourry.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gourry.net header.i=@gourry.net header.b="FlzPCulu" Received: by mail-qv1-f51.google.com with SMTP id 6a1803df08f44-88888d80590so53748406d6.3 for ; Fri, 09 Jan 2026 08:42:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1767976924; x=1768581724; darn=vger.kernel.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=QbmVDdav2QXSFlN7+RnQVBBu8vs+yvCmI1lbwcA/MdU=; b=FlzPCulu3Y3DZiL+r8L3L6aAgmQXWfEoXPKdISu+SHuAgGVt0z7DhwvbCgLa8GFt+X lerM6JCwsth2coWVB2vEZfghk7v8+8cFT4QcTnO0hyf9rq3/+ON7cQUtKYbc2rqk84Mt c+CeC38jNaW8sBk4HJVxmAhqLLltv+TDgn9cmm2g45XByHScFYJ1uhzEPP5PHRmEmKc5 LAGbcqQc9YcYPFpxGi7hpFVn/8pRB03YBrFU/SzOaoFQCaHybiRORYvSBHo5Khlba/Tg ahfLZddU3QwbZUvkO0X4Cvceo0OnxfOQZs+MmPPA7wU0M3Hhas/3gbphO8PT9g9j46SX +10g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767976924; x=1768581724; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QbmVDdav2QXSFlN7+RnQVBBu8vs+yvCmI1lbwcA/MdU=; b=qpA5S4xGxf4T2DJiocZ1F2Y+T/qzfbYcopM3Te191XCJzRNOuMusWD0+OEyzccisV7 PtSNbRntCYYZGfYZEK2bjskaOoF+wzYhlsuLB13ILiO0skq70qkEvQoC4ciEoE4FW//b waSN83lT+aj48mRmPjh4PcPSlGxULv6biCJk8gXZ4mohkQesFfItj/tYiqJazo59ziY9 vwPKRozgpWTd7TQ39JVcjHLgtlMqyREf5QSObc0Lyiuk+nxUHQLcvRDDsHpRTTBArUww 3mojSMyFT6MPAQnyJMylNIRhSMa5aybC+qYhKEpdNFQVH5Oh7GOeLD12AWN1xvPUjG7O C23w== X-Forwarded-Encrypted: i=1; AJvYcCX9640Bf/92VMysron80nOR6bmXcad14A1RErs0a2XDiTlOe81CyAQ5NyVSysQo4BQWOWHNK6BseYr6OE8=@vger.kernel.org X-Gm-Message-State: AOJu0Ywpb1Fn31aOUC2KU+Y/Pf6rG5jy9EvvhOCK9j2ZUkS2uS96yTNA eqO2wx5TtZfmlhNoENCIQ0Ynfog7S5o1nHCkejQSMkH+Zcmo7inzDm6bRrR5L1OwgzI= X-Gm-Gg: AY/fxX4f4xPvF1D6lUi/tYWVj7q1kFwRYoZZ/bh+bGcmuO5EfUZdChFoz3NU4419kbv g1tPFDwMbueoPodGbsatJpGEM4uXIa6KAPjbRqeYLiZOBtJu6WY2HYu6OapOKFkdBZ16bYNZOIB cKOYACQDjV81Hl/aC5rFNR/13SgUsOgrO6qEcxD/PhxeLt4/lZqL5cZy14yNe36aXeXgLUmNTWr Bg09uVOnFNqNeCWkygKjzTvRDnpaZW4lfkaDMoa6LPEL0kHTdxSw3tl4Pblc1Hiq1dGUFSr3pRT jqYKW7ULKD0KhvlEprlK+44ok1DMHZXbnlHKPK9yWmYrghbj+4zuJl49mGftSSCy/YSh2qe/qze FC2NlyZPdX/oJKiD/T/8ouI0vcpBaxMna/el009D1qKJhNmyN80csookTwDxR6+esYqEa4sPjgo U2JPWVRr08uwKuS8ZcZjvG38gk1KF0IEDIS9d1+Z19BxtGDEL67jDQwSqma0WuQclJGLSSyg== X-Google-Smtp-Source: AGHT+IHoGMGuBY8eCz/TDiJSI7gOHpMmKKVD0ympruhwdF+nr+92ZedUbdyZt+63pEB4ukVG9TZeuQ== X-Received: by 2002:a05:6214:2d49:b0:882:42e6:171a with SMTP id 6a1803df08f44-890841d10e2mr144945046d6.29.1767976924478; Fri, 09 Jan 2026 08:42:04 -0800 (PST) Received: from gourry-fedora-PF4VCD3F (pool-96-255-20-138.washdc.ftas.verizon.net. [96.255.20.138]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-890772346e2sm81935016d6.33.2026.01.09.08.42.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Jan 2026 08:42:03 -0800 (PST) Date: Fri, 9 Jan 2026 11:41:29 -0500 From: Gregory Price To: "David Hildenbrand (Red Hat)" Cc: Hannes Reinecke , linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@meta.com, osalvador@suse.de, gregkh@linuxfoundation.org, rafael@kernel.org, dakr@kernel.org, akpm@linux-foundation.org, lorenzo.stoakes@oracle.com, Liam.Howlett@oracle.com, vbabka@suse.cz, rppt@kernel.org, surenb@google.com, mhocko@suse.com Subject: Re: [RFC PATCH] memory,memory_hotplug: allow restricting memory blocks to zone movable Message-ID: References: <20260105203611.4079743-1-gourry@gourry.net> <7f053290-6b9a-4d18-936e-0f28006c79c3@kernel.org> <9575e042-39f4-4f01-80db-34aaaa9312e6@kernel.org> <616f97b7-24e0-4134-a08d-5abaf07a8b09@kernel.org> <20baab84-c8b0-4c46-a550-21b26b975d07@suse.de> <65c246bc-fb10-4cef-8163-3a55bd96f326@kernel.org> 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 Content-Disposition: inline In-Reply-To: <65c246bc-fb10-4cef-8163-3a55bd96f326@kernel.org> On Thu, Jan 08, 2026 at 03:16:24PM +0100, David Hildenbrand (Red Hat) wrote: > On 1/8/26 08:31, Hannes Reinecke wrote: > > On 1/6/26 21:22, David Hildenbrand (Red Hat) wrote: > > > On 1/6/26 20:59, Gregory Price wrote: > > > For hardware-based scenarios memory will always be removed in > > larger entities (eg the CXL device), and it's always an 'all-or-nothing' > > scenario; you cannot remove individual memory blocks on a CXL device. > > So there the memory block abstraction makes less sense, and it > > would be good to have a single 'knob' to remove the entire CXL > > device and all memory blocks on it. > > Sure, it might take some time, but one doesn't need to worry about > > restoring the original state if the operation on one block fails. > > That's not what I was getting at: > > offline_and_remove_memory() can be called on large regions, and it properly > handles whether we have to back out because some offlining failed. > > The issue arises once dax would have to call offline_and_remove_memory() > multiple times, on non-contiguous areas. Of course, we could handle that by > providing an interface that consumes multiple memory ranges. > > For the DAX use case, I thing we'd really want a way to just use > > * add_and_online_memory() [does not exist yet, but ppc does something > similar] > * offline_and_remove_memory() > I'm starting to think this issue is actually the result of bad patterns in the cxl driver - namely using dax as a path to hotplug sysram. I suppose either we need a `cxl/dax_region/remove` that handles the whole operation in one go, or we want `cxl/region/commit` to handle hot(un)plug as a single action. tl;dr: Split the dax use case from the sysram use case, and make a cxl sysram driver directly manage hotplug rather than use dax. ~Gregory