Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 May 2016 22:22:18 -0700
From:      NGie Cooper <yaneurabeya@gmail.com>
To:        Mark Johnston <markj@FreeBSD.org>
Cc:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r300110 - head/sys/kern
Message-ID:  <7D442C5C-E059-40A5-887C-55840BE94425@gmail.com>
In-Reply-To: <201605180355.u4I3tskK012821@repo.freebsd.org>
References:  <201605180355.u4I3tskK012821@repo.freebsd.org>

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

> On May 17, 2016, at 20:55, Mark Johnston <markj@FreeBSD.org> wrote:
>=20
> Author: markj
> Date: Wed May 18 03:55:54 2016
> New Revision: 300110
> URL: https://svnweb.freebsd.org/changeset/base/300110
>=20
> Log:
>  Do not acquire the thread lock in hardclock_cnt() unless needed.
>=20
>  This function only sets thread flags if a SIGPROF or SIGVTALRM timer
>  has fired, which is almost never the case.
>=20
>  MFC after:    2 weeks
>=20
> Modified:
>  head/sys/kern/kern_clock.c
>=20
> Modified: head/sys/kern/kern_clock.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D
> --- head/sys/kern/kern_clock.c    Wed May 18 03:50:21 2016    (r300109)
> +++ head/sys/kern/kern_clock.c    Wed May 18 03:55:54 2016    (r300110)
> @@ -570,9 +570,11 @@ hardclock_cnt(int cnt, int usermode)
>            flags |=3D TDF_PROFPEND | TDF_ASTPENDING;
>        PROC_ITIMUNLOCK(p);
>    }
> -    thread_lock(td);
> -    td->td_flags |=3D flags;
> -    thread_unlock(td);
> +    if (flags !=3D 0) {
> +        thread_lock(td);
> +        td->td_flags |=3D flags;
> +        thread_unlock(td);
> +    }

Use predict_false?
>=20
> #ifdef    HWPMC_HOOKS
>    if (PMC_CPU_HAS_SAMPLES(PCPU_GET(cpuid)))
>=20



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?7D442C5C-E059-40A5-887C-55840BE94425>