From owner-svn-src-all@freebsd.org Wed May 18 18:20:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1EFF4B40290; Wed, 18 May 2016 18:20:27 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-pf0-x22b.google.com (mail-pf0-x22b.google.com [IPv6:2607:f8b0:400e:c00::22b]) (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 E4C801F76; Wed, 18 May 2016 18:20:26 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-pf0-x22b.google.com with SMTP id b66so283800pfb.2; Wed, 18 May 2016 11:20:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=/SxHVwSzMUjTSsyLAYjsOdGXjzZbHxTaOH3oSLFVcZA=; b=lOLRPfd3dpdMOXC593JRbQ9fMN33yumK6/GLvKBK0Fizl+Lt9YnHMxP69s6B8nBcUG L6kXfq6tGiuaK+zSGsUZM0WuJTTtYdrTkXQJiDe+rY/Qt96pkhadHf23dQqUDNGY508w uZhDLY6dyFWmBbb9R1jMuDygYeqcBII63M5RAsiHCyNXjR4GFhegpjv0lJ4hm8bZfqQl zh7P6OPunE+pmguius/gq8/fGzDjy4MJBln7WDJ4gb+vSYSkirMUu7DfBXsVG5xc7mss UJIc8Rofq9xM34kVqVBJhl+4USxr5G9dL/wiz53+SWezSqW1psUyb6lYfuspiqIB8Rhg kbxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=/SxHVwSzMUjTSsyLAYjsOdGXjzZbHxTaOH3oSLFVcZA=; b=ihaFO3bXiJfmaFPm2ptH260LVQVwLICVr1mnCCArfC7u8ohqOHJMEMXojG5/EzuoIY 16QnUpEMpnKeydC7a2aPvmWBBO61MYkKgPlgOqs5YavGkATRX0W8vVVDprpVv0lqM+4j sFpnY47nCOw3bpzD0DYHix4hCS0CHwhsFrZRWD6yYXSlqGs+iNaLHS73D5Q0fl9CVfgi DfZCBXAAMZvz+oLBMkgmFn360IAv4mUUdaJcGSHv0T4Bi3hHEbuCzNEYLPDml9oGs++D g4xMCJ+Tf9lggBg2Nx/vw/W5brr6HOF3BmIcfia/b54N3mpmw18/fD0ryUvgjWzye5K9 mJRg== X-Gm-Message-State: AOPr4FW74+/h8GpcDyTALD+6GYwD4Ni/xfiZDhRFrhFWjPGls6R4A/szw0ylYGW2woT9vA== X-Received: by 10.98.20.131 with SMTP id 125mr13109535pfu.166.1463595626428; Wed, 18 May 2016 11:20:26 -0700 (PDT) Received: from wkstn-mjohnston.west.isilon.com (c-76-104-201-218.hsd1.wa.comcast.net. [76.104.201.218]) by smtp.gmail.com with ESMTPSA id 199sm13891287pfc.15.2016.05.18.11.20.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 May 2016 11:20:25 -0700 (PDT) Sender: Mark Johnston Date: Wed, 18 May 2016 11:23:53 -0700 From: Mark Johnston To: NGie Cooper Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300110 - head/sys/kern Message-ID: <20160518182353.GB26863@wkstn-mjohnston.west.isilon.com> References: <201605180355.u4I3tskK012821@repo.freebsd.org> <7D442C5C-E059-40A5-887C-55840BE94425@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7D442C5C-E059-40A5-887C-55840BE94425@gmail.com> User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 18:20:27 -0000 On Tue, May 17, 2016 at 10:22:18PM -0700, NGie Cooper wrote: > > > On May 17, 2016, at 20:55, Mark Johnston wrote: > > > > Author: markj > > Date: Wed May 18 03:55:54 2016 > > New Revision: 300110 > > URL: https://svnweb.freebsd.org/changeset/base/300110 > > > > Log: > > Do not acquire the thread lock in hardclock_cnt() unless needed. > > > > This function only sets thread flags if a SIGPROF or SIGVTALRM timer > > has fired, which is almost never the case. > > > > MFC after: 2 weeks > > > > Modified: > > head/sys/kern/kern_clock.c > > > > Modified: head/sys/kern/kern_clock.c > > ============================================================================== > > --- head/sys/kern/kern_clock.c Wed May 18 03:50:21 2016 (r300109) > > +++ head/sys/kern/kern_clock.c Wed May 18 03:55:54 2016 (r300110) > > @@ -570,9 +570,11 @@ hardclock_cnt(int cnt, int usermode) > > flags |= TDF_PROFPEND | TDF_ASTPENDING; > > PROC_ITIMUNLOCK(p); > > } > > - thread_lock(td); > > - td->td_flags |= flags; > > - thread_unlock(td); > > + if (flags != 0) { > > + thread_lock(td); > > + td->td_flags |= flags; > > + thread_unlock(td); > > + } > > Use predict_false? I don't think that's really warranted here. A __predict_false could become incorrect after a future change elsewhere in this function, and this isn't enough of a hot path for such a change to make a measurable difference on its own. > > > > #ifdef HWPMC_HOOKS > > if (PMC_CPU_HAS_SAMPLES(PCPU_GET(cpuid))) > >