From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 355F8318B9D for ; Sun, 11 Jan 2026 09:11:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768122710; cv=none; b=eLtIH1fbJ4/ZH/ZGhCJSBF0PpokzzypuXw9snvJa1pC88ZSJzuScCgqVkya7ICSL252AhLtracAaTcPseAUKhvriPfTmXzKhAqPv3tjLq7AE+UExPB0Hf01C17jJLm7tuxFJ35ZPMXC1W+WryPE8snHy8gLMpobKOjpva/bO1nM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768122710; c=relaxed/simple; bh=uZsS9eMgw1qIS04QngwB711PIkKR14sDba+wAXFooJs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Qt3VHMQ/AxTTDcKzEDOSQOezRqifu14ju1EZeIv84X4o5G3n/kIDfJmoeHWUGfTplqanic/6CmJWeKhIewSnBFeFon6q2l0vI2te9kJVX6NSWlTzjZEw0k6FUHgS6JOKTCyFqmN4GofZ+opAeAP3d0394NGiL9+DYhqMSzM8gt8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=XBx97/xK; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="XBx97/xK" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8FD5DC4CEF7; Sun, 11 Jan 2026 09:11:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1768122709; bh=uZsS9eMgw1qIS04QngwB711PIkKR14sDba+wAXFooJs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XBx97/xKW55BHFhSVToAhSY74nwEwwCtS78dADYRniDyX4CCS+3en/HYGMkyrXmoV /AuPJB3Y2UD40BzYuaBuU1jtdVgm9eTzkA5RElTPjcTOCpNVq5sSYYp6Dk99gditdt 3M6U8KdpHXpkSSryv8WSVPFLVJFtZPDmWbsJm+2MyeoVvwSUP5+yJHQyvE+DvBLKCR hIUoLfNEZvCsRTUjPlIeBfo3bK/hQ0ujKZrqXZe+/+BLDgjSa23ix6CXF1Jw0Wl2gc 5alBnwzzdT2yyhiSc2/ET4a+K+T/6OUo2CHG7R++XQrj1+wOBneVJ8fdWC/d1VSHRz 62nNZ6eZ6EuzQ== Date: Sun, 11 Jan 2026 11:11:42 +0200 From: Mike Rapoport To: Andrew Morton Cc: ranxiaokai627@163.com, graf@amazon.com, pasha.tatashin@soleen.com, pratyush@kernel.org, surenb@google.com, kexec@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, ran.xiaokai@zte.com.cn Subject: Re: [PATCH] kho: init alloc tags when restoring pages from reserved memory Message-ID: References: <20260109104251.157767-1-ranxiaokai627@163.com> <20260110162843.ecd8e731bdc281f4cd8e4764@linux-foundation.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: <20260110162843.ecd8e731bdc281f4cd8e4764@linux-foundation.org> On Sat, Jan 10, 2026 at 04:28:43PM -0800, Andrew Morton wrote: > On Fri, 9 Jan 2026 10:42:51 +0000 ranxiaokai627@163.com wrote: > > > 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 warning message: > > alloc_tag was not set. > > > > Add missing clear_page_tag_ref() annotation in kho_restore_page() to > > fix this. > > Great, thanks. > > It would be helpful to quote that warning message in the patch > changelog, please. > > > --- 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); > > > > + clear_page_tag_ref(page); > > adjust_managed_page_count(page, nr_pages); > > return page; > > } > > Warning splats are pretty bad and it's desirable to fix this in > previous kernel versions. > > To do that it's best for us to identify which kernel version(s) should > be patched, via a Fixes: tag in the changelog. > > From a quick look, it appears that Pratyush's 12b9a2c05d1b ("kho: > initialize tail pages for higher order folios properly") is a suitable > anchor, what do people think? I think it should be even earlier: fc33e4b44b27 ("kexec: enable KHO support for memory preservation") > Meanwhile I'll queue this up for some testing while awaiting maintainer > feedback. -- Sincerely yours, Mike.