aboutsummaryrefslogtreecommitdiff
path: root/lib/cpu-notifier-error-inject.c
diff options
context:
space:
mode:
authorVlastimil Babka <[email protected]>2016-12-12 16:44:38 -0800
committerLinus Torvalds <[email protected]>2016-12-12 18:55:08 -0800
commitd5a187daf5856df9b997f9d208e5a7b64006eb2e (patch)
treea9543d74a74fac2bc7a2c5bf378968e92e6fb9b4 /lib/cpu-notifier-error-inject.c
parent46e8a3a08c23d07d0f21fabeed182b671af68c93 (diff)
mm, rmap: handle anon_vma_prepare() common case inline
anon_vma_prepare() is mostly a large "if (unlikely(...))" block, as the expected common case is that an anon_vma already exists. We could turn the condition around and return 0, but it also makes sense to do it inline and avoid a call for the common case. Bloat-o-meter naturally shows that inlining the check has some code size costs: add/remove: 1/1 grow/shrink: 4/0 up/down: 475/-373 (102) function old new delta __anon_vma_prepare - 359 +359 handle_mm_fault 2744 2796 +52 hugetlb_cow 1146 1170 +24 hugetlb_fault 2123 2145 +22 wp_page_copy 1469 1487 +18 anon_vma_prepare 373 - -373 Checking the asm however confirms that the hot paths now avoid a call, which is moved away. [[email protected]: coding-style fixes] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Vlastimil Babka <[email protected]> Cc: "Kirill A. Shutemov" <[email protected]> Cc: Johannes Weiner <[email protected]> Cc: Konstantin Khlebnikov <[email protected]> Cc: Rik van Riel <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'lib/cpu-notifier-error-inject.c')
0 files changed, 0 insertions, 0 deletions