From owner-p4-projects@FreeBSD.ORG Sat Mar 18 17:02:01 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 833FF16A422; Sat, 18 Mar 2006 17:02:01 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 62EE816A401 for ; Sat, 18 Mar 2006 17:02:01 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6C6D943D70 for ; Sat, 18 Mar 2006 17:01:56 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k2IH1uPV004315 for ; Sat, 18 Mar 2006 17:01:56 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k2IH1r5x004312 for perforce@freebsd.org; Sat, 18 Mar 2006 17:01:53 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sat, 18 Mar 2006 17:01:53 GMT Message-Id: <200603181701.k2IH1r5x004312@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 93511 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Mar 2006 17:02:01 -0000 http://perforce.freebsd.org/chv.cgi?CH=93511 Change 93511 by rwatson@rwatson_peppercorn on 2006/03/18 17:01:32 When pulling the global audit queue's contents into a thread-local queue, generate one low water mark transition signal, rather than many, and generate it only if actually crossing the transition point, rather than every time we notice we're below it. Affected files ... .. //depot/projects/trustedbsd/audit3/sys/security/audit/audit.c#21 edit Differences ... ==== //depot/projects/trustedbsd/audit3/sys/security/audit/audit.c#21 (text+ko) ==== @@ -555,7 +555,7 @@ struct ucred *audit_cred; struct thread *audit_td; struct vnode *audit_vp; - int error; + int error, lowater_signal; AUDIT_PRINTF(("audit_worker starting\n")); @@ -607,13 +607,16 @@ * our own clustering, if the lower layers aren't doing it * automatically enough. */ + lowater_signal = 0; while ((ar = TAILQ_FIRST(&audit_q))) { TAILQ_REMOVE(&audit_q, ar, k_q); audit_q_len--; - if (audit_q_len <= audit_qctrl.aq_lowater) - cv_broadcast(&audit_commit_cv); + if (audit_q_len == audit_qctrl.aq_lowater) + lowater_signal++; TAILQ_INSERT_TAIL(&ar_worklist, ar, k_q); } + if (lowater_signal) + cv_broadcast(&audit_commit_cv); mtx_unlock(&audit_mtx); while ((ar = TAILQ_FIRST(&ar_worklist))) {