From owner-svn-src-head@freebsd.org Fri Oct 13 23:23:16 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 C098FE2FF3E; Fri, 13 Oct 2017 23:23:16 +0000 (UTC) (envelope-from onwahe@gmail.com) Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) (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 C5EAD7D237; Fri, 13 Oct 2017 23:23:15 +0000 (UTC) (envelope-from onwahe@gmail.com) Received: by mail-wm0-f68.google.com with SMTP id l68so24329456wmd.5; Fri, 13 Oct 2017 16:23:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=EvZHU20KIboxgZ2fZ1LTFSEBkb6+C/w8x5VJ0HZMIvw=; b=pq6BvDWtqP9UUSeF+DFyl8b+FMoXANFybHoeucacDsrtd/Th/7//slNwBIlA1f/tT4 Q2TZTgAyTmke76cuUpuC73bkhqztvMdwUXxAecEVdX+ChMxRVi8bG3QOaL3pE94cmyeB S+rsrCUatrqzzXOAEKimKb3i2TYEPFSeRq2E0RjE7SknXZa56BA9jK61XGw8muy+9ftb hl48xJN9Y4/RMvxZVRjk+WN8PSfKYoU2HUYRWTFsTaT8AOOcXNw1I58AFgeuHpfd1Bwj QJqbB/G74rQiXaRS5Hc/ZVP+dHLFJgg5xcr6tmtwSSofn1LjJZIPqzem3WwZUM6Nie8f plCg== X-Gm-Message-State: AMCzsaWVsaGkoh27J9rx4+/o4ZvcFsUrr4HZqBGvz+uliwdfRIYK9Vte VM1uTMQSuQBPe0y4iQm16FxzJw== X-Received: by 10.80.212.43 with SMTP id t43mr3650708edh.89.1507930730448; Fri, 13 Oct 2017 14:38:50 -0700 (PDT) Received: from mail-wm0-f41.google.com (mail-wm0-f41.google.com. [74.125.82.41]) by smtp.gmail.com with ESMTPSA id w10sm1350687edj.11.2017.10.13.14.38.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Oct 2017 14:38:50 -0700 (PDT) Received: by mail-wm0-f41.google.com with SMTP id m72so23793291wmc.1; Fri, 13 Oct 2017 14:38:50 -0700 (PDT) X-Google-Smtp-Source: ABhQp+TZwlEfuj9jOi7FabU9neKmvrNwyQAu5XrUDyU5XOiEYBJR+2fd+msIdRvKsOGSrJ32xoCvvPJT65HYeYPeEVA= X-Received: by 10.28.111.206 with SMTP id c75mr2481479wmi.123.1507930729982; Fri, 13 Oct 2017 14:38:49 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.143.20 with HTTP; Fri, 13 Oct 2017 14:38:49 -0700 (PDT) In-Reply-To: <201710132031.v9DKVueS089009@repo.freebsd.org> References: <201710132031.v9DKVueS089009@repo.freebsd.org> From: Svatopluk Kraus Date: Fri, 13 Oct 2017 23:38:49 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r324609 - head/sys/sys To: Mateusz Guzik Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" 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, 13 Oct 2017 23:23:16 -0000 MTX_UNOWNED is a flag. You did not change its value from 4 to 0, you removed it actually. I have very bad feeling about it. But maybe, it's really possible and in that case, a very good explanation should be provided. Svata On Fri, Oct 13, 2017 at 10:31 PM, Mateusz Guzik wrote: > Author: mjg > Date: Fri Oct 13 20:31:56 2017 > New Revision: 324609 > URL: https://svnweb.freebsd.org/changeset/base/324609 > > Log: > mtx: change MTX_UNOWNED from 4 to 0 > > The value is spread all over the kernel and zeroing a register is > cheaper/shorter than setting it up to an arbitrary value. > > Reduces amd64 GENERIC-NODEBUG .text size by 0.4%. > > MFC after: 1 week > > Modified: > head/sys/sys/mutex.h > > Modified: head/sys/sys/mutex.h > ============================================================================== > --- head/sys/sys/mutex.h Fri Oct 13 20:29:35 2017 (r324608) > +++ head/sys/sys/mutex.h Fri Oct 13 20:31:56 2017 (r324609) > @@ -65,15 +65,11 @@ > * State bits kept in mutex->mtx_lock, for the DEFAULT lock type. None of this, > * with the exception of MTX_UNOWNED, applies to spin locks. > */ > +#define MTX_UNOWNED 0x00000000 /* Cookie for free mutex */ > #define MTX_RECURSED 0x00000001 /* lock recursed (for MTX_DEF only) */ > #define MTX_CONTESTED 0x00000002 /* lock contested (for MTX_DEF only) */ > -#define MTX_UNOWNED 0x00000004 /* Cookie for free mutex */ > -#define MTX_FLAGMASK (MTX_RECURSED | MTX_CONTESTED | MTX_UNOWNED) > - > -/* > - * Value stored in mutex->mtx_lock to denote a destroyed mutex. > - */ > -#define MTX_DESTROYED (MTX_CONTESTED | MTX_UNOWNED) > +#define MTX_DESTROYED 0x00000004 /* lock destroyed */ > +#define MTX_FLAGMASK (MTX_RECURSED | MTX_CONTESTED | MTX_DESTROYED) > > /* > * Prototypes >