From owner-svn-src-head@freebsd.org Sun Apr 8 19:06:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2B741F9A861 for ; Sun, 8 Apr 2018 19:06:59 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: from mail-wr0-x231.google.com (mail-wr0-x231.google.com [IPv6:2a00:1450:400c:c0c::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9403D83430 for ; Sun, 8 Apr 2018 19:06:58 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: by mail-wr0-x231.google.com with SMTP id n2so6509485wrj.7 for ; Sun, 08 Apr 2018 12:06:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language; bh=EDy6D5dJ9csYO9WdnDSyscrBurNC5Zh+IjGY7AO7Bo8=; b=tKmioO21gP453PEBoOrp8yP/LF+LL7QbwvZRLYeoGKF9nxSPsNoNA81h3ZSdfdDO6H y5hVBQwL7wh8wBWw/iqj+zLbtz3/4pFSrOzpnFn1sb3c5stRjn3ZL55he1ps5o9dwP6h tRVTgYjNmE9tCuHTn9aOVoLYGc3B5RH36T+PHU+jKzvfTsdBHOT9+kWrNQKvvGPo3AaY OWe0cXS4DumHqB+HnAcRbTDvTKWmRciAxv1KfLA/PcjU1wZbl277FW6SmSANmDOivSim egwFbdc0K7wnFWCfX0qvzMB40NEZENur+mq8B5+sMIG9qAcpwIB7jZMsXDakVmdPi0BH 9wSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=EDy6D5dJ9csYO9WdnDSyscrBurNC5Zh+IjGY7AO7Bo8=; b=FciEEcF9jDRDw7gu34R1nB7PyffsFCo+Yia5m8OR9TVQ6fZVx8cmz+ZXdvayblAgEC +NpQ9REKI1wCsGnSZI7JjWsn1firLr8e+YRN992kxGFNWaikbr97qiMvpNinIwBD8y8U HD+qFRu+7VJLqfnA63f6ld68E9HbDTLQNitC5I3HmTUSfVUAnpK6b3mnAvWKKiUeeTID duVNRxcWeE9i9tGs/CFc54tat6qGkv4VH32tw10y3mr8NCLmpUvwwmInkLH3MEWMYavv xo9mRW5hsbPflv62ykZB6jUcYQAycfArrue0SZYEeqqmd4spR/JIuVTmrjH2n7PTcFuZ mXwQ== X-Gm-Message-State: AElRT7HCuWELGODpDjcaLbB0SbKBqIksX+MnOP45DaWLq91KJcsnjwFN +3hPiT/+28nFT17qxQT9BK6iH6xw0zE= X-Google-Smtp-Source: AIpwx4/wVn2glAnN/IkT8Ifu1d1ek9tfZlrUo4tqb3H4DRz8yn++lqRdalIAFKQxwbkvHmr98eIuOA== X-Received: by 10.223.219.1 with SMTP id s1mr22574137wri.125.1523214417113; Sun, 08 Apr 2018 12:06:57 -0700 (PDT) Received: from [10.10.1.111] ([185.97.61.1]) by smtp.gmail.com with ESMTPSA id v22sm9911462wra.91.2018.04.08.12.06.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 08 Apr 2018 12:06:56 -0700 (PDT) Subject: Re: svn commit: r332285 - head/sys/kern To: Mateusz Guzik , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201804081634.w38GYA8N097150@repo.freebsd.org> From: Steven Hartland Message-ID: Date: Sun, 8 Apr 2018 20:06:55 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <201804081634.w38GYA8N097150@repo.freebsd.org> Content-Language: en-US Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 19:06:59 -0000 Worth making the sysctls so they can be tuned the the HW / use case? On 08/04/2018 17:34, Mateusz Guzik wrote: > Author: mjg > Date: Sun Apr 8 16:34:10 2018 > New Revision: 332285 > URL: https://svnweb.freebsd.org/changeset/base/332285 > > Log: > locks: tweak backoff a little bit > > Previous limits were chosen when locking primitives had spurious lock > accesses. > > Flipping the starting point to 1 (or rather 2 as the first call shifts it) > provides a modest win when mild contention is seen while not hurting worse > cases. Tested on a bunch of one, two and four socket old and new systems > (Westmere, Skylake, Threadreaper and others) by doing concurrent page faults, > buildkernel/buildworld and other stuff (although not all systems got all the > tests). > > Another thing is the upper limit. It is semi-arbitrarily chosen as it was > getting out of hand for slightly less small systems (e.g. a 128-thread one). > > Note that backoff is fundamentally a speculative bandaid and this change just > makes it fit a little bit better. It remains completely oblivious to the > hardware topology or the contention pattern. This is being experimented with. > > Modified: > head/sys/kern/subr_lock.c > > Modified: head/sys/kern/subr_lock.c > ============================================================================== > --- head/sys/kern/subr_lock.c Sun Apr 8 16:29:24 2018 (r332284) > +++ head/sys/kern/subr_lock.c Sun Apr 8 16:34:10 2018 (r332285) > @@ -156,8 +156,10 @@ void > lock_delay_default_init(struct lock_delay_config *lc) > { > > - lc->base = lock_roundup_2(mp_ncpus) / 4; > - lc->max = lc->base * 1024; > + lc->base = 1; > + lc->max = lock_roundup_2(mp_ncpus) * 256; > + if (lc->max > 32678) > + lc->max = 32678; > } > > #ifdef DDB >