From nobody Mon Apr 6 10:43:32 2026 Received: from mail-vs1-f48.google.com (mail-vs1-f48.google.com [209.85.217.48]) (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 1D4BA391E69 for ; Sat, 21 Mar 2026 15:04:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.217.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774105456; cv=none; b=UHfpfA/JeovbwEMgW3qQfkqz9Jx2aRdUWS3bEhgNpcYzfwEYwbmH5KxIOTt8QwfvQv1BEGzZ8YGlGt12QBYXuRAg7a5mbeF5SS369DK9CoMVGHNMYvgXwGINlKs9v+/6xk6n4nxnLyw9LQp943Nw6GyOrUyaH/s2cR2lPJDSe+I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774105456; c=relaxed/simple; bh=yADcON58BEc3yFXzCjE0Ob9wsd7UaBtY/rhvKXGDZqQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mAIf/wdZdSL5gcMcJZbi61zdO4RQBSoGJKfj/6jq4CpZNl78DZmv5E+sbnCoQQebnM6iGfvy64eWFwKjsU2Nh+29ghDVkURnUftv2PlA1T0ZNYWLcFwWe/IUO4G0Y9mHt3N69TuukBaikBYP8eavrp6aLwDaUoirNyy5+cKat14= 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=cWBEXRUE; arc=none smtp.client-ip=209.85.217.48 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="cWBEXRUE" Received: by mail-vs1-f48.google.com with SMTP id ada2fe7eead31-5fff52ab292so384765137.1 for ; Sat, 21 Mar 2026 08:04:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1774105454; x=1774710254; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=caGxMrakhd3CQmCyLFUIWJ+VIS649rYQrZPqpBwweHk=; b=cWBEXRUEXRo+Xq5gb1VIWQ3//d70gdeIrg3jLQqO/l41PjMS7vgdN31dRr8hOvw66J nIsF1FZg0bW6ImwTM5qtm6H+GO/2ahzi4u/UuW+IhB/PYin+hxhQrXVvg6gOiV/bofk7 5Mafn7GKH9p1VAh+aH16MafImru0M4P/QoJZmwgSXY33KH1fupYUh+DELJoUbSNGEkS9 Qcn23kITwRerHm2Rg6RcYtliMb9Ng1TOfTI/pNs4I8R1Xs0pbbH25bVUG3I2m0NNVaG3 hdLY98wcfBfdrpl9x9PzSgat1Vugchj6m7yVlZ/1993TigO9CVnVrNyTUTeKj9GxnO84 ngmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774105454; x=1774710254; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=caGxMrakhd3CQmCyLFUIWJ+VIS649rYQrZPqpBwweHk=; b=ajuxox/QtI5OAHEbuf1sxr5VYCWyjs5KVbrsJltcc8B/rVrTcCerftTAXVDL5CDUzr 3d6OLulvzH2l6ki1P05hB4YujuYPx8rkZWIqfrl0xuPgE4INYxM3BlyKF9lGCViqqP6v ILQwvIQIsqAvOiNu0/VFVueHE08m9jyH9m2jY0DOXTrLPG+f9Bf/wafDz9B5+JG21pDO JoDvqouxPE1VOeCvcwUav6JsNR98BAPtPIChopafhBy9FGdsvB9wbArow3VOyUm+vcjF fS2TOCY+UO3dZnr9QP8vsis4id6gF2SnYihQoQHunhBYMWxpXQz5Be+pLWYPurxqu1v0 J/6w== X-Forwarded-Encrypted: i=1; AJvYcCUWeEyisA8LkgyXMJ4907+4dHZL7OOMBNeB6bXS8C89g3e3mxbPjp1+i4BSISQRveBo2yVTEahQ7hSGHSQ=@vger.kernel.org X-Gm-Message-State: AOJu0YyVK8v9+xTVLhVYtvwcRMNmQ/Exd3XhYTRcT3Lrdw5h2ARV2O6p IMoChWa9cr6tzd8z7+U6nSWU3ff+9OyIlV+JIrKJIeT9+3iif8dMqOjnsjOhOUc+b+g= X-Gm-Gg: ATEYQzy7uWEcoAE5IFzIACJg6vsPt/qNLPBSpY6OwGE4l4SVnwJLpK5iOm2It479l6s 3jnvZ76IVI1faa+7MYGO9pe5QKeo2Q4r2kGGAR26/k9BY7p7wpyWh85yAlAxr6P0tlyRQrsU2wm gGenE344Ff89hPVlOvIKLti+HYozjcBCPTuY46UyiAWYofG/RqjCcoO/AQhO8sYSZH+mjDgnSRy Y31OcNN60OPxms8+uIcqD2JZrwu2SElURzplhlWfY4jmIq63NNSW/5zs0tkL0SxMxwYATJ8xffF FEOoXCg6kp7j1+brzzyNIVkSmWALJ1W4oA4qKL9x7sAPNKbYXg+gNV6snY+9DuYeT+mcuB3nwdJ 96LmwItvHyiBtml4DYE9UwikxNZEXH66LNSsj058zvwnkMLSgnPadL7ERSeKmvqZsZUyZuZSrtR 3RjY1h6FgFOb9GqBm12w/RhU5NC1dLjI3iUkL5frPqGY3RtXZ+mzaD50x5DiT8EM74diKA2XUkg 0WwBsy9SOAoQrPW0IirRd6tXQ== X-Received: by 2002:a05:6102:8089:b0:5ff:e39d:9f9b with SMTP id ada2fe7eead31-602aeb3a44amr3175883137.16.1774105454003; Sat, 21 Mar 2026 08:04:14 -0700 (PDT) Received: from gourry-fedora-PF4VCD3F.lan (pool-96-255-20-138.washdc.ftas.verizon.net. [96.255.20.138]) by smtp.gmail.com with ESMTPSA id af79cd13be357-8cfc90ba89fsm391979885a.40.2026.03.21.08.04.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Mar 2026 08:04:13 -0700 (PDT) From: Gregory Price To: linux-mm@kvack.org, vishal.l.verma@intel.com, dave.jiang@intel.com, akpm@linux-foundation.org, david@kernel.org, osalvador@suse.de Cc: dan.j.williams@intel.com, ljs@kernel.org, Liam.Howlett@oracle.com, vbabka@kernel.org, rppt@kernel.org, surenb@google.com, mhocko@suse.com, linux-kernel@vger.kernel.org, nvdimm@lists.linux.dev, linux-cxl@vger.kernel.org, kernel-team@meta.com Subject: [PATCH 3/8] mm/memory_hotplug: pass online_type to online_memory_block() via arg Date: Sat, 21 Mar 2026 11:03:59 -0400 Message-ID: <20260321150404.3288786-4-gourry@gourry.net> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260321150404.3288786-1-gourry@gourry.net> References: <20260321150404.3288786-1-gourry@gourry.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Modify online_memory_block() to accept the online type through its arg parameter rather than calling mhp_get_default_online_type() internally. This prepares for allowing callers to specify explicit online types. Update the caller in add_memory_resource() to pass the default online type via a local variable. No functional change. Cc: Oscar Salvador Cc: Andrew Morton Acked-by: David Hildenbrand (Red Hat) Signed-off-by: Gregory Price --- mm/memory_hotplug.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 86d3faf50453..282bf3d89613 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -1338,7 +1338,9 @@ static int check_hotplug_memory_range(u64 start, u64 = size) =20 static int online_memory_block(struct memory_block *mem, void *arg) { - mem->online_type =3D mhp_get_default_online_type(); + enum mmop *online_type =3D arg; + + mem->online_type =3D *online_type; return device_online(&mem->dev); } =20 @@ -1492,6 +1494,7 @@ static int create_altmaps_and_memory_blocks(int nid, = struct memory_group *group, int add_memory_resource(int nid, struct resource *res, mhp_t mhp_flags) { struct mhp_params params =3D { .pgprot =3D pgprot_mhp(PAGE_KERNEL) }; + enum mmop online_type =3D mhp_get_default_online_type(); enum memblock_flags memblock_flags =3D MEMBLOCK_NONE; struct memory_group *group =3D NULL; u64 start, size; @@ -1580,7 +1583,8 @@ int add_memory_resource(int nid, struct resource *res= , mhp_t mhp_flags) =20 /* online pages if requested */ if (mhp_get_default_online_type() !=3D MMOP_OFFLINE) - walk_memory_blocks(start, size, NULL, online_memory_block); + walk_memory_blocks(start, size, &online_type, + online_memory_block); =20 return ret; error: --=20 2.53.0