kernel trap 19 with interrupts disabled

Bruce Evans bde at zeta.org.au
Thu Jun 10 19:22:16 GMT 2004


On Thu, 10 Jun 2004, Don Bowman wrote:

> Out of curiousity, why not use something like this, so the
> timeout is fixed in time, rather than a #? I used the tsc here.
>
> static int
> my_stop_cpus(u_int map)
> {
>     unsigned long long end_ts = rdtsc() +
>                                 1ULL * tsc_freq;
>     /* send the Xcpustop IPI to all CPUs in map */
>     selected_apic_ipi(map, XCPUSTOP_OFFSET, APIC_DELMODE_FIXED);
>     while ((stopped_cpus & map) != map)
>     {
>        /* Wait 1 second */
>        if ( rdtsc() > end_ts )
>            return 0;
>     }
>     return 1;
> }

I just copied stop_cpus().  rdtsc() and microtime() can't be used
there, and neither can DELAY() if we call stop_cpus() from ddb (which
we do), since some versions of DELAY() use locks and ddb can't use any
public locks since it weould deadlock if it was trapped to from code
that holds a lock that ddb wants to use.

Bruce


More information about the freebsd-current mailing list