From owner-svn-src-all@freebsd.org Sun Feb 5 10:01:35 2017 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 11270CD0A74; Sun, 5 Feb 2017 10:01:35 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-lf0-x243.google.com (mail-lf0-x243.google.com [IPv6:2a00:1450:4010:c07::243]) (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 8BB718DE; Sun, 5 Feb 2017 10:01:34 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-lf0-x243.google.com with SMTP id x1so1532409lff.0; Sun, 05 Feb 2017 02:01:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=uk9Emlh4INh8+0TzplG1GM06ifLcD0JXMeH55OBB4O4=; b=Fj0W+08g9g7gIEKbdCPit+ooeE16ViIBmaUcPDchQdkm0csD4Jlfq4SMkt+z3yBJjw t1SXISl14EwWRusAb39mQ9X1hENNCvPqGCupNf7yviWvMMp/yc1TyjyzsQ9ioX7LL00S xornnZ69Nak9WACXVKPisHyn8ayEjhb1S8vR1FmQnKqP0QlvP9h+q1fBTg7SsLhtoBya qkea+r8PEt8rvCoPCKMAf/zgI1tcmATVt43kRkF3ZSFniZbGODB/C/vGz2LpiT8ZU4ZQ /YG4aXQzVZ76uUmLdBTC0H+/Barn0hrMv91LuMbpt7yxMx3ubq0aAdVzcdJaMdk6vOWG VMAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=uk9Emlh4INh8+0TzplG1GM06ifLcD0JXMeH55OBB4O4=; b=TnMKM3mw0GL2jA3eS+HZuvIG19pQFoHOrE2QfHX6h280BWtvn+ICKSTGm54jLZUkFv Yw0fmdlLZ7K+pKQ7Q0zOXOl1cenvAKr30P5pXf5T8XizKcPD6MQELEEvFedHSutkHSNp haht+lBE8vFbJeK4vsZO79f+/x2wPZkH2hzmqpl/m3ZKelhd2615V++dh1/Osv0I7B2y 6iQZ9CJioLggdA6cV/CKNvMCDq6YlGUfhPwGEV2HYe3xpLoWe7DEF6LmQ51v7bmT3clC LwDAZMzmEp6ym5QcD3VGT7/wR65GvLdBGYFxHZdwAzioRiLUQ08GDPipF87UcFgAp44w 1s1g== X-Gm-Message-State: AIkVDXJ/AQfz9MTGRnX9abxhxa3oUOvDuoYPUei8zdS761hGdrB0HTvNMzNSYC6scNMx8A== X-Received: by 10.25.234.216 with SMTP id y85mr1667741lfi.35.1486288892130; Sun, 05 Feb 2017 02:01:32 -0800 (PST) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by smtp.gmail.com with ESMTPSA id 14sm9485004lju.16.2017.02.05.02.01.30 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Sun, 05 Feb 2017 02:01:31 -0800 (PST) Date: Sun, 5 Feb 2017 11:01:28 +0100 From: Mateusz Guzik To: Slawa Olhovchenkov Cc: Mateusz Guzik , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r313275 - in head/sys: kern sys Message-ID: <20170205100127.GC4375@dft-labs.eu> References: <201702050804.v1584Cim052478@repo.freebsd.org> <20170205100010.GB5366@zxy.spb.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20170205100010.GB5366@zxy.spb.ru> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 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: Sun, 05 Feb 2017 10:01:35 -0000 On Sun, Feb 05, 2017 at 01:00:11PM +0300, Slawa Olhovchenkov wrote: > On Sun, Feb 05, 2017 at 08:04:12AM +0000, Mateusz Guzik wrote: > > > Author: mjg > > Date: Sun Feb 5 08:04:11 2017 > > New Revision: 313275 > > URL: https://svnweb.freebsd.org/changeset/base/313275 > > > > Log: > > mtx: move lockstat handling out of inline primitives > > > > Lockstat requires checking if it is enabled and if so, calling a 6 argument > > function. Further, determining whether to call it on unlock requires > > pre-reading the lock value. > > > > This is problematic in at least 3 ways: > > - more branches in the hot path than necessary > > - additional cacheline ping pong under contention > > - bigger code > > > > Instead, check first if lockstat handling is necessary and if so, just fall > > back to regular locking routines. For this purpose a new macro is introduced > > (LOCKSTAT_PROFILE_ENABLED). > > > > LOCK_PROFILING uninlines all primitives. Fold in the current inline lock > > variant into the _mtx_lock_flags to retain the support. With this change > > the inline variants are not used when LOCK_PROFILING is defined and thus > > can ignore its existence. > > > > This results in: > > text data bss dec hex filename > > 22259667 1303208 4994976 28557851 1b3c21b kernel.orig > > 21797315 1303208 4994976 28095499 1acb40b kernel.patched > > > > i.e. about 3% reduction in text size. > > > > A remaining action is to remove spurious arguments for internal kernel > > consumers. > > Do you planed MFC all of this? Yes, around march. -- Mateusz Guzik