From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (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 3CE44314D13 for ; Wed, 7 Jan 2026 12:47:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767790065; cv=none; b=l7yeJcOJxHhvJdhplRa88Um56MeCGUJUX1JD3+aU1Ux3811WanJK1SbUXCnf0hLkTX+85J/lq3y1RRJLEOf5Jzu0VhlMndR6/sCreuxg7ikuxmGtNAWiublFJn6ceaZ5SXb4bJwhJi7ZxKUoym09zgubnynSZWzp/iWQkXVA4bg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767790065; c=relaxed/simple; bh=sHQT0zduypQ7A6qX1u7OPJonNpZN3+DE+izImPJugK0=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=SpKvMtoVgNXr2TU+DHJRpK3RVN17sTeqTSmgBtcp7dsNXt2iTB1MJlu+CcqZPFcy8/baNJle3arZ+9xFOikVC6BIhgm00SB2SS1zOhXvi1iaBpKzp3Fo33jLxvUK+vBdrg+g2eksem0iHjT1wUfO97gCu+vLDjrLzBkGLVKHs8k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=J02v0lJc; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=Pi1la0j1; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=J02v0lJc; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=Pi1la0j1; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="J02v0lJc"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="Pi1la0j1"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="J02v0lJc"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="Pi1la0j1" Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 7102733C2C; Wed, 7 Jan 2026 12:47:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1767790062; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=l4yeaiwFw4tFr94QA0WF6Qmoj2lmHuBzJ0Gyzocch9Q=; b=J02v0lJcmFfUHIBCQh1KeYlJ4SIX7PXEXiv0UZgqTr0kJCYnoVDlgPnP4NAcnRrgOwn40D RRt/yy+mLFiYsJcKKI8vNZ5kPpXXJScRfmAEZZlkFTj73vkz2R19QuvZNP/Zel3RLda4RM T50J03s0OPkOPHfMbTqVk8913+SYWcw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1767790062; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=l4yeaiwFw4tFr94QA0WF6Qmoj2lmHuBzJ0Gyzocch9Q=; b=Pi1la0j1rVisr6xRsyp4Vf2Xkd3BiP87V1B6+bahEKU+FcJ19mzc+mJZKsx486pPuKMFJm CHygq9ydid+NfDCg== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1767790062; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=l4yeaiwFw4tFr94QA0WF6Qmoj2lmHuBzJ0Gyzocch9Q=; b=J02v0lJcmFfUHIBCQh1KeYlJ4SIX7PXEXiv0UZgqTr0kJCYnoVDlgPnP4NAcnRrgOwn40D RRt/yy+mLFiYsJcKKI8vNZ5kPpXXJScRfmAEZZlkFTj73vkz2R19QuvZNP/Zel3RLda4RM T50J03s0OPkOPHfMbTqVk8913+SYWcw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1767790062; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=l4yeaiwFw4tFr94QA0WF6Qmoj2lmHuBzJ0Gyzocch9Q=; b=Pi1la0j1rVisr6xRsyp4Vf2Xkd3BiP87V1B6+bahEKU+FcJ19mzc+mJZKsx486pPuKMFJm CHygq9ydid+NfDCg== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 0E0923EA63; Wed, 7 Jan 2026 12:47:42 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id vucEAu5VXml2YAAAD6G6ig (envelope-from ); Wed, 07 Jan 2026 12:47:42 +0000 Message-ID: <88dbe97c-3510-4ce7-ae85-067243a152bd@suse.de> Date: Wed, 7 Jan 2026 13:47:41 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC PATCH] memory,memory_hotplug: allow restricting memory blocks to zone movable To: Michal Hocko , Gregory Price Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@meta.com, david@redhat.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 References: <20260105203611.4079743-1-gourry@gourry.net> Content-Language: en-US From: Hannes Reinecke In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Flag: NO X-Spam-Score: -4.27 X-Spam-Level: X-Spamd-Result: default: False [-4.27 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.17)[-0.851]; MIME_GOOD(-0.10)[text/plain]; FUZZY_RATELIMITED(0.00)[rspamd.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; RCPT_COUNT_TWELVE(0.00)[16]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email,suse.de:mid,imap1.dmz-prg2.suse.org:helo] 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. > It's not a policy per-se, but rather a udev rule (which one could argue _is_ a policy, mind). There is a rather long-running SLES bug around this if you are interested... But in either case: we cannot prevent the user from writing arbitrary udev rules. But we should make sure that the result of udev actions makes sense for the system. >>> 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. Yes, and really it's only ZONE_MOVABLE for which such a treatment makes sense currently. Once we have other zone types we might need to re-evaluate that. But for now I guess we're fine with a simple flag. Cheers, Hannes -- Dr. Hannes Reinecke Kernel Storage Architect hare@suse.de +49 911 74053 688 SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich