|
|
Subscribe / Log in / New account

KS2011: Preemption disable and verifiable APIs

KS2011: Preemption disable and verifiable APIs

Posted Oct 26, 2011 8:39 UTC (Wed) by etienne (guest, #25256)
In reply to: KS2011: Preemption disable and verifiable APIs by valyala
Parent article: KS2011: Preemption disable and verifiable APIs

Or maybe get a pointer to a per-cpu structure at the beginning of your treatment and continue to use this pointer anyway, even if the processor has been changed under your foot.
Most of the time the processor will not be changed, so you get the speed, but anyway the code is always right, just in some rare cases slower.


to post comments

KS2011: Preemption disable and verifiable APIs

Posted Oct 26, 2011 16:56 UTC (Wed) by valyala (guest, #41196) [Link]

>> Or maybe get a pointer to a per-cpu structure at the beginning of your treatment and continue to use this pointer anyway, even if the processor has been changed under your foot.
This won't work if you are going to modify the per-cpu structure after the CPU has been changed. So you'll end up with either locking or atomic modifications for the structure. But since most of the time the structure is modified via native CPU, both locking and atomic modifications should be fast, because there is no cache line bouncing.


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