From owner-svn-src-head@freebsd.org Fri Feb 17 10:55:37 2017 Return-Path: Delivered-To: svn-src-head@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 5ECC0CE23D6 for ; Fri, 17 Feb 2017 10:55:37 +0000 (UTC) (envelope-from melounmichal@gmail.com) Received: from mail-wr0-x233.google.com (mail-wr0-x233.google.com [IPv6:2a00:1450:400c:c0c::233]) (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 E768B18FD; Fri, 17 Feb 2017 10:55:36 +0000 (UTC) (envelope-from melounmichal@gmail.com) Received: by mail-wr0-x233.google.com with SMTP id 89so23160870wrr.3; Fri, 17 Feb 2017 02:55:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:reply-to:subject:references:to:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=SfEBg4L52EqeUGEj1Mv8IldLxUkl4dUIzvejPlzvWys=; b=NoiCJqhcEmLKCx09FMmtoUNAek5CgmztQ3kWRkpb6k4ycLtG1EItOXCRy41EMOvuR6 Sel365ooJnd0fLbC7grqy8fERvpJF+joapmOSFEkpsMsUotpA+K3WmPXFWgbIzMsIfrE qpUkJVVKw5EURz6DqbyhZ9WZeIY1XuRz72kz8lPvtHdPtriD2IlEROrYzlqPL+GRyIoi VBST6H0/30NTCiYrsqvHipgix6vXgWwqjl1fdna4YL7qcPSu8DdZRpHM/bdl68h0dmFR 6sLCbPh+QpfFqOSJcWxtNaqF0Hvk3jLeWJfKbcUeoSZ5GDN8Ef61ooE9s/EY/VvAEm1e KzUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:reply-to:subject:references:to:message-id :date:user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=SfEBg4L52EqeUGEj1Mv8IldLxUkl4dUIzvejPlzvWys=; b=ZMZPgiYWtkzCO0lvaElTX1RtS9YHFfhKAhX2rUsh+skhrPlft7p3aYiXalSDDET7h2 h6yFYUSiHuMlVf/M9Hp39QTGQdnd5vye/eQjBTXdlP98WzG/E2Mm4VSSeYyVJ/QTGu8f yo/XDsaUjF3BupPe/YyNuSz/DkPTAO024rQUYqkMh1lc8qK4BPZo1Nbe1xzx5/sQZTX8 siAAP7M3eUsB+m5Lv6mVlCQrWT/tcDnuSGUVLVLoqq4QIOQvqP0ttqL6D7mu7HcjyR/W DGhNnkAqN6j7vZJurPZWmFtKZrkpwhePF4M7hvANPQfQ89B9gWQiZBIbBuHu6lBd4sRD OJIg== X-Gm-Message-State: AMke39n7iVx6d7Ii76x9WA2jQksRoGxTg5V2/OS2fq6m1pG4vGdA5w6vuwbQhch5ktwcEw== X-Received: by 10.223.145.45 with SMTP id j42mr6554806wrj.141.1487328935237; Fri, 17 Feb 2017 02:55:35 -0800 (PST) Received: from [88.208.79.100] (halouny.humusoft.cz. [88.208.79.100]) by smtp.gmail.com with ESMTPSA id u42sm12488230wrc.1.2017.02.17.02.55.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Feb 2017 02:55:34 -0800 (PST) From: Michal Meloun X-Google-Original-From: Michal Meloun Reply-To: meloun.michal@gmail.com Subject: Re: svn commit: r313855 - head/sys/kern References: <201702170539.v1H5de82032123@repo.freebsd.org> To: Mateusz Guzik , svn-src-head@freebsd.org Message-ID: Date: Fri, 17 Feb 2017 11:55:36 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <201702170539.v1H5de82032123@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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: Fri, 17 Feb 2017 10:55:37 -0000 On 17.02.2017 6:39, Mateusz Guzik wrote: > Author: mjg > Date: Fri Feb 17 05:39:40 2017 > New Revision: 313855 > URL: https://svnweb.freebsd.org/changeset/base/313855 > > Log: > locks: let primitives for modules unlock without always goging to the slsow path > > It is only needed if the LOCK_PROFILING is enabled. It has to always check if > the lock is about to be released which requires an avoidable read if the option > is not specified.. > > Modified: > head/sys/kern/kern_mutex.c > head/sys/kern/kern_rwlock.c > head/sys/kern/kern_sx.c > > Modified: head/sys/kern/kern_mutex.c > ============================================================================== > --- head/sys/kern/kern_mutex.c Fri Feb 17 05:22:58 2017 (r313854) > +++ head/sys/kern/kern_mutex.c Fri Feb 17 05:39:40 2017 (r313855) > @@ -275,7 +275,11 @@ __mtx_unlock_flags(volatile uintptr_t *c > line); > mtx_assert(m, MA_OWNED); > > +#ifdef LOCK_PROFILING > __mtx_unlock_sleep(c, opts, file, line); > +#else > + __mtx_unlock(m, curthread, opts, file, line); > +#endif > TD_LOCKS_DEC(curthread); > } > > > Modified: head/sys/kern/kern_rwlock.c > ============================================================================== > --- head/sys/kern/kern_rwlock.c Fri Feb 17 05:22:58 2017 (r313854) > +++ head/sys/kern/kern_rwlock.c Fri Feb 17 05:39:40 2017 (r313855) > @@ -341,7 +341,11 @@ _rw_wunlock_cookie(volatile uintptr_t *c > LOCK_LOG_LOCK("WUNLOCK", &rw->lock_object, 0, rw->rw_recurse, file, > line); > > +#ifdef LOCK_PROFILING > _rw_wunlock_hard(rw, (uintptr_t)curthread, file, line); > +#else > + __rw_wunlock(rw, curthread, file, line); > +#endif > > TD_LOCKS_DEC(curthread); > } > > Modified: head/sys/kern/kern_sx.c > ============================================================================== > --- head/sys/kern/kern_sx.c Fri Feb 17 05:22:58 2017 (r313854) > +++ head/sys/kern/kern_sx.c Fri Feb 17 05:39:40 2017 (r313855) > @@ -364,7 +364,11 @@ _sx_xunlock(struct sx *sx, const char *f > WITNESS_UNLOCK(&sx->lock_object, LOP_EXCLUSIVE, file, line); > LOCK_LOG_LOCK("XUNLOCK", &sx->lock_object, 0, sx->sx_recurse, file, > line); > +#ifdef LOCK_PROFILING > _sx_xunlock_hard(sx, (uintptr_t)curthread, file, line); > +#else > + __sx_xunlock(sx, curthread, file, line); > +#endif > TD_LOCKS_DEC(curthread); > } > > This breaks armv6 kernel. Michal /usr2/Meloun/git/tegra/sys/kern/kern_sx.c:370:2: error: implicit declaration of function '__sx_xunlock' is invalid in C99 [-Werror,-Wimplicit-function-declaration] __sx_xunlock(sx, curthread, file, line); ^ /usr2/Meloun/git/tegra/sys/kern/kern_sx.c:370:2: note: did you mean '_sx_xunlock'? /usr2/Meloun/git/tegra/sys/kern/kern_sx.c:358:1: note: '_sx_xunlock' declared here _sx_xunlock(struct sx *sx, const char *file, int line) ^ 1 error generated.