LWN.net Logo

Hand-waving about a phased sleep

Hand-waving about a phased sleep

Posted Jan 7, 2009 18:26 UTC (Wed) by BrucePerens (guest, #2510)
In reply to: Hand-waving about a phased sleep by johntb86
Parent article: Btrfs aims for the mainline

Perhaps we need hardware support to make this work properly. A timed halt instruction, or a low-level atomic primitive that can wake a processor waiting for an address.


(Log in to post comments)

Hand-waving about a phased sleep

Posted Jan 7, 2009 21:29 UTC (Wed) by jlokier (guest, #52227) [Link]

x86 does have a primitive to wait on an address: monitor/mwait.
It waits until the monitored location is modified by another processor.

I read that it's a bit slow for this sort of thing.

In principle, if it were fast (and it could be with MESI caches),
it would be very well suited to replace all spinning waits.

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