kmemleak: add unlikely() optimization to kmemleak_late_init
Subsystems (2)
PATCH 1/1 kmemleak: add unlikely() optimization to kmemleak_late_init
kmemleak: add unlikely() optimization to kmemleak_late_init()
Since there it is not very probable that kmemleak_disable() was called right after setting kmemleak_initialized, we could benefit from predicting it.
--- mm/kmemleak.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
mm/kmemleak.c +1 -1
@@ -1728,7 +1728,7 @@ static int __init kmemleak_late_init(void)atomic_set (&kmemleak_initialized,1 ); -if (atomic_read (&kmemleak_error)) { +if (unlikely (atomic_read (&kmemleak_error))) {/* * Some error occured and kmemleak was disabled. There is a * small chance that kmemleak_disable() was called immediately
Signature · 1 line
1.7.0.4
Catalin Marinas
maintainerQuoted 3 lines · Davidlohr Bueso
kmemleak: add
unlikely()optimization tokmemleak_late_init()Since there it is not very probable that
kmemleak_disable()was called right after settingkmemleak_initialized, we could benefit from predicting it.
The patch is correct and you can add my Acked-by but I don't really think it's worth. We save ~2 cycles during booting, no-one would ever notice.
Signature · 1 line
Catalin
Quoted 9 lines · Catalin Marinas
Quoted 3 lines · Davidlohr Bueso
kmemleak: add
unlikely()optimization tokmemleak_late_init()Since there it is not very probable that
kmemleak_disable()was called right after settingkmemleak_initialized, we could benefit from predicting it.The patch is correct and you can add my Acked-by but I don't really think it's worth. We save ~2 cycles during booting, no-one would ever notice.
Yeah, it's not a big performance booster, but IMHO it wouldn't hurt to add it. Since you are the maintainer it's up to you if you include it upstream.
Thanks,
Davidlohr