freebsd-nq/sys
Konstantin Belousov 57d07ca9f0 When callout_reset_on() cannot immediately migrate a callout since it
is running on other cpu, the CALLOUT_PENDING flag is temporarily
cleared. Then, callout_stop() on this, in fact active, callout fails
because CALLOUT_PENDING is not set, and callout_stop() returns 0.

Now, in sleepq_check_timeout(), the failed callout_stop() causes the
sleepq code to execute mi_switch() without even setting the wmesg,
since the switch-out is supposed to be transient. In fact, the thread
is put off the CPU for full timeout interval, instead of being put on
runq immediately.  Until timeout fires, the process is unkillable for
obvious reasons.

Fix this by marking the migrating callouts with CALLOUT_DFRMIGRATION
flag. The flag is cleared by callout_stop_safe() when the function
detects a migration, besides returning the success. The softclock()
rechecks the flag for migrating callout and cancels its execution if
the flag was cleared meantime.

PR:	 misc/166340
Reported, debugging traces provided and tested by:
	Christian Esken <christian.esken trivago com>
Reviewed by:	 avg, jhb
MFC after:	 1 week
2012-05-03 10:38:02 +00:00
..
amd64 Add a convenience macro for the returns_twice attribute, and apply it to 2012-04-29 11:04:31 +00:00
arm Fix comment about what board this is really for left over from early 2012-05-02 18:41:58 +00:00
boot Remove some redundant register loads. 2012-05-02 05:49:58 +00:00
bsm
cam Add support for: 2012-04-29 22:28:15 +00:00
cddl Partially revert r232938; ZFS only requires nfs4 but not posix1e. 2012-04-29 16:21:47 +00:00
compat - Implement pipe2 syscall for Linuxulator. This syscall appeared in 2.6.27 2012-04-16 21:22:02 +00:00
conf Break out the arge MDIO bus code into an optional argemdio device. 2012-05-01 06:18:30 +00:00
contrib Revert r234834 per luigi@ request. 2012-05-03 08:56:43 +00:00
crypto Add support for the extended FPU states on amd64, both for native 2012-01-21 17:45:27 +00:00
ddb Update the ddb and gdb backends for the new 'trace_thread' hook. 2012-04-12 21:34:58 +00:00
dev Added D_TRACKCLOSE to sndstat_cdevsw to fix the situation when 2012-05-02 19:32:11 +00:00
fs fixed a unionfs_readdir math issue 2012-05-03 07:22:29 +00:00
gdb Update the ddb and gdb backends for the new 'trace_thread' hook. 2012-04-12 21:34:58 +00:00
geom Add optional -o argument to the graid label to specify some metadata 2012-05-03 05:32:56 +00:00
gnu/fs Remove unused thread argument to vrecycle(). 2012-04-23 14:10:34 +00:00
i386 Add a convenience macro for the returns_twice attribute, and apply it to 2012-04-29 11:04:31 +00:00
ia64 Add a convenience macro for the returns_twice attribute, and apply it to 2012-04-29 11:04:31 +00:00
isa
kern When callout_reset_on() cannot immediately migrate a callout since it 2012-05-03 10:38:02 +00:00
kgssapi
libkern Remove second consts in r233288 in order to appease C++ compilers. 2012-03-26 18:22:04 +00:00
mips In the new world order, multiphy is now when the phymask is 0x0. 2012-05-03 07:48:19 +00:00
modules Fix make depend. 2012-05-01 07:38:40 +00:00
net Revert r234834 per luigi@ request. 2012-05-03 08:56:43 +00:00
net80211 Update HWMP Proactive code and mesh route flags. 2012-05-01 16:18:38 +00:00
netatalk Fix typos 2012-02-28 15:07:05 +00:00
netgraph Fix panic in ng_patch(4) caused by checksum flags being added to mbuf flags. 2012-04-22 17:00:52 +00:00
netinet Fix another RFC 6458 issue. Spotted by Irene Ruengeler. 2012-05-03 10:26:33 +00:00
netinet6 in6_pcblookup_local() still can return a pcb with NULL 2012-03-21 08:43:38 +00:00
netipsec Add multi-FIB IPv6 support to the core network stack supplementing 2012-02-03 13:08:44 +00:00
netipx Convert all users of IF_ADDR_LOCK to use new locking macros that specify 2012-01-05 19:00:36 +00:00
netnatm
netncp
netsmb
nfs Add multi-FIB IPv6 support to the core network stack supplementing 2012-02-03 13:08:44 +00:00
nfsclient Remove unused thread argument from vtruncbuf(). 2012-04-23 13:21:28 +00:00
nfsserver
nlm jwd@ reported a problem via email to freebsd-fs@ on Aug 25, 2011 2012-01-31 02:11:05 +00:00
ofed Revert r234834 per luigi@ request. 2012-05-03 08:56:43 +00:00
opencrypto
pc98 Clean up the intr* MD KPI from the SMP dependency, removing a cause of 2012-04-26 20:24:25 +00:00
pci intpm: add ATI IXP400 pci id 2012-04-16 10:33:46 +00:00
powerpc Add a convenience macro for the returns_twice attribute, and apply it to 2012-04-29 11:04:31 +00:00
rpc
security When allocation of labels on files is implicitly disabled due to MAC 2012-04-08 11:01:49 +00:00
sparc64 Add a convenience macro for the returns_twice attribute, and apply it to 2012-04-29 11:04:31 +00:00
sys When callout_reset_on() cannot immediately migrate a callout since it 2012-05-03 10:38:02 +00:00
teken
tools Make vnode_if.awk parse vnode operations with underscores, like VOP_FOO_BAR. 2012-02-21 19:35:59 +00:00
ufs Remove unused thread argument from ufs_extattr_uepm_lock()/ufs_extattr_uepm_unlock(). 2012-04-23 17:56:35 +00:00
vm Avoid a lock order reversal in pmap_extract_and_hold() from relocking 2012-04-22 17:58:30 +00:00
x86 Clean up the intr* MD KPI from the SMP dependency, removing a cause of 2012-04-26 20:24:25 +00:00
xdr
xen blkif interface comment cleanups. No functional changes 2012-02-29 17:47:01 +00:00
Makefile Add sys/ofed to the 'make cscope' target. 2012-03-20 18:05:15 +00:00