mm: avoid extra mem_alloc_profiling_enabled() checks
authorSuren Baghdasaryan <surenb@google.com>
Sat, 1 Feb 2025 23:18:00 +0000 (15:18 -0800)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 17 Mar 2025 05:06:03 +0000 (22:06 -0700)
commit51ff4d7486f0c0b4110a6da4af805b179dd7b11e
tree228cf2a3a17b7e8b7e00cfab9ceee517a4572c5f
parentc372473a545edff2fdbc002fc67c181e17c7557b
mm: avoid extra mem_alloc_profiling_enabled() checks

Refactor code to avoid extra mem_alloc_profiling_enabled() checks inside
pgalloc_tag_get() function which is often called after that check was
already done.

Link: https://lkml.kernel.org/r/20250201231803.2661189-1-surenb@google.com
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Reviewed-by: Shakeel Butt <shakeel.butt@linux.dev>
Cc: David Wang <00107082@163.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Kent Overstreet <kent.overstreet@linux.dev>
Cc: Minchan Kim <minchan@google.com>
Cc: Pasha Tatashin <pasha.tatashin@soleen.com>
Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Sourav Panda <souravpanda@google.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Yu Zhao <yuzhao@google.com>
Cc: Zhenhua Huang <quic_zhenhuah@quicinc.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/pgalloc_tag.h
lib/alloc_tag.c
mm/page_alloc.c