Background Thread and Installer
Background Thread and Installer
- Subject: Background Thread and Installer
- From: Duane Murphy <email@hidden>
- Date: Mon, 28 Dec 2009 16:11:29 -0800
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
We have a problem with our kext where our background thread in the
kernel is not shutting down during a system update installation.
Our kext that is a subclass of IOBlockStorageDriver. The kext runs a
background thread directly processing raw sectors from the disk.
During a system update installation, all user processes quit except
for the installation process. Our kernel thread keeps running in the
background just fine. The problem is that the kext is never notified
of the need to shutdown the system, so the system appears to just hang
as our thread continues to run.
We see this most reliably when updating from 10.6 to 10.6.2 (Combo
updater). We also see a variation of this when performing additional
system software updates on 10.6.2. However, in this case, I believe a
timeout has been added (possibly to alleviate this problem). After
about 2 minutes following the completion of the installer, a system
shutdown notice is given to the kext (via our
registerPrioritySleepWakeInterest callback function). But even in this
case, the process is not allowed to complete properly and the system
never completes shutting down. The system ends up in an odd state
where even an NMI won't register, but the system is not shutdown.
My suspicion is that we must be holding some kind of semaphore-like
object that is preventing the system from shutting down, but I don't
know what it is. Or the system is just waiting for threads to go idle,
in which case I need to work out what I should be watching in order to
idle the thread. If I manually close the thread (with the help of
gdb), the system shuts down normally.
The thread waiting for the system to shutdown looks like:
thread_invoke
thread_block_reason
thread_block
lck_rw_sleep
vm_fault_page
vm_object_update
memory_object_lock_request
ubc_setsize
hfs_vnop_inactive
VNOP_INACTIVE
vclean
vnode_reclaim_internal
vflush
dounmount
vfs_unmountall
boot
reboot
unix_syscall
lo_unix_syscall
What is this thread waiting for and how can I know?
What event am I missing? How can I know to close this thread to allow
the system to shutdown properly? Note, I'd like to keep the disk
process running in the background as long as possible, until the
installation process is complete.
Thanks for your help,
...Duane
-----BEGIN PGP SIGNATURE-----
Version: PGP Desktop 9.10.0 (Build 500)
Charset: US-ASCII
wsBVAwUBSzlJRUrg9acQ4r2CAQiLEQf+KAt4SQhuhfrKm7MdxqaG1TTLNSIr5sxb
+lTE75maLxATkVq+DCs0QGOrrDcyflC8ctQoUa4askmdAbtBTU/V4/HOKYw89ctI
bQpfV26SJDXIv1ke2EY+J+1JTxukXG21jP7ZJVQIZ1A+Nrt4A+Pz/p1IhA7keuB9
4X1w7MLDRsfI0dm8iv9L3+DfEKrqY9nNkrUK9BnoXuPfXdIDyJbRGHh8lW+NoOwr
I8oGyQywBf1y7EtCoScoKhwJDHxGDwfKV93YQBBqke3HJ4VH0e+V63dnkKQ7n+gf
k4rLIwvUSXKnGECKc3KTU0fW8gTj6PU4jzz2w6dvAvO4HAgX52xN0g==
=hfw4
-----END PGP SIGNATURE-----
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden