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.

migrate: optimise alloc_migration_target()

Extract the zone number directly from the folio instead of using the
folio's zone number to look up the zone and asking the zone what its
number is.

[ziy@nvidia.com: fix folio_zonenum() return type]
Link: https://lkml.kernel.org/r/26E8FF35-503E-4F14-98F7-7B4FA25FBD37@nvidia.com
Link: https://lkml.kernel.org/r/20251106201452.2292631-2-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Zi Yan <ziy@nvidia.com>
Cc: David Hildenbrand <david@kernel.org>
Cc: Zi Yan <ziy@nvidia.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Joshua Hahn <joshua.hahnjy@gmail.com>
Cc: Rakie Kim <rakie.kim@sk.com>
Cc: Byungchul Park <byungchul@sk.com>
Cc: Gregory Price <gourry@gourry.net>
Cc: Ying Huang <ying.huang@linux.alibaba.com>
Cc: Alistair Popple <apopple@nvidia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Matthew Wilcox (Oracle) and committed by
Andrew Morton
c537f0dd e24f66e8

+2 -2
+2 -2
mm/migrate.c
··· 2164 2164 gfp_t gfp_mask; 2165 2165 unsigned int order = 0; 2166 2166 int nid; 2167 - int zidx; 2167 + enum zone_type zidx; 2168 2168 2169 2169 mtc = (struct migration_target_control *)private; 2170 2170 gfp_mask = mtc->gfp_mask; ··· 2190 2190 gfp_mask |= GFP_TRANSHUGE; 2191 2191 order = folio_order(src); 2192 2192 } 2193 - zidx = zone_idx(folio_zone(src)); 2193 + zidx = folio_zonenum(src); 2194 2194 if (is_highmem_idx(zidx) || zidx == ZONE_MOVABLE) 2195 2195 gfp_mask |= __GFP_HIGHMEM; 2196 2196