From owner-cvs-all Thu Feb 22 12: 5:56 2001 Delivered-To: cvs-all@freebsd.org Received: from meow.osd.bsdi.com (meow.osd.bsdi.com [204.216.28.88]) by hub.freebsd.org (Postfix) with ESMTP id A291537B401; Thu, 22 Feb 2001 12:05:50 -0800 (PST) (envelope-from jhb@FreeBSD.org) Received: from laptop.baldwin.cx (john@jhb-laptop.osd.bsdi.com [204.216.28.241]) by meow.osd.bsdi.com (8.11.2/8.11.2) with ESMTP id f1MK3al01249; Thu, 22 Feb 2001 12:03:36 -0800 (PST) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <200102221950.f1MJocH92712@freefall.freebsd.org> Date: Thu, 22 Feb 2001 12:05:36 -0800 (PST) From: John Baldwin To: Tor Egge Subject: RE: cvs commit: src/sys/kern kern_exit.c kern_resource.c Cc: cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On 22-Feb-01 Tor Egge wrote: > tegge 2001/02/22 11:50:37 PST > > Modified files: > sys/kern kern_exit.c kern_resource.c > Log: > Protect update of the per processor switchtime variable against > interrupts. Why not do this instead: mtx_lock_spin(&sched_lock); microuptime(PCPU_PTR(switchtime)); PCPU_SET(switchticks, ticks); mtx_unlock_spin(&sched_lock); ? > Protect usage of the per processor switchtime variable against > interrupts in calcru(). calcru() is called with sched_lock is held which prevents interrupts and thus already protects against preemption. > This seem to eliminate the "microuptime() went backwards" warnings. > > Revision Changes Path > 1.119 +6 -2 src/sys/kern/kern_exit.c > 1.75 +15 -7 src/sys/kern/kern_resource.c -- John Baldwin -- http://www.FreeBSD.org/~jhb/ PGP Key: http://www.baldwin.cx/~john/pgpkey.asc "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message