Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

kho: move alloc tag init to kho_init_{folio,pages}()

Commit 8f1081892d62 ("kho: simplify page initialization in
kho_restore_page()") cleaned up the page initialization logic by moving
the folio and 0-order-page paths into separate functions. It missed
moving the alloc tag initialization.

Do it now to keep the two paths cleanly separated. While at it, touch up
the comments to be a tiny bit shorter (mainly so it doesn't end up
splitting into a multiline comment). This is purely a cosmetic change and
there should be no change in behaviour.

Link: https://lkml.kernel.org/r/20260213085914.2778107-1-pratyush@kernel.org
Signed-off-by: Pratyush Yadav (Google) <pratyush@kernel.org>
Cc: Alexander Graf <graf@amazon.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Pasha Tatashin <pasha.tatashin@soleen.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Pratyush Yadav (Google) and committed by
Andrew Morton
63de231e 514c2fe9

+6 -9
+6 -9
kernel/liveupdate/kexec_handover.c
··· 219 219 /* For physically contiguous 0-order pages. */ 220 220 static void kho_init_pages(struct page *page, unsigned long nr_pages) 221 221 { 222 - for (unsigned long i = 0; i < nr_pages; i++) 222 + for (unsigned long i = 0; i < nr_pages; i++) { 223 223 set_page_count(page + i, 1); 224 + /* Clear each page's codetag to avoid accounting mismatch. */ 225 + clear_page_tag_ref(page + i); 226 + } 224 227 } 225 228 226 229 static void kho_init_folio(struct page *page, unsigned int order) ··· 232 229 233 230 /* Head page gets refcount of 1. */ 234 231 set_page_count(page, 1); 232 + /* Clear head page's codetag to avoid accounting mismatch. */ 233 + clear_page_tag_ref(page); 235 234 236 235 /* For higher order folios, tail pages get a page count of zero. */ 237 236 for (unsigned long i = 1; i < nr_pages; i++) ··· 269 264 kho_init_folio(page, info.order); 270 265 else 271 266 kho_init_pages(page, nr_pages); 272 - 273 - /* Always mark headpage's codetag as empty to avoid accounting mismatch */ 274 - clear_page_tag_ref(page); 275 - if (!is_folio) { 276 - /* Also do that for the non-compound tail pages */ 277 - for (unsigned int i = 1; i < nr_pages; i++) 278 - clear_page_tag_ref(page + i); 279 - } 280 267 281 268 adjust_managed_page_count(page, nr_pages); 282 269 return page;