From owner-freebsd-arch@FreeBSD.ORG Sun Oct 21 20:33:08 2007 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 7C65516A418 for ; Sun, 21 Oct 2007 20:33:08 +0000 (UTC) (envelope-from kip.macy@gmail.com) Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.176]) by mx1.freebsd.org (Postfix) with ESMTP id 6A0BD13C4A7 for ; Sun, 21 Oct 2007 20:33:08 +0000 (UTC) (envelope-from kip.macy@gmail.com) Received: by wa-out-1112.google.com with SMTP id k17so1103787waf for ; Sun, 21 Oct 2007 13:32:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=fLSgI53BrOrox6aL6zu0GiZosu2dh71qjoSrfR1cgKc=; b=IL84UCYeMIFGwuBCpQADFwrOUIsxctYJDim30fwDEQQW1WlhltrZwNCy2fwTi+YBTFlRiKa1IKENirkg6AyBtPwCzZsc4vQCV13DVj8DdcMigYvIBPuyGsxEpafK1Z1JrsvTy0jn12Cn0ASlrqQBDW6nr8h/PFouPbcJ9pUMzT4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=sTDoQfuKAjR9hAbeYnRnWgd9MywiD9srK3DNZl+sQ/Szj8sZMYcXmaNQfcQ87KKN0eYU56UNb35HEsPI5fggtSAHGRL5bHDVsQNsPLNG+ZTqUNxwNC0EZy/v3QYmrJ/ADoiyYnH56aWn7LN+ouSqdIe8+zCWvlUutVR9AHsSHUk= Received: by 10.115.90.1 with SMTP id s1mr4569523wal.1192997198777; Sun, 21 Oct 2007 13:06:38 -0700 (PDT) Received: by 10.114.13.15 with HTTP; Sun, 21 Oct 2007 13:06:38 -0700 (PDT) Message-ID: Date: Sun, 21 Oct 2007 13:06:38 -0700 From: "Kip Macy" To: "Robert Watson" In-Reply-To: <20071021135243.M70919@fledge.watson.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20071020184330.C70919@fledge.watson.org> <20071021135243.M70919@fledge.watson.org> Cc: arch@freebsd.org Subject: Re: Lock profiling results on TCP and an 8.x project 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: Sun, 21 Oct 2007 20:33:08 -0000 On 10/21/07, Robert Watson wrote: > On Sat, 20 Oct 2007, Robert Watson wrote: > > > * When talking about percentage of available CPUs, I make the assumption > > that > > due to a sufficient quantity of CPUs, in most cases lock acquisition will > > occur as a result of adaptive spinning rather than sleeping. In the > > netperf > > case, this is not true, since the number of potential workers exceeds the > > number of CPUs, hence the turnstile contention. However, as sleeping on > > locks itself is very expensive, it's reasonable to assume we would recover > > a lot of CPU none-the-less. > > FYI, a feature request for lock profiling: it would be nice if we also tracked > for each contention point time spent spinning vs. context switched waiting for > the lock, and the number of context switches the lock acquisition point has > caused. This would allow us to better understand the impact of adaptive lock > behavior for workloads and configurations. This would involve changing acquisition wait time into 3 fields: - time spent spinning - time spent context switched out - number of context switches The lock profiling object is fairly large as it is, so ideally this would happen after I've moved the lock_profile_object out of the lock_object. That is work that I've already mostly done as part of making profiling work for shared acquisitions and having it not break the ABI when enabled. Unfortunately, I haven't had time to make it commit-ready - so if someone wants to jump in and implement Robert's idea before that happens I won't object. -Kip