]> git.hungrycats.org Git - linux/commit
alloc_tag: introduce clear_page_tag_ref() helper function
authorSuren Baghdasaryan <surenb@google.com>
Tue, 13 Aug 2024 15:07:56 +0000 (08:07 -0700)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 16 Aug 2024 05:16:16 +0000 (22:16 -0700)
commita8fc28dad6d574582cdf2f7e78c73c59c623df30
treece85507c0014d9eec05a149b689312fad719bcea
parentedb907a6133323e19311901a39dee68b1c6a2ef8
alloc_tag: introduce clear_page_tag_ref() helper function

In several cases we are freeing pages which were not allocated using
common page allocators.  For such cases, in order to keep allocation
accounting correct, we should clear the page tag to indicate that the page
being freed is expected to not have a valid allocation tag.  Introduce
clear_page_tag_ref() helper function to be used for this.

Link: https://lkml.kernel.org/r/20240813150758.855881-1-surenb@google.com
Fixes: d224eb0287fb ("codetag: debug: mark codetags for reserved pages as empty")
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Suggested-by: David Hildenbrand <david@redhat.com>
Acked-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Pasha Tatashin <pasha.tatashin@soleen.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Kent Overstreet <kent.overstreet@linux.dev>
Cc: Sourav Panda <souravpanda@google.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: <stable@vger.kernel.org> [6.10]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/pgalloc_tag.h
mm/mm_init.c
mm/page_alloc.c