From owner-freebsd-smp@FreeBSD.ORG Sun Jun 14 14:23:13 2009 Return-Path: Delivered-To: freebsd-smp@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 12511106566B; Sun, 14 Jun 2009 14:23:13 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-fx0-f228.google.com (mail-fx0-f228.google.com [209.85.220.228]) by mx1.freebsd.org (Postfix) with ESMTP id 448BA8FC13; Sun, 14 Jun 2009 14:23:12 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: by fxm28 with SMTP id 28so526281fxm.43 for ; Sun, 14 Jun 2009 07:23:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=xXp5J6IjS2+D4UXPIoz/HSnx8yNlhHTELJBoyZaM3Qw=; b=x3YJEHt3Zv61zY/Lm0927Y0GMdOq4KJcUBedp6EGo7Hr0Gvazd+56ofXDezARMaYnA phoACDgX33e5pFZK8gwC3gsP6alI3lVZvLqv6DZZW/UWRWn15TN0PONq6SqQ+j8PpklW ZRID312HYFpfzPlPhcHSG0lTbcJUrUC/KaC0Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=BkQFJl+84Z3417o4A2G4TJrke6jZB69n482YiAdtvL+1v3cn20kI/o0Pv9F/E5XOvY Ktd3nsfLaG24bjf3P5stLSFLu9KBAYaOCJWzPa2LLn23iARU2RZSsCC7U/9xBxsw+dbE xA06DWcgAC6TQCoXMEPZ7JwQF9Xt6XzqRB6qs= MIME-Version: 1.0 Sender: asmrookie@gmail.com Received: by 10.223.110.11 with SMTP id l11mr3668858fap.50.1244989391336; Sun, 14 Jun 2009 07:23:11 -0700 (PDT) In-Reply-To: <4A34F4B7.5050904@FreeBSD.org> References: <3bbf2fe10906081342i6ef418e0n75e22d0b9e2543b3@mail.gmail.com> <4A34F4B7.5050904@FreeBSD.org> Date: Sun, 14 Jun 2009 16:23:11 +0200 X-Google-Sender-Auth: 3dd40696b9bf17fa Message-ID: <3bbf2fe10906140723y2a99eb8an3488796ac6604134@mail.gmail.com> From: Attilio Rao To: Kris Kennaway Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-smp@freebsd.org, freebsd-arch@freebsd.org Subject: Re: [PATCH] Adaptive spinning for lockmgr X-BeenThere: freebsd-smp@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD SMP implementation group List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2009 14:23:13 -0000 2009/6/14 Kris Kennaway : > Attilio Rao wrote: >> >> This patch enables adaptive spinning for lockmgr: >> http://www.freebsd.org/~attilio/adaptive_lockmgr.diff >> >> and it should presumably improve performance on disks/vfs/buffer cache >> based benchmarks, so, if you want to try out and report any benchmarks >> result, I'd love to see it. >> Please note that there are some parameters to tune: for example, you >> would like to not enable adaptive spinning to default while you just >> want that for a class of locks (and in that case you want to apply the >> reversed logic for what is living now) or you want to use different >> values =C2=A0for retries and loops. Interested developers can refer to s= uch >> 3 variables. >> Peter Holm alredy tested that patch for about 24hours without any >> regression to report. >> >> Also note that the patch is not 100% yet as long as it needs UPDATES >> and manpages updates, but they will be added just in time before to >> commit. >> The modify is all there. > > I have a vague memory that we had tested a version of this in the past an= d > found that it caused a performance loss in common cases? =C2=A0Many lockm= gr > callers are not amenable to adaptive spinning because they have to wait o= n > slow I/O. =C2=A0Testing only with e.g. md backing might give results that= are > non-representative. I don't think I ever implemented adaptive spinning in lockmgr so if somebody else did I don't know. Said that, probabilly the best approach would be to disable it by default ad use a LK_ADAPTIVESPIN flag on a per instance basis. Such conditions, though, need to be explored a bit and I have no time to dedicate to this right now. Thanks, Attilio --=20 Peace can only be achieved by understanding - A. Einstein