Skip to content

Commit bcea02b

Browse files
Wang Wenshengrostedt
authored andcommitted
ftrace: Optimize the allocation for mcount entries
If we can't allocate this size, try something smaller with half of the size. Its order should be decreased by one instead of divided by two. Link: https://lkml.kernel.org/r/20221109094434.84046-3-wangwensheng4@huawei.com Cc: <mhiramat@kernel.org> Cc: <mark.rutland@arm.com> Cc: stable@vger.kernel.org Fixes: a790087 ("ftrace: Allocate the mcount record pages as groups") Signed-off-by: Wang Wensheng <wangwensheng4@huawei.com> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
1 parent 08948ca commit bcea02b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/trace/ftrace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3190,7 +3190,7 @@ static int ftrace_allocate_records(struct ftrace_page *pg, int count)
31903190
/* if we can't allocate this size, try something smaller */
31913191
if (!order)
31923192
return -ENOMEM;
3193-
order >>= 1;
3193+
order--;
31943194
goto again;
31953195
}
31963196

0 commit comments

Comments
 (0)