User: Password:
|
|
Subscribe / Log in / New account

Memory part 6: More things programmers can do

Memory part 6: More things programmers can do

Posted Nov 4, 2007 20:19 UTC (Sun) by jengelh (subscriber, #33263)
Parent article: Memory part 6: More things programmers can do

>6.4.2 Atomicity Optimizations
> 
>Adding a relatively expensive operation like a conditional jump (expensive in case the branch
prediction fails) seems to be counter productive.

The Linux kernel uses a smarter strategy, where it patches away the 'lock' insn by modifying
its own code and replace it with NOPs, making it run through neither a jump nor an
unconditional 'lock'. ( http://lwn.net/Articles/164121/ ) It does not work reliably for
userspace due to W^X and such, oh well, but at least it does for the kernel.


(Log in to post comments)


Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds