Date: Sat, 19 Mar 2016 05:22:16 +0200 From: Konstantin Belousov <kostikbel@gmail.com> To: John Baldwin <jhb@FreeBSD.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r297039 - head/sys/x86/x86 Message-ID: <20160319032216.GZ1741@kib.kiev.ua> In-Reply-To: <201603181948.u2IJmndg063765@repo.freebsd.org> References: <201603181948.u2IJmndg063765@repo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Mar 18, 2016 at 07:48:49PM +0000, John Baldwin wrote: > > - for (x = 0; x < delay; x += 5) { > + for (x = 0; x < delay; x++) { > if ((lapic_read_icr_lo() & APIC_DELSTAT_MASK) == > APIC_DELSTAT_IDLE) > return (1); > - DELAY(5); > + DELAY(1); > } > return (0); > } Ideally we would structure the loop differently. I think it is more efficient WRT latency to only block execution by ia32_pause(), and compare the the getbinuptime() results to calculate spent time, on each loop step.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20160319032216.GZ1741>