From owner-svn-src-head@FreeBSD.ORG Mon Mar 19 19:54:06 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 35A7B106576A; Mon, 19 Mar 2012 19:54:06 +0000 (UTC) (envelope-from davide.italiano@gmail.com) Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id 979CA8FC17; Mon, 19 Mar 2012 19:54:05 +0000 (UTC) Received: by vcmm1 with SMTP id m1so9359377vcm.13 for ; Mon, 19 Mar 2012 12:54:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=FTpgAtjlzFUK88Vjve2qzOxM4mRzZUprr0MGw9M0l88=; b=G93RmX0IcUFzFsJkz6hTdaxF7s1XHzP4ulOHae/JO1QLzOjkW/8gox2Z+vLO5yww22 kqB6AwjsiGbDNucvFcm+avWS/3/zJMFMoWZajIhlypDRqSZ+MWQZfyyEauOt9HaMp8SL 8RVZswQJ+OrAn/X4SqJIjDNXQN9K7wQ5XZVCOWJwlg4d+TIcfUqqHOjxDHFN4rPp+pQ0 WiQF7XrN7lsoVOqe5xsJoC7VViH/SIKG440wXHqCftC9xw6YvQB5ZxrFo4HYcHlvijVI vSGx6MDDWQJd6tTNwoh9icN0/V/+UlyKGIKTnQOkIIGqPZ4VNzWxAFxCWRjTN44pn62k euhw== MIME-Version: 1.0 Received: by 10.220.58.198 with SMTP id i6mr5268657vch.57.1332186844939; Mon, 19 Mar 2012 12:54:04 -0700 (PDT) Received: by 10.52.171.167 with HTTP; Mon, 19 Mar 2012 12:54:04 -0700 (PDT) In-Reply-To: <20120319194431.GD30704@FreeBSD.org> References: <201203162032.q2GKWBRV033715@svn.freebsd.org> <20120319194431.GD30704@FreeBSD.org> Date: Mon, 19 Mar 2012 20:54:04 +0100 Message-ID: From: Davide Italiano To: Gleb Smirnoff Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 19:54:06 -0000 2012/3/19 Gleb Smirnoff : > =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