From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qt1-f195.google.com (mail-qt1-f195.google.com [209.85.160.195]) (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 8E08C3815E8 for ; Wed, 14 Jan 2026 08:52:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.195 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768380764; cv=none; b=GaWcZvVVwMfv1Zh5u5Jb/yefeyaWiYcosT5TqXbqHKh/76AUC4tDV05im7yYhfFqwouQWEwXQEvAee9YWCjVKyj1mJE7Pj3yvPc7fkUvIpP8qYw34vLSKqrNTGBIhNYIUK59CD2Z7xTxYUTFe+mKuLRUGhuco8I31BS/5mmnRu0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768380764; c=relaxed/simple; bh=cImdW1I8gYlqyptmlVX3KT4VCZEIXu721DnCa4CHzjU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=aaO6wrmPfjKQR+wcCXkfuJJca8NIeqH+tC1HnsvhUCrBEcJuEXiaVnzYZ1YrDqViAObNUVYOypZ8ENhLV6LDJn0bdcnRxX9ONl0HAbbsbVnoE6LeOoRzxA3UXddmYfsiDBgo5tJQFUlsE4A78MmOhqEPBj4lFKVcnCgXaCZSwUQ= 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=iPb5fm9s; arc=none smtp.client-ip=209.85.160.195 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="iPb5fm9s" Received: by mail-qt1-f195.google.com with SMTP id d75a77b69052e-5014b671367so4672461cf.3 for ; Wed, 14 Jan 2026 00:52:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1768380756; x=1768985556; 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=HDpE5wtoJCiMhRN5zrFeLb7soUJCKnfGA3SqaObqP6g=; b=iPb5fm9swWgWO2eh1QPvukxqDkxt1UksMJYNDKPobAEXcz20vYs8GKuCoJdaOB/NGL TvpEt5m70mn4S2oL/3boWvKZKl1l9ba75iSTe6+g8DibL4mWNg7c90k1r3X+J2HUEcl9 Al6eZ2h6zVbpDnYUDxLOfoH6QGjgjWtNTg4oPLFPQ1d7QOWz9onp/dTa5qP5NotdLzXA 0lzF9NDA+xYvKHtohqCXO4UxlHLdu1qyxkSyoHEfvMZ0McYNoH1h0Ris/5P9vDvu6Bgd YNp8ZZ1SHZpYXN8dQJhf4B2DdfFzW+BfmbEiSYCdgYItzy8nIXarx52WpOswAHa5H/W3 53sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768380756; x=1768985556; 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=HDpE5wtoJCiMhRN5zrFeLb7soUJCKnfGA3SqaObqP6g=; b=mirrN23TfDwlZpZkobweZRS9ZCWssaXEAIjbpqMdukppro5AoPg10hhLZMddIiUe2M qMKZN3P64XU+bGRCUTarotEW2wS5x5BDGDeuNenAfhfRwxqA3t10KSiuJtQ8MLx0yvta w5WP/kpyne2h5OMePLecyeTp0jbl2DhJ/tm4P5oWvl1OrIFaiRE38Z6DcPY7p9L4BRxs sy9xormP3xfehOVUdzthW1aHLtPsAVTkZIpW2hdcKN5NwWOH7FNPZJtO7OfVPl2l1XHZ MBy6Rhn+yD/cOvZrnUx7J3D5oIQkjsLY6cZDlwRb5DLAfUCxdmz/lJRy6wTMS/f2Tre4 szWQ== X-Forwarded-Encrypted: i=1; AJvYcCW1lcK4aJwBGvOgqH84D/FoFQzrgxcQ7Mi3DsOQlSsE1i9cxKIbLc8ekFOrynjlBj8wPOuwJEO/QVaq3c8=@vger.kernel.org X-Gm-Message-State: AOJu0Yw8R+kEhYyeyDySy2RkbWBlD5DFj/0ihN0NLSnWTJaQv1Swxy1F uwqmS7lR+aylpeczi+IxueODeDuzzOm9k5QBlfLXlJdaPHK5Tgqj3qgOV0vgcUurO2M= X-Gm-Gg: AY/fxX4QAwhLdkVJO24vlxqMi/PJEecCS8370zeXsPjEosr3D7ZQytYewzikvKbVpK0 mz+J8To+Ex1U/WVRnsbeGD0tKHRmIspaLq1k1M8n28Y8BIvsOmOATCZvojaavczCDR+tSNDj9Pc FtMs0+yHTalfXEHM/uMyq6MrWW/zmX4mb59wnTvOwFCKJe4AADPD5Cq87iNjB6m4E3dmZ8cl6qj Mz38u4quLB/liy66x76PMc4p5PE7I5JAWtypEZfWVbgyioNRSpvM8Ijnc0gFbwCV+USKHK11LXY p9p0C00UortjeQSPFs8ZNEAgV0YoNdYQYGXlGNEPS9WJpmglFqDrGEL3Y3Eha0hOC1Z+vAo3IK0 cmg+FtYSNX3jEO4VXhzGrm5vdiCyaoBnKlZS1BHgW1XRD0MNJHTNVEIeXjxoUkWzDVIBxy4Drew +3l1b2uQ3BT4fkO413z9YfA5ci0wEDaT3ft540OxmmkKIn5Bth9RDK2eFi0hTEjIjEdOzk8v7YH 4Cxwd2aVm4cPw== X-Received: by 2002:a05:622a:18a9:b0:4f1:ac9c:9388 with SMTP id d75a77b69052e-50148125e71mr26783181cf.0.1768380756171; Wed, 14 Jan 2026 00:52:36 -0800 (PST) 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 d75a77b69052e-50148df8759sm10131931cf.10.2026.01.14.00.52.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jan 2026 00:52:35 -0800 (PST) From: Gregory Price To: linux-mm@kvack.org Cc: linux-cxl@vger.kernel.org, nvdimm@lists.linux.dev, linux-kernel@vger.kernel.org, virtualization@lists.linux.dev, kernel-team@meta.com, dan.j.williams@intel.com, vishal.l.verma@intel.com, dave.jiang@intel.com, david@kernel.org, mst@redhat.com, jasowang@redhat.com, xuanzhuo@linux.alibaba.com, eperezma@redhat.com, osalvador@suse.de, akpm@linux-foundation.org Subject: [PATCH 1/8] mm/memory_hotplug: pass online_type to online_memory_block() via arg Date: Wed, 14 Jan 2026 03:51:53 -0500 Message-ID: <20260114085201.3222597-2-gourry@gourry.net> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260114085201.3222597-1-gourry@gourry.net> References: <20260114085201.3222597-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: 8bit 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. Signed-off-by: Gregory Price --- mm/memory_hotplug.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 389989a28abe..5718556121f0 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -1337,7 +1337,9 @@ static int check_hotplug_memory_range(u64 start, u64 size) static int online_memory_block(struct memory_block *mem, void *arg) { - mem->online_type = mhp_get_default_online_type(); + int *online_type = arg; + + mem->online_type = *online_type; return device_online(&mem->dev); } @@ -1578,8 +1580,12 @@ int add_memory_resource(int nid, struct resource *res, mhp_t mhp_flags) merge_system_ram_resource(res); /* online pages if requested */ - if (mhp_get_default_online_type() != MMOP_OFFLINE) - walk_memory_blocks(start, size, NULL, online_memory_block); + if (mhp_get_default_online_type() != MMOP_OFFLINE) { + int online_type = mhp_get_default_online_type(); + + walk_memory_blocks(start, size, &online_type, + online_memory_block); + } return ret; error: -- 2.52.0