Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Feb 2001 12:05:36 -0800 (PST)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Tor Egge <tegge@FreeBSD.org>
Cc:        cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org
Subject:   RE: cvs commit: src/sys/kern kern_exit.c kern_resource.c
Message-ID:  <XFMail.010222120536.jhb@FreeBSD.org>
In-Reply-To: <200102221950.f1MJocH92712@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

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 <jhb@FreeBSD.org> -- 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.010222120536.jhb>