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 92EDC34D902 for ; Tue, 6 Jan 2026 18:07:33 +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=1767722855; cv=none; b=oHzfuMxfreSEuI3wyatCZulmbwbLvpVQ3OS9pDjL1oZoXSYHhC9Jzyglr2UR99CplSKfrnHuduEPFcUdRz3S989G0ojF/O7gd3lgdz0+eCE5h50eC0ai9am1B/Mx7g5U2HzMv+VyX2d+Roh2MZyMpNxWClxgtiOhDXhG2MWpZWQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767722855; c=relaxed/simple; bh=lE2w35NhT/GhOYyTNe8P5J0O0/RBHq/c9nzmf8gvHgM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=qWGEXIEaXQ0Crp1ZIMWT5hm51Wz2XAP170sqVtZIM57Ew9EVD4kbPKvk+BzQVFK2Bw8zoO7WcXmn8hmsnizjfH1QvcWxXg8jLGlSFNQGAekvnB0EEF58ciDvmmqDUr3h70bsLU99yXjcoxMHfNtG4kNrj1zjPwKSVHhVXIiz/E4= 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=VLpwHpyT; 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="VLpwHpyT" Received: by mail-qv1-f51.google.com with SMTP id 6a1803df08f44-8907fb0188fso4664516d6.1 for ; Tue, 06 Jan 2026 10:07:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1767722852; x=1768327652; 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=J9laVuKjYDSqLAjje1jBZcztaW2hTq+bS4g/OEUzif0=; b=VLpwHpyTHrbikP1Ct+Oez+JEBTMsdAEVcAFJJtEPKaxNLtjnx0AcfTuu4au2F15ZR+ 0yDo05s6fCmPfTXJiGMGBvqxIcRApVAanngQGa9K4xeekpLEtsKTuLJZ3PFEOzdHaUU/ r0E0MO80F5EiYLfDteibZCqP+bR1uLctssEVr2LfI0n3ZytLv+XWBzVnaWholnNEWCAS gOHq9X0TKMbjY51OL+yR15xLyPQXwf9cjW0n0+YxBAoyIxEgLJ0LioJCHJb0N+OLX0Ck lrmCmOYpaYJRdlvApVHNCd/edh5PTKoICU8dwbE3lVRLKynsZh+sFg24YO32vy5k+0Kn kB6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767722852; x=1768327652; 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=J9laVuKjYDSqLAjje1jBZcztaW2hTq+bS4g/OEUzif0=; b=kLaqsnMbUtzTnKjSz0+YqXXDpOeIhilY7bfI2I2OdobPraw5AvSTuxbJuvlKh4DcF9 zQL5hj6i4GittHRbo4YjSWIbYcC976+of9hqyqarh9RvWIpxDoXyGVMlyj22UfjOz1FI cf/2LvrGwXTr1eNN/7aVBvMX4iCObg0niRBITjlCdWc8mgXmf26qqRLO4mt6uBLT15az AMvMkaME25sKNv9s2x7yAbSp/2emiXA5GlDgk1vhYueQnymO5PDpUbNC2CvEGmPs5M6E 0+t9gaXFhFT2cYDwoKPb+UyJ0LSvciP3/53UOTWkTG41Hjvvh9FyyXVFVJNEZ3t4ondp MwTA== X-Forwarded-Encrypted: i=1; AJvYcCV/FbG5ErBN/kCPw4BfJQa3vWe36N+6OPNcvXL7J2n+7OYz3YCpDb8VT2mQbW2ISUtIF0OzFUQQcyYvaCk=@vger.kernel.org X-Gm-Message-State: AOJu0Yz5jX9wUcNCjLAi/28ImDsUvSWKGT4wHfLANe4oL6CxfgslhM3K Bvz9AI48VoSGWPeTFw3Bl+LvrwPtL4fb4We66Zmp+7//4AawLIyqWvs2/tr/yTPdLtA= X-Gm-Gg: AY/fxX4BUn28o3VQJCgx1jl2d0ikhd+hOfkqs1ugiZ+9EOTeQzykLzNXezUkYs1BymG EH4csOZvDWh/3gxOC/wT0xjyqmWleL/ou2pQLT6CsqGB6g6yq1Sxe6Z76Fgo4p6kLtaszmvT3zg iBSan779dRTf9L7lTXnUzOoR98ICUpWVFEEfJddT4ORTdFqrFRTj4s8qd5CcbmTSr/l5NhnHkv1 VLY5YpCw2+bXudcK3yALvzLO3CCs+5AM4dkg71kUNOZAemZ8HaWo10uvb3HIrsGd64osUX0gHUn ahnCabRmESGlvChRENUY/Lg4usmzBfSZfMTJ2fW1yCnc0yZDyCiaDi0sEJw6wyX12VWRq1k/Ph5 YoOCCGj99ADRMQDM+Y8cJEEW+1AeQKrryBds+4Sb5hV5Y6nU10aR7HhEimYeBRw8itJNJzh6ZtG r2SsDzAYB6J7SumHQmyilqwc8uR28l/YKvo0sXhZe5x0o0wgrHttSUxMAarEw/H8VLDLvLmtUpi R2I+Ie7 X-Google-Smtp-Source: AGHT+IHmu9VTvtAeFwjCxaomaQKd0bZd4wIlSSTmE655IttQAEneagYSSt/nFbvLMBMJNomeQHn5pg== X-Received: by 2002:a05:6214:19ed:b0:882:4e6c:5fce with SMTP id 6a1803df08f44-89075ee323fmr52661036d6.59.1767722852452; Tue, 06 Jan 2026 10:07:32 -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-890770ce659sm17717226d6.10.2026.01.06.10.07.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jan 2026 10:07:32 -0800 (PST) Date: Tue, 6 Jan 2026 13:06:57 -0500 From: Gregory Price To: "David Hildenbrand (Red Hat)" , hare@suse.de Cc: 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> 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: <9575e042-39f4-4f01-80db-34aaaa9312e6@kernel.org> On Tue, Jan 06, 2026 at 06:52:11PM +0100, David Hildenbrand (Red Hat) wrote: > On 1/6/26 17:58, Gregory Price wrote: > > On Tue, Jan 06, 2026 at 04:24:21PM +0100, David Hildenbrand (Red Hat) wrote: > > > > I'm not against this idea, but it also makes the sysfs a little more > > confusing (`echo online` now does different things based on prior > > state). > > Right, but only for the contig-zones policy. > > But maybe you really want the default for such memory to be "movable" even > when not onlined beforehand? So I am not sure if the description of the > problem here is accurate. > > Isn't one problem also udev racing with ndctl? > Yeah there's a bunch of races, the specific ones mentioned by Hannes i need to go back and re-listen to the talk. > > I preferred just failing if the block wasn't compatible with > > the zone (maybe making it more clear with a dmesg print?) > > The thing is that this block is compatible with the zone, no? > > In a system where you would never want to offline that memory, why should we > stop someone from onlining it to a kernel zone? I'm sure someone with a > weird use case will show up later that will complain about this. > Presumably you wouldn't be setting the MHP flag that prevents the blocks from being onlined in a kernel zone then - in which case this all just works as intended today. > But the patch is missing details on who would actually set MHP_MOVABLE_ONLY. > A user should be posted alongside the core change. > This is fair and probably the obvious immediate user would be a dax device with some kind of `dax0.0/protect_unplug` feature set. (With a better name obviuosly). I will defer to Hannes on his specific use case, but I could see the CXL-DCD (Dynamic Capacity) set wanting something like this. > > > > Anyway, let me know what your preference is, happy to pivot however. > > Restricting memory to be movable-only to handle a user-space problem as > described here sounds like the wrong approach to me. You really want the > default of such memory to be "movable". > > Almost like an optimized "auto-movable" policy :) > > Or a new policy that will respect a provided default (MHP_DEFAULT_MOVABLE). > Fair, I'll revist this once Hannes gets a chance to chime in. This was effective at getting the discussion started though :P ~Gregory