]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm/codetag: add pgalloc_tag_copy()
authorYu Zhao <yuzhao@google.com>
Fri, 6 Sep 2024 04:21:08 +0000 (22:21 -0600)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 9 Sep 2024 23:39:18 +0000 (16:39 -0700)
commite0a955bf7f61cb034d228736d81c1ab3a47a3dca
tree7e5645a5d878247257de304c46b7965d04a9d8fa
parent95599ef684d01136a8b77c16a7c853496786e173
mm/codetag: add pgalloc_tag_copy()

Add pgalloc_tag_copy() to transfer the codetag from the old folio to the
new one during migration.  This makes original allocation sites persist
cross migration rather than lump into the get_new_folio callbacks passed
into migrate_pages(), e.g., compaction_alloc():

  # echo 1 >/proc/sys/vm/compact_memory
  # grep compaction_alloc /proc/allocinfo

Before this patch:
  132968448  32463  mm/compaction.c:1880 func:compaction_alloc

After this patch:
          0      0  mm/compaction.c:1880 func:compaction_alloc

Link: https://lkml.kernel.org/r/20240906042108.1150526-3-yuzhao@google.com
Fixes: dcfe378c81f7 ("lib: introduce support for page allocation tagging")
Signed-off-by: Yu Zhao <yuzhao@google.com>
Acked-by: Suren Baghdasaryan <surenb@google.com>
Cc: Kent Overstreet <kent.overstreet@linux.dev>
Cc: Muchun Song <muchun.song@linux.dev>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/alloc_tag.h
include/linux/mm.h
mm/migrate.c