From owner-freebsd-arch@FreeBSD.ORG Tue Jul 12 03:56:04 2005 Return-Path: X-Original-To: arch@freebsd.org Delivered-To: freebsd-arch@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2522916A41C; Tue, 12 Jul 2005 03:56:04 +0000 (GMT) (envelope-from peter@wemm.org) Received: from canning.wemm.org (canning.wemm.org [192.203.228.65]) by mx1.FreeBSD.org (Postfix) with ESMTP id CD5C643D45; Tue, 12 Jul 2005 03:56:03 +0000 (GMT) (envelope-from peter@wemm.org) Received: from fw.wemm.org (canning.wemm.org [192.203.228.65]) by canning.wemm.org (Postfix) with ESMTP id A50BE2A8DA; Mon, 11 Jul 2005 20:56:03 -0700 (PDT) (envelope-from peter@wemm.org) Received: from overcee.wemm.org (overcee.wemm.org [10.0.0.3]) by fw.wemm.org (Postfix) with ESMTP id 54233E2B3; Mon, 11 Jul 2005 20:56:03 -0700 (PDT) (envelope-from peter@wemm.org) Received: from overcee.wemm.org (localhost [127.0.0.1]) by overcee.wemm.org (8.13.4/8.13.1) with ESMTP id j6C3u26l079995; Mon, 11 Jul 2005 20:56:02 -0700 (PDT) (envelope-from peter@wemm.org) Received: from localhost (localhost [[UNIX: localhost]]) by overcee.wemm.org (8.13.4/8.13.1/Submit) id j6C3u2xU079994; Mon, 11 Jul 2005 20:56:02 -0700 (PDT) (envelope-from peter@wemm.org) X-Authentication-Warning: overcee.wemm.org: peter set sender to peter@wemm.org using -f From: Peter Wemm To: freebsd-arch@freebsd.org Date: Mon, 11 Jul 2005 20:56:01 -0700 User-Agent: KMail/1.8.1 References: <20050701132104.GA95135@freefall.freebsd.org> <20050701155757.A36905@fledge.watson.org> In-Reply-To: <20050701155757.A36905@fledge.watson.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200507112056.02249.peter@wemm.org> X-Mailman-Approved-At: Tue, 12 Jul 2005 11:47:54 +0000 Cc: Peter Edwards , arch@freebsd.org, Robert Watson Subject: Re: ktrace and KTR_DROP X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jul 2005 03:56:04 -0000 On Friday 01 July 2005 08:04 am, Robert Watson wrote: > On Fri, 1 Jul 2005, Peter Edwards wrote: > > Ever since the introduction of a separate ktrace worker thread for > > writing output, there's the distinct possibility that ktrace output > > will drop requests. For some proceses, it's actually inevitable: as > > long as the traced processes can sustain a rate of generating > > ktrace events faster than the ktrace thread can write them, you'll > > eventually run out of ktrace requests. [..] > One of the things I've been thinking for a few years is that I think > I actually preferred the old model better, there processes (now > threads) would hang a "current record" off of their process (now > thread) structure, and fill it in as they went along. I much prefer the old model as well. I personally would like to have syscall returns delayed if the outstanding writes for ktrace requests is above a certain watermark. There have been several suggestions for how to do this. This could be as simple as throttling *all* ktrace writers as they return to userland from syscalls if the backlog is getting too large. But probably better would be to have each process responsible for its own writing and backlog management. ie: queue up the records to memory just like now, and start unwinding them at a convenient location in syscall return. -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com "All of this is for nothing if we don't go to the stars" - JMS/B5