You discard speculations using the discard
function. When a speculative buffer is discarded, its contents are thrown away. If the speculation has only been active on the CPU calling discard
, the buffer is immediately available for subsequent calls to speculation
. If the speculation has been active on more than one CPU, the discarded buffer will be available for subsequent speculation
some time after the call to discard
. The time between a discard
on one CPU and the buffer being made available for subsequent speculations is guaranteed to be no longer than the time dictated by the cleaning rate. If, at the time speculation
is called, no buffer is available because all speculative buffers are currently being discarded or committed, adtrace message similar to the following example is generated:
dtrace: 905 failed speculations (available buffer(s) still busy)
The likelihood of all buffers being unavailable can be reduced by tuning the number of speculation buffers or the cleaning rate. See Speculation Options and Tuning, for details.