Date: Fri, 11 Jun 2004 05:22:00 +1000 (EST) From: Bruce Evans <bde@zeta.org.au> To: Don Bowman <don@sandvine.com> Cc: "'current@freebsd.org'" <current@FreeBSD.org> Subject: RE: kernel trap 19 with interrupts disabled Message-ID: <20040611051146.L10787@gamplex.bde.org> In-Reply-To: <FE045D4D9F7AED4CBFF1B3B813C85337051D8F5C@mail.sandvine.com> References: <FE045D4D9F7AED4CBFF1B3B813C85337051D8F5C@mail.sandvine.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040611051146.L10787>