Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Oct 2006 17:40:40 -0400
From:      Jonathan Chen <jon@freebsd.org>
To:        freebsd-hackers@freebsd.org
Subject:   running code on all CPUs
Message-ID:  <20061004214040.GA6878@porthos.spock.org>

next in thread | raw e-mail | index | archive | help
Hello,

I'm currently writing kernel code to use MCA (machine check architecture) 
in order to detect things like ECC errors.  As part of this, I need to run 
code on all CPUs periodically to check some status registers.  Where is the 
best place to do this?  It doesn't seem that I can use regular kernel 
threads since I can't specify a CPU binding with that interface.  I've 
thought about hooking a function call to either the beginning of 
idle_proc() or somewhere in mi_switch(), but neither solution seems optimal 
since there are no guarantees when idle_proc() is ran and mi_switch() seems 
like a really bad idea from a performance standpoint.  Suggestions?

Also, are there any locking pitfalls or other issues I should be aware of 
when writing code to run in either idle_proc() or mi_switch()?

-Jon



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20061004214040.GA6878>