From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 20:06:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 322A31065670; Mon, 19 Mar 2012 20:06:39 +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 8BA948FC0C; Mon, 19 Mar 2012 20:06:38 +0000 (UTC) Received: by vcmm1 with SMTP id m1so9375611vcm.13 for ; Mon, 19 Mar 2012 13:06:38 -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=ZEgh6IuybMz/e4koDYKoGD6udBJia4ZQegK+KeljHqs=; b=LBcxpspPXlp0sZHHGdLr0LaO60Wxvr9ZqP46Iy/c4p1VqocalB5+mrQ0hDyZw6I6Qx 9iwrvdbFKM70NtKlHEetMtgW28CDLDYfhre3T2kKtELJPywOlMsqPmgxYZnRycZ6TTyv 3/tt3dbtWtkpfc0M/Ex68idxCoYiiMXJIALEG9oNsxLr+reczV2fWoJKvvNYGJCxCuWE QE5qsCQy0SR8YAzbnHNExuWqVzURETVatVpJxZmA+a1qOwZF49t2oy7bTNdmzlPAGhnM ax7tn+BAeJU5CtYbBPM0nMJFJDTA6hP0DJZ3quK66GD64U4savcnjoyFpsw59xw+FIoh CNQQ== MIME-Version: 1.0 Received: by 10.220.141.146 with SMTP id m18mr5284386vcu.47.1332187597983; Mon, 19 Mar 2012 13:06:37 -0700 (PDT) Received: by 10.52.171.167 with HTTP; Mon, 19 Mar 2012 13:06:36 -0700 (PDT) In-Reply-To: References: <201203162032.q2GKWBRV033715@svn.freebsd.org> <20120319194431.GD30704@FreeBSD.org> Date: Mon, 19 Mar 2012 21:06:36 +0100 Message-ID: From: Davide Italiano To: Gleb Smirnoff , George Neville-Neil 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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 20:06:39 -0000 On Mon, Mar 19, 2012 at 8:54 PM, Davide Italiano wrote: > 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 um= tx 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_wait= ers =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_lengt= h =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_lengt= h; >> 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 througho= ut >> 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 This should fix: http://people.freebsd.org/~davide/umtx_stylefix.diff Can you plase give it a closer look? George, if everythin' is ok, can I have also your approval?