From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f171.google.com (mail-qk1-f171.google.com [209.85.222.171]) (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 4773014A60F for ; Mon, 12 Jan 2026 23:15:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768259726; cv=none; b=NK48O2f7bNzJTaYBb4sT0iXaukmwFzGCsPaEPnVnGF9O4PuAafjeeTFgCPEZWaZ2zXIDUgp8ON4ldt+oPUW19R8isc5b6qPBv2Z6FkJHnDnndeCFqeNBJwEPSA/W6/nUBgtXkC2stSOxGHwlPU4XrOMsB7mpQ/RroqNqqiRaH4M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768259726; c=relaxed/simple; bh=BRENSHxOqnc0XTBgYPAYSrqv03RduyiJXfpNto3Du20=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=VkLCe/psQXniBDa/nKyUMMvSudAjQVDBxUC6TMEK11Aecby1oJOaW2GYXW9kjK++7OxdQAZB3dGqKtH5/43P0mHSUzFxUFOAJ8qbEBv6tIKDNPc0VxQZ9IcpnKwfDv8keI8RzdukctQMyGQjLYFK+DuuApoe9pzZbCcSXVE7v2s= 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=V/XYfcqy; arc=none smtp.client-ip=209.85.222.171 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="V/XYfcqy" Received: by mail-qk1-f171.google.com with SMTP id af79cd13be357-8b144ec3aa8so731041885a.2 for ; Mon, 12 Jan 2026 15:15:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1768259724; x=1768864524; 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=kz2DiMZ9Jmi9alXldwvfU82+dy4M93Sr37IhN34NP6Q=; b=V/XYfcqyxCCxNSK1G5hOu7P230Z1PcFjifX37XOegkRC9exqznQIVZhvGF9TRKU/42 S14J8bXZ3c+A1lqDj+sqYw+YKaQ+NXHL6KtmKRpp+tnXBe0JMS6dKVWEIsQKmPsWYhw8 rC4RywH4sLAms84em0w6kstdhpeN5Tev8ueJhUoUPYFVOqBQazFzqm9R2rjE/KuWUZ+q PRacaQAeDeND/Up8FntVNiQVpA/1H85roXF1nA2siLCJAOYUtPUX97tKSa7iq5WxdkAV r39NcxDmF4duaAmdXHJmqo5Bdac4iReY6oGEaecGsH221dEBbhrQp+Jtk6uLiUWTc03d hlhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768259724; x=1768864524; 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=kz2DiMZ9Jmi9alXldwvfU82+dy4M93Sr37IhN34NP6Q=; b=l6ubclqkbdAK/RrAqszeImaodj1fzDTgPpTb6H9OC3CEWlIVfCmpk1RibD6/hmCkLk ds9wBXGlEQvJ9vXanwwfhSfiVZQJf98M2PptQqkES9EhR9ygDNHaiM3Z8qgmesE7uXou bJUEC6mlnDDMxwVESiYBUgXIn/Lp9se4RBijb4sFneXzucUCAeDJZrkN3hIfK51Hrauw 8f+eLscre8I3942kBlx3UjdkxGH7c+88bl7fy3vuS9nSQnNYoy5LYa8JQ4yAfzAbsbz/ uhB2kNchmpjYvA2efv4VTVYxTJrLQ3vk6/sm+Ce5+puPieJ7fz1/CSnmfe6RKsNbHytz p8uQ== X-Forwarded-Encrypted: i=1; AJvYcCVgoQr56bm+VjCi06ApHLJFWC6oh3BrBakUF0KCXPGqoNy09SgN7hrtzn/Mc80iaI9rYFV6TJleFTMoqRY=@vger.kernel.org X-Gm-Message-State: AOJu0YxqLSwYQHS9OSUbD0WGBSwKe3TVAU0FR+IyYVOL9+r8+hI5KfSU HH0Mbq2cUoUyMx55BzLx0HR7DJ1GwlfA/lo3U/EBvWPkIipxN23PCmujZ4GwfvIMFv8= X-Gm-Gg: AY/fxX6QD2W1xpX7aqkOpoGODGuFrte+4rVrAF7OpUoTJzXqNAPHf3nd1erbrVdMiV0 lDgn4+l3M2aDGPr1fkzFNmfmRTJLtL0hsd7d63CkrUwFCMkm/glz9/suOtWpNtStXPTdMJHfTEd ZpismiXru62fsKzkCXP6Xp7IeAGKR9uLWNHx3SDn0eDwF7Hy/xxrMYpN3Hy/s2jfyszYSoAGfOk 0xaMjRLFuS6seGWDd+JLSzDCdYSuNnzgLpTSKE2goSKX56z8Skk4j6LD15I+l551ZKOFoO2z7lS ThCp6gRPjMr5dKTaYLy0qboAMqai0/nrXbDSGHVBTVd2WM78D2LIdT3gVH2YlxAqCkqAVoM3MqT MA2VQnmrySizNNXLEPEgJkhLxSvtlM8JlLm+VktxE5MkUCiFPS/bnieepyOzmpRSYMSXrCoetLy n8vHfUnJ1XzRziRbmqVM54U5p7CywxJzzApvgeNiTxqRpET4uhBZdMaSbyWwg135oYHameIE1ep xFuYLfJ X-Google-Smtp-Source: AGHT+IHEBdEFYGiGeIFxQsYqWbO8KZ5CI81tDM8GfmvVkP22qHVWlWJ3421TBDjCcBZXh9CMse0mQg== X-Received: by 2002:a05:620a:2801:b0:8b3:3835:eeb3 with SMTP id af79cd13be357-8c389403176mr2610384385a.65.1768259724154; Mon, 12 Jan 2026 15:15:24 -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 af79cd13be357-8c38a9244bdsm1341831185a.3.2026.01.12.15.15.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jan 2026 15:15:22 -0800 (PST) Date: Mon, 12 Jan 2026 18:14:48 -0500 From: Gregory Price To: "Cheatham, Benjamin" Cc: linux-cxl@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@meta.com, dave@stgolabs.net, jonathan.cameron@huawei.com, dave.jiang@intel.com, alison.schofield@intel.com, vishal.l.verma@intel.com, ira.weiny@intel.com, dan.j.williams@intel.com, David Hildenbrand , Hannes Reinecke Subject: Re: [PATCH 6/6] cxl/sysram: disallow onlining in ZONE_NORMAL if state is movable only Message-ID: References: <20260112163514.2551809-1-gourry@gourry.net> <20260112163514.2551809-7-gourry@gourry.net> <9c975c63-2668-4283-a326-292e50bfbfec@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 Content-Disposition: inline In-Reply-To: <9c975c63-2668-4283-a326-292e50bfbfec@amd.com> On Mon, Jan 12, 2026 at 03:11:05PM -0600, Cheatham, Benjamin wrote: > On 1/12/2026 10:35 AM, Gregory Price wrote: > > If state is set to online (default to ZONE_MOVABLE), the user intends > > for this memory to either refuse non-movable allocations, and/or intends > > to preserve the hot-unpluggability of this memory. However, any admin > > can write `offline` and `online` to the memory block controller and > > bring that memory online in ZONE_NORMAL. > > Is it the expectation that the user will never want to change the zone from > MOVABLE to NORMAL? I can't think of a reason someone would want to off the top > of my head, but I also can't think of a reason to restrict it either. > It's more to restrict this pattern echo online_movable > region0/hotplug -> creates: node1/memory123/ echo offline > node1/memory123/state echo online > node1/memory123/state The result of this would be valid_zones=[normal movable], which would break hot-unplug. > > If an actor attempts to online the block into ZONE_NORMAL, it will fail, > > but if it attempts to online into either NORMAL or MOVABLE, only MOVABLE > > will be allowed and it will succeed. > > I'm not sure you need this paragraph. I think it's a logical conclusion of the above > that if someone attempts to online the memory as NORMAL or MOVABLE it'll only be onlined > as MOVABLE. in the above situation the following occurs: echo online > region0/hotplug echo offline > node1/memory123/state echo online > node1/memory123/state cat node1/memory123/valid_zones normal movable echo offline > node1/memory123/state echo 1 > node1/memory123/online cat node1/memory123/valid_zones normal echo online_movable > region0/hotplug echo offline > node1/memory123/state echo online > node1/memory123/state cat node1/memory123/valid_zones movable echo offline > node1/memory123/state echo 1 > node1/memory123/online fail with EXXXX (i forget what code) It's a little confusing. > > + switch (data->last_online_type) { > > + case MMOP_ONLINE_MOVABLE: > > + return sysfs_emit(buf, "online\n"); > > + case MMOP_ONLINE_KERNEL: > > + return sysfs_emit(buf, "online_normal\n"); > > + case MMOP_OFFLINE: > > + default: > > You're missing the MMOP_ONLINE case. In that case the memory would be reported as "offline", which > I doubt is the intention. > Blah, i originally had all of them and just reduced to MMOP_ONLINE_MOVABLE and MMOP_ONLINE (i don't see a good use for MMOP_ONLINE_KERNEL), but i'll fix this up. Thanks! Gregory