From owner-svn-src-all@FreeBSD.ORG Mon Mar 19 19:44:39 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 611D0106566C; Mon, 19 Mar 2012 19:44:39 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.64.117]) by mx1.freebsd.org (Postfix) with ESMTP id DA7CC8FC08; Mon, 19 Mar 2012 19:44:38 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id q2JJiVio019066; Mon, 19 Mar 2012 23:44:31 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id q2JJiVRK019065; Mon, 19 Mar 2012 23:44:31 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 19 Mar 2012 23:44:31 +0400 From: Gleb Smirnoff To: Davide Italiano Message-ID: <20120319194431.GD30704@FreeBSD.org> References: <201203162032.q2GKWBRV033715@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <201203162032.q2GKWBRV033715@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) 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 19:44:39 -0000 Davide, 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> Add rudimentary profiling of the hash table used in the in the umtx code to D> hold active lock queues. D> D> Reviewed by: attilio D> Approved by: davidxu, gnn (mentor) D> MFC after: 3 weeks D> D> Modified: D> head/sys/conf/NOTES D> head/sys/conf/options D> head/sys/kern/kern_umtx.c ... D> static void D> umtxq_sysinit(void *arg __unused) D> { D> @@ -232,8 +265,15 @@ umtxq_sysinit(void *arg __unused) D> TAILQ_INIT(&umtxq_chains[i][j].uc_pi_list); D> umtxq_chains[i][j].uc_busy = 0; D> umtxq_chains[i][j].uc_waiters = 0; D> + #ifdef UMTX_PROFILING D> + umtxq_chains[i][j].length = 0; D> + umtxq_chains[i][j].max_length = 0; D> + #endif D> } D> } D> + #ifdef UMTX_PROFILING D> + umtx_init_profiling(); D> + #endif D> mtx_init(&umtx_lock, "umtx lock", NULL, MTX_SPIN); D> EVENTHANDLER_REGISTER(process_exec, umtx_exec_hook, NULL, D> EVENTHANDLER_PRI_ANY); D> @@ -384,6 +424,14 @@ umtxq_insert_queue(struct umtx_q *uq, in D> D> TAILQ_INSERT_TAIL(&uh->head, uq, uq_link); D> uh->length++; D> + #ifdef UMTX_PROFILING D> + uc->length++; D> + if (uc->length > uc->max_length) { D> + uc->max_length = uc->length; D> + if (uc->max_length > max_length) D> + max_length = uc->max_length; D> + } D> + #endif D> uq->uq_flags |= UQF_UMTXQ; D> uq->uq_cur_queue = uh; D> return; D> @@ -401,6 +449,9 @@ umtxq_remove_queue(struct umtx_q *uq, in D> uh = uq->uq_cur_queue; D> TAILQ_REMOVE(&uh->head, uq, uq_link); D> uh->length--; D> + #ifdef UMTX_PROFILING D> + uc->length--; D> + #endif D> uq->uq_flags &= ~UQF_UMTXQ; D> if (TAILQ_EMPTY(&uh->head)) { D> KASSERT(uh->length == 0, These indented ifdefs look like a major violation of style used throughout the FreeBSD kernel code. Can you please keep with common style? -- Totus tuus, Glebius.