Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Mar 2012 20:54:04 +0100
From:      Davide Italiano <davide.italiano@gmail.com>
To:        Gleb Smirnoff <glebius@freebsd.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r233045 - in head/sys: conf kern
Message-ID:  <CACYV=-EmbDNep1rPwF6jfHB2M8JuhLDFvrsvZoBMuVB7kOC1bA@mail.gmail.com>
In-Reply-To: <20120319194431.GD30704@FreeBSD.org>
References:  <201203162032.q2GKWBRV033715@svn.freebsd.org> <20120319194431.GD30704@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
2012/3/19 Gleb Smirnoff <glebius@freebsd.org>:
> =A0Davide,
>
> On Fri, Mar 16, 2012 at 08:32:11PM +0000, Davide Italiano wrote:
> D> Author: davide
> D> Date: Fri Mar 16 20:32:11 2012
> D> New Revision: 233045
> D> URL: http://svn.freebsd.org/changeset/base/233045
> D>
> D> Log:
> D> =A0 Add rudimentary profiling of the hash table used in the in the umt=
x code to
> D> =A0 hold active lock queues.
> D>
> D> =A0 Reviewed by: =A0 =A0 =A0 attilio
> D> =A0 Approved by: =A0 =A0 =A0 davidxu, gnn (mentor)
> D> =A0 MFC after: 3 weeks
> D>
> D> Modified:
> D> =A0 head/sys/conf/NOTES
> D> =A0 head/sys/conf/options
> D> =A0 head/sys/kern/kern_umtx.c
>
> ...
>
> D> =A0static void
> D> =A0umtxq_sysinit(void *arg __unused)
> D> =A0{
> D> @@ -232,8 +265,15 @@ umtxq_sysinit(void *arg __unused)
> D> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0TAILQ_INIT(&umtxq_chains[i]=
[j].uc_pi_list);
> D> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0umtxq_chains[i][j].uc_busy =
=3D 0;
> D> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0umtxq_chains[i][j].uc_waite=
rs =3D 0;
> D> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0#ifdef UMTX_PROFILING
> D> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0umtxq_chains[i][j].length =3D=
 0;
> D> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0umtxq_chains[i][j].max_length=
 =3D 0;
> D> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0#endif
> D> =A0 =A0 =A0 =A0 =A0 =A0 =A0}
> D> =A0 =A0 =A0}
> D> + =A0 =A0#ifdef UMTX_PROFILING
> D> + =A0 =A0umtx_init_profiling();
> D> + =A0 =A0#endif
> D> =A0 =A0 =A0mtx_init(&umtx_lock, "umtx lock", NULL, MTX_SPIN);
> D> =A0 =A0 =A0EVENTHANDLER_REGISTER(process_exec, umtx_exec_hook, NULL,
> D> =A0 =A0 =A0 =A0 =A0EVENTHANDLER_PRI_ANY);
> D> @@ -384,6 +424,14 @@ umtxq_insert_queue(struct umtx_q *uq, in
> D>
> D> =A0 =A0 =A0TAILQ_INSERT_TAIL(&uh->head, uq, uq_link);
> D> =A0 =A0 =A0uh->length++;
> D> + =A0 =A0#ifdef UMTX_PROFILING
> D> + =A0 =A0uc->length++;
> D> + =A0 =A0if (uc->length > uc->max_length) {
> D> + =A0 =A0 =A0 =A0 =A0 =A0uc->max_length =3D uc->length;
> D> + =A0 =A0 =A0 =A0 =A0 =A0if (uc->max_length > max_length)
> D> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0max_length =3D uc->max_length=
;
> D> + =A0 =A0}
> D> + =A0 =A0#endif
> D> =A0 =A0 =A0uq->uq_flags |=3D UQF_UMTXQ;
> D> =A0 =A0 =A0uq->uq_cur_queue =3D uh;
> D> =A0 =A0 =A0return;
> D> @@ -401,6 +449,9 @@ umtxq_remove_queue(struct umtx_q *uq, in
> D> =A0 =A0 =A0 =A0 =A0 =A0 =A0uh =3D uq->uq_cur_queue;
> D> =A0 =A0 =A0 =A0 =A0 =A0 =A0TAILQ_REMOVE(&uh->head, uq, uq_link);
> D> =A0 =A0 =A0 =A0 =A0 =A0 =A0uh->length--;
> D> + =A0 =A0 =A0 =A0 =A0 =A0#ifdef UMTX_PROFILING
> D> + =A0 =A0 =A0 =A0 =A0 =A0uc->length--;
> D> + =A0 =A0 =A0 =A0 =A0 =A0#endif
> D> =A0 =A0 =A0 =A0 =A0 =A0 =A0uq->uq_flags &=3D ~UQF_UMTXQ;
> D> =A0 =A0 =A0 =A0 =A0 =A0 =A0if (TAILQ_EMPTY(&uh->head)) {
> D> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0KASSERT(uh->length =3D=3D 0=
,
>
> These indented ifdefs look like a major violation of style used throughou=
t
> the FreeBSD kernel code. Can you please keep with common style?
>
> --
> Totus tuus, Glebius.

Heh,
sorry, also Juli Mallet noticed this, I'm writing a fix for this and
after I'll have approval from my mentor I'll commit.

Davide



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CACYV=-EmbDNep1rPwF6jfHB2M8JuhLDFvrsvZoBMuVB7kOC1bA>