From owner-freebsd-arch@FreeBSD.ORG Fri Jul 25 22:17:41 2008 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D59251065680 for ; Fri, 25 Jul 2008 22:17:41 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.154]) by mx1.freebsd.org (Postfix) with ESMTP id 5F68A8FC0C for ; Fri, 25 Jul 2008 22:17:40 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: by fg-out-1718.google.com with SMTP id l26so2788743fgb.35 for ; Fri, 25 Jul 2008 15:17:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender :to:subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references :x-google-sender-auth; bh=EeNVVKWUD956mOQ1k2CH2jzHhyr1W7imaA8K2BIZcFs=; b=biMOP4cC+1jO5KzUCsacrF4pLerovKPjWc4J45zjsQh9ySn0M0wR79XMUj0YaAa9ji 9daCgjFIiGWOlA/rNnJRcs8ApHp8Mzzv9VJG4sKx9km0gnafx0Nw+n4rLsdolyV0s9/q VoKZiBINnklzYrdhgxVWY424viZ9GOKHV/q+s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references:x-google-sender-auth; b=hv0+//QdqY0yuocAyG5hRhMXbJpvLPwLJ9DKCxObUqauK535KdiwZrABsrHsSEy++C LuuATfT5rl3jFvshQHzLPb4GlE1F2F2OATVkQn3cBqVU8DoWtgPJQRtMxOST1VmsHkjh LHilEYwokSJO6YcL/IHzBj+AjShpxQHukJVcE= Received: by 10.86.98.14 with SMTP id v14mr379263fgb.74.1217024259643; Fri, 25 Jul 2008 15:17:39 -0700 (PDT) Received: by 10.86.2.18 with HTTP; Fri, 25 Jul 2008 15:17:39 -0700 (PDT) Message-ID: <3bbf2fe10807251517v73447626j90458ebcd5345eaf@mail.gmail.com> Date: Sat, 26 Jul 2008 00:17:39 +0200 From: "Attilio Rao" Sender: asmrookie@gmail.com To: "Jeff Roberson" In-Reply-To: <20080724162733.B954@desktop> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20080718163231.B954@desktop> <200807211141.09387.jhb@freebsd.org> <20080724162733.B954@desktop> X-Google-Sender-Auth: 548be71ed4e18716 Cc: arch@freebsd.org, ivmaykov@gmail.com Subject: Re: witness performance improvements 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: Fri, 25 Jul 2008 22:17:41 -0000 2008/7/25, Jeff Roberson : > On Mon, 21 Jul 2008, John Baldwin wrote: > > > On Friday 18 July 2008 10:41:58 pm Jeff Roberson wrote: > > > > > Hello, > > > > > > I have a patch that improves witness performance available at: > > > > > > http://people.freebsd.org/~jeff/witness.diff > > > > > > This improvement comes at the cost of some significant space overhead. > It > > > changes the witness graph from a linked tree to a matrix based approach. > > > Relationships can be quickly resolved with a table lookup. The table > size > > > is WITNESS_COUNT^2, or 1MB with the current count of 1024. > > > > > > > Woo! Thanks for polishing this. > > > > > > > This patch also makes struct witness objects persistent even after the > > > last lock using this name has been removed. This is helpful for short > > > lived objects which may be created frequently. > > > > > > > Originally, the idea was that if one had a LOR bug in a driver, one could > > kldunload the driver and have WITNESS forget about any orders for the > > driver's lock, fix the bug, and try again, but the short-lived names > problem > > is much more common in practice, and trying to remove info about a > specific > > lock class from the graph is a bit tenuous, so I think this is the better > > approach going forward. > > > > > > > To reduce lock contention on SMP witness_checkorder() now runs without > the > > > w_mtx when there are no lock violations. I also cache a lock_list_entry > > > in each thread as allocating these requires the w_mtx. The entry is > > > disposed of at thread_exit(). > > > > > > > Neat. > > > > > > > I'm mostly interested in hearing what people have to say about the space > > > bloat. I believe it is in a commit ready state. > > > > > > > I think the space usage is perfectly fine. Also, now that you malloc the > > actual witness objects instead of putting them in the BSS (something that > > should have been done anyway I think), I would make the number of witness > > objects a loader tunable. > > > > Well, I'm glad there is a consensus that this is the right way forward. The > state of the code is that there may be a bug in the dot output but I've not > had any problems with the regular witness operation. > > There are still some style bugs in it. Attilio has expressed some interest > in a full review and style clean-up. I'd like to get what I have now, minus > the dot output, into svn. And then do a set of follow on commits to add > back dot or Attilio's comma separated graph output that can be parsed to > dot. > > Any objections to commiting this knowing it has some style bugs and a little > work left? I'd like to get people testing the core functionality more. > We've sat on this patch for a couple of years now as well. Please go on and commit the code, delaying any further improvement. Thanks, Attilio -- Peace can only be achieved by understanding - A. Einstein