]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm, page_alloc: use check_pages_enabled static key to check tail pages
authorVlastimil Babka <vbabka@suse.cz>
Wed, 5 Apr 2023 14:28:40 +0000 (16:28 +0200)
committerAndrew Morton <akpm@linux-foundation.org>
Wed, 5 Apr 2023 23:02:57 +0000 (16:02 -0700)
commita95a0bb97c5af272c6f08b23ad042d42c4028637
treec46d653a1b1c593e47762e3a4d5cbb467b2c11e0
parente8c7ecb290fe405dedc3f8ccc180092f07624b26
mm, page_alloc: use check_pages_enabled static key to check tail pages

Commit 700d2e9a36b9 ("mm, page_alloc: reduce page alloc/free sanity
checks") has introduced a new static key check_pages_enabled to control
when struct pages are sanity checked during allocation and freeing.  Mel
Gorman suggested that free_tail_pages_check() could use this static key as
well, instead of relying on CONFIG_DEBUG_VM.  That makes sense, so do
that.  Also rename the function to free_tail_page_prepare() because it
works on a single tail page and has a struct page preparation component as
well as the optional checking component.

Also remove some unnecessary unlikely() within static_branch_unlikely()
statements that Mel pointed out for commit 700d2e9a36b9.

Link: https://lkml.kernel.org/r/20230405142840.11068-1-vbabka@suse.cz
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Suggested-by: Mel Gorman <mgorman@techsingularity.net>
Acked-by: Mel Gorman <mgorman@techsingularity.net>
Cc: Alexander Halbuer <halbuer@sra.uni-hannover.de>
Cc: Kees Cook <keescook@chromium.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/hugetlb_vmemmap.c
mm/page_alloc.c