From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (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 9DF8A334C1D for ; Wed, 7 Jan 2026 17:19:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767806357; cv=none; b=nDezCtBMqmTr8SXcFdVCmL18oWPc2ugdG5qiUCh1WUp5Nk2eRiaDyo6iBLvXTki1Opkyv0YXqV89BlaT6m7TiaCeeROjU4kErEgyxFDZN0WHnhEMweO1x2hTRnx31MdeezznzB9ZXANCns2jj+gv9MTZkKPAX3msDiatq2CWBKo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767806357; c=relaxed/simple; bh=Xrc7Kl+5+r6hmkKPvnZH33c4NN/HOb5wJqVBvKr5bls=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=m1Ctg/p6oSysSimNrneyw9129JEiu5mqy88tK405jSiyBrXJj0nKbgM3v7g6rz+fqi4WYAggoO8nRiNwPcAX/AkoT3ENM55VvSSnlQmWHrKQGb50mk6XbZ6cWvKaPbyDHLP/4aFXuuw12bBz8iD8qTgj3tAg1dwHcThKf+6rugY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=HPWE8Qgp; arc=none smtp.client-ip=209.85.128.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="HPWE8Qgp" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-477563e28a3so8499945e9.1 for ; Wed, 07 Jan 2026 09:19:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1767806347; x=1768411147; 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=IZkL50mhnDpoFPWVVnY8H/NR1OQC1T5+YS9OD5apd4U=; b=HPWE8Qgpr81qgDfCvf5vbESyFyYF0Jq/xzO4INqKsRiN0m/DW+a9qA8EBvPHnZIi+u 5dnpk+zr0uiL0tXoqUPI56TlSQhr3/IXc6jK51SaF7jIUPIqpqySKDtkdCEGhmRfH3+N 3EugaJwOhi2n7aKzRTcOIeZLvyiqgySLTkhk++Z0NjdDNbzxpmyRVpcspI1dDx4X9z5/ 6wFuVa5GdMDhaKgM//53JY+s1nsSvcgmPIi8VX0eM6O7R2PWZctA9rh2w6ADsCy2148q /5KRPhDRP9kaYg+ZM3snVMLmE+5m4lgagBg1UOjkZ7b62vCRnMw3Ymffe8Q1x0Tbe+0K F2dQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767806347; x=1768411147; 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=IZkL50mhnDpoFPWVVnY8H/NR1OQC1T5+YS9OD5apd4U=; b=Wt4eXXKvSqIAnshj4r49sZEl9aZIVMTB/IcC/P7mtNsvZoEbo4Z8hvxSg6CgrnkVpr uNwr1Unw50kgDD7dlBlfiD8UCkBZtJlW/Zzxsunasl5GpRwKM60FOxuJZJuLKDSVgGpH kCbnQ+PQReudjA1tcZ9eWCISygSOpomMJVvaz7jW6BLRUyDUX0O3arI1Qff4yEq6pDX8 IUmA7MC07lVfvpnHfsnNptW3XZIgaDJuuqRjM6ooV5kryoe227pazd5dtQ2wxGMbfKhz CP4ZGfL1calRXrSPL6XOH4N1ZjVE9mwLn0sq+lKKHFy8P0bNL9hRw8RsVBYdROkuqniQ Jg4g== X-Forwarded-Encrypted: i=1; AJvYcCUkEWViMSqLiWGG6Qa4ufvzgBkfDKPI93p+Q0COtQITqnX8f9m0PKSJ0zg5kalYDCJO0wvnfvyA21b7v9w=@vger.kernel.org X-Gm-Message-State: AOJu0YwJNai6Oc+E5hCPTSxMEgEePLZHKJJ5fvGI2bCEIckhnqVfatpG h6xQ5KhQo4lbBqlrRrAbUBWasX2XhAjco7S4KDKYzYoyYe3v4v9cogvaUFHnFLHqCHc= X-Gm-Gg: AY/fxX7hurYIwRrRHg/bsBAfs5V1loE6SQDj02vF/WRX8duiy8eUygYzaFzXE0cFwmZ 0Rm0697YSHIcEYnRO+LOJLuON/5FIHGrK1guob3Xi/551W5YMteXMTXQuwVhIodZmioejQfotlI SRSg+BvRHuPUeS44rDJdgNd3s6SbosH9jJ4JpAJucaGia+kvQyjVMs7/Cnm88u7jmASpkRNVISN jUJTTlH7mTzmCFzZ/0KG9gUpWhfn9G5Phil0crJ8YZWX1gsRYnH8o2RQVUe8uorjjAEYjIDIiyA xRxqeFsgS2EAKgdtp8kaGPbdqJuO3I3FBFLKzvl7J0DizgVau6OejgzARItCE/623sNqgRYVM+1 gKgJ2fGU1Ts0Q+XnOjfzbHYpWb8wcQbfnWEE8//Msr6/5aDu/p2ZkVuhY2rbIqKl9QkTtTF++IF tmzcRwVaUHc/I1Im3EO1LLN1WF X-Google-Smtp-Source: AGHT+IEllamjyhFAQ4tTTzQKWVVKUc5/yvNYMGDOMELkUlpSdZ6gI98lAOXxkJFjDQicynDzogPRDQ== X-Received: by 2002:a05:600c:8b37:b0:47d:333d:99c with SMTP id 5b1f17b1804b1-47d84881c77mr38098245e9.18.1767806347146; Wed, 07 Jan 2026 09:19:07 -0800 (PST) Received: from localhost (109-81-93-164.rct.o2.cz. [109.81.93.164]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-432bd0860f5sm11228980f8f.0.2026.01.07.09.19.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jan 2026 09:19:06 -0800 (PST) Date: Wed, 7 Jan 2026 18:19:05 +0100 From: Michal Hocko To: "David Hildenbrand (Red Hat)" Cc: Gregory Price , 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, hare@suse.de Subject: Re: [RFC PATCH] memory,memory_hotplug: allow restricting memory blocks to zone movable Message-ID: References: <20260105203611.4079743-1-gourry@gourry.net> <39533aa8-ca78-41a8-b005-9202ce53e3ae@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: <39533aa8-ca78-41a8-b005-9202ce53e3ae@kernel.org> On Wed 07-01-26 16:09:34, David Hildenbrand wrote: > On 1/6/26 20:49, Michal Hocko wrote: > > On Tue 06-01-26 11:53:30, Gregory Price wrote: > > > On Tue, Jan 06, 2026 at 04:05:48PM +0100, Michal Hocko wrote: > > > > On Mon 05-01-26 15:36:11, Gregory Price wrote: > > > > > It was reported (LPC 2025) that userland services which monitor memory > > > > > blocks can cause hot-unplug to fail permanently. > > > > > > > > > > This can occur when drivers attempt to hot-remove memory in two phases > > > > > (offline, remove), while a userland service detects the memory offline > > > > > and re-onlines the memory into a zone which may prevent removal. > > > > > > > > Are there more details about this? > > > > > > The details are with Hannes, I was just recapping what was described in > > > his devmem talk at LPC ("To online or not online"). > > > > I know of policies to online newly added memory blocks but I am not > > aware of policies to re-online something that has been made offline. > > > > That being said, rather than movable_only, should we have a mask of > > > > online types supported for the mem block? > > > > > > > > > > I briefly considered this. I went with this for RFC-v1 since it's > > > fairly simple and because movable is really the only zone with hotplug > > > guarantees (any other zone makes no hotplug guarantees). > > > > > > It's also significantly more complex of a change for questionable value, > > > but if people see this as the way to go i'll happily pivot to that. > > > > Sure, I wouldn't push for more complexity just for the sake of a > > theoretical extensibility. And I have to admit I have't tried to a quick > > PoC to see how complex this could grow. I was hoping this could get into > > a simple mask for online types with default MMOP_ONLINE_KERNEL|MMOP_ONLINE_MOVABLE > > and special cases just choosing one of the two and zone_for_pfn_range > > checking for the compatibility with the requested online type. But I do > > appreciate there might be some obstacles on the way to achieve that. > > If we want to go down that path of failing onlining, we could likely do > without any core-MM changes: dax can simply register a memory notifier and > fail MEM_GOING_ONLINE of its memory with -EINVAL when it sees !ZONE_MOVABLE. > > That works, because online_pages() does the move_pfn_range_to_zone() before > calling MEM_GOING_ONLINE. Yes, that makes sense as well and it seems rather elegand way to go about that. -- Michal Hocko SUSE Labs