From nobody Sun Feb 8 13:10:24 2026 Received: from m16.mail.163.com (m16.mail.163.com [220.197.31.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D42581A2392 for ; Tue, 13 Jan 2026 03:35:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=220.197.31.2 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768275330; cv=none; b=hDjsSTcHyMtjFXythJwawq2RxZKkEfz0DZxSGa8CKdb5weEok9euZ31CoVuG8UOZhrgEn6VOSWOWlMlUT6+hUvoODqmbfXqiPmptb1Fho0rElKTBAKr/QOHeiI9u247FIC1e13EVvZdYZXvlCQHua+pBst5uc5AQKWbrgKM5cjI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768275330; c=relaxed/simple; bh=chA10W6guKsFiVVKi3z5qpsU2aMDeQVv0vRq+W3auc0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=JhKMF+wjXqMJc0gtx0Vp0jLT4vIyMSK6x7aLsS4ZuBH2RdVTMgBxgPrErxFAk/xzT3egIZck+gc1zOwW5oQmVHGTKWW3I3m4VYLdCWQZO7Ae/Gw932eIc7ExPehG2bRvBmo8PidwOtl/AtmVKvMcNclgU04mRew0VagFXXBLe64= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com; spf=pass smtp.mailfrom=163.com; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b=VIzHpzDf; arc=none smtp.client-ip=220.197.31.2 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b="VIzHpzDf" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:To:Subject:Date:Message-ID:MIME-Version; bh=kG 53ciijNmoTnssyHfq8vIOccM9yp/KKrUz9IyCeyAI=; b=VIzHpzDfyJdSbzSux5 I1/9+g9NxthwkYv7DqlCSW6qOd6sJCanUCdh2As/A6GDW5ij84JEAT8VgzQCedFh RRdbDg8LY+knitxcpFzlojQPjb/dVEnLt5LaszOodbmsifYafDD1mIQhYYr71Ag5 J9VbKNuBa8Xq9y3xLFn0SknkE= Received: from ubuntu24-z.. (unknown []) by gzga-smtp-mtada-g1-2 (Coremail) with SMTP id _____wDXrf0wvWVpTNjGFQ--.289S2; Tue, 13 Jan 2026 11:34:10 +0800 (CST) From: ranxiaokai627@163.com To: graf@amazon.com, rppt@kernel.org, pasha.tatashin@soleen.com, pratyush@kernel.org, akpm@linux-foundation.org, surenb@google.com Cc: kexec@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, ran.xiaokai@zte.com.cn, ranxiaokai627@163.com Subject: [PATCH v2] kho: init alloc tags when restoring pages from reserved memory Date: Tue, 13 Jan 2026 03:34:03 +0000 Message-ID: <20260113033403.161869-1-ranxiaokai627@163.com> X-Mailer: git-send-email 2.43.0 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 X-CM-TRANSID: _____wDXrf0wvWVpTNjGFQ--.289S2 X-Coremail-Antispam: 1Uf129KBjvJXoW7ArWkWr1xuFWrXFyruw4xXrb_yoW8WFy5pr y8Xr18J3y8J3ZrZayvq3Wq934fXan5W3y3Ja4Du34fZrnxCwn7ta97Za40qFy5Zr4vvF43 KF4UXrWYq3WY9w7anT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0piOtx3UUUUU= X-CM-SenderInfo: xudq5x5drntxqwsxqiywtou0bp/xtbCxhIve2llvTIqUAAA35 Content-Type: text/plain; charset="utf-8" From: Ran Xiaokai Memblock pages (including reserved memory) should have their allocation tags initialized to CODETAG_EMPTY via clear_page_tag_ref() before being released to the page allocator. When kho restores pages through kho_restore_page(), missing this call causes mismatched allocation/deallocation tracking and below warning message: alloc_tag was not set WARNING: include/linux/alloc_tag.h:164 at ___free_pages+0xb8/0x260, CPU#1: = swapper/0/1 RIP: 0010:___free_pages+0xb8/0x260 kho_restore_vmalloc+0x187/0x2e0 kho_test_init+0x3c4/0xa30 do_one_initcall+0x62/0x2b0 kernel_init_freeable+0x25b/0x480 kernel_init+0x1a/0x1c0 ret_from_fork+0x2d1/0x360 Add missing clear_page_tag_ref() annotation in kho_restore_page() to fix this. Fixes: fc33e4b44b27 ("kexec: enable KHO support for memory preservation") Signed-off-by: Ran Xiaokai Reviewed-by: Mike Rapoport (Microsoft) Reviewed-by: Suren Baghdasaryan Reviewed-by: Pasha Tatashin --- kernel/liveupdate/kexec_handover.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/liveupdate/kexec_handover.c b/kernel/liveupdate/kexec_h= andover.c index cd6b3fb9dcae..2d47f2c50bd8 100644 --- a/kernel/liveupdate/kexec_handover.c +++ b/kernel/liveupdate/kexec_handover.c @@ -268,6 +268,7 @@ static struct page *kho_restore_page(phys_addr_t phys, = bool is_folio) else kho_init_pages(page, nr_pages); =20 + clear_page_tag_ref(page); adjust_managed_page_count(page, nr_pages); return page; } --=20 2.25.1