From owner-p4-projects@FreeBSD.ORG Fri Oct 12 13:30:18 2007 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 66DC416A421; Fri, 12 Oct 2007 13:30:18 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F0F1916A418 for ; Fri, 12 Oct 2007 13:30:17 +0000 (UTC) (envelope-from csjp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id D294D13C458 for ; Fri, 12 Oct 2007 13:30:17 +0000 (UTC) (envelope-from csjp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id l9CDUH0R040660 for ; Fri, 12 Oct 2007 13:30:17 GMT (envelope-from csjp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id l9CDUHvB040657 for perforce@freebsd.org; Fri, 12 Oct 2007 13:30:17 GMT (envelope-from csjp@freebsd.org) Date: Fri, 12 Oct 2007 13:30:17 GMT Message-Id: <200710121330.l9CDUHvB040657@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to csjp@freebsd.org using -f From: "Christian S.J. Peron" To: Perforce Change Reviews Cc: Subject: PERFORCE change 127427 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: Fri, 12 Oct 2007 13:30:18 -0000 http://perforce.freebsd.org/chv.cgi?CH=127427 Change 127427 by csjp@push on 2007/10/12 13:29:57 - Change the wakeup logic associated with having multiple sleepers on multiple different audit pipes. The old method used cv_signal() which would result in only one thread being woken up after we appended a record to it's queue. This resulted in un-timely wakeups when processing audit records. - Assign PSOCK priority to threads that have been sleeping on a read(2). This is the same priority threads are woken up with when they select(2) or poll(2). This ensures fairness between various forms of sleep on the audit pipes. Affected files ... .. //depot/projects/trustedbsd/audit3/sys/security/audit/audit_pipe.c#33 edit Differences ... ==== //depot/projects/trustedbsd/audit3/sys/security/audit/audit_pipe.c#33 (text+ko) ==== @@ -466,7 +466,7 @@ } audit_pipe_records++; mtx_unlock(&audit_pipe_mtx); - cv_signal(&audit_pipe_cv); + cv_broadcastpri(&audit_pipe_cv, PSOCK); } /* @@ -493,7 +493,7 @@ audit_pipe_append(ap, record, record_len); audit_pipe_records++; mtx_unlock(&audit_pipe_mtx); - cv_signal(&audit_pipe_cv); + cv_broadcastpri(&audit_pipe_cv, PSOCK); }