]> git.baikalelectronics.ru Git - kernel.git/commit
ftrace: Simplify the calculation of page number for ftrace_page->records
authorWei Yang <richard.weiyang@linux.alibaba.com>
Mon, 31 Aug 2020 03:11:02 +0000 (11:11 +0800)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Thu, 8 Oct 2020 19:29:06 +0000 (15:29 -0400)
commitc23789f2018a251845d3bd55d7b413286241ed5d
tree9f5cf98fcd3a13f2951d7d2b8c0cc12ffec45738
parent3303b6e28c65ef1451ecf415c91137b8075ff163
ftrace: Simplify the calculation of page number for ftrace_page->records

Based on the following two reasones, we could simplify the calculation:

  - If the number after roundup count is not power of 2, we would
    definitely have more than 1 empty page with a higher order.
  - get_count_order() just return current order, so one lower order
    could meet the requirement.

The calculation could be simplified by lower one order level when pages
are not power of 2.

Link: https://lkml.kernel.org/r/20200831031104.23322-5-richard.weiyang@linux.alibaba.com
Signed-off-by: Wei Yang <richard.weiyang@linux.alibaba.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
kernel/trace/ftrace.c