From owner-svn-src-head@FreeBSD.ORG Tue Mar 31 00:32:46 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 49BF1C47; Tue, 31 Mar 2015 00:32:46 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AB55E1B4; Tue, 31 Mar 2015 00:32:45 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id t2V0WeFH082881 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Tue, 31 Mar 2015 03:32:40 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t2V0WeFH082881 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id t2V0WdVe082880; Tue, 31 Mar 2015 03:32:39 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 31 Mar 2015 03:32:39 +0300 From: Konstantin Belousov To: John Baldwin Subject: Re: svn commit: r280279 - head/sys/sys Message-ID: <20150331003239.GK2379@kib.kiev.ua> References: <201503201027.t2KAR6Ze053047@svn.freebsd.org> <2526359.g5B2nXdKeQ@ralph.baldwin.cx> <20150330172434.GG2379@kib.kiev.ua> <1853187.nsx00mfzo7@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1853187.nsx00mfzo7@ralph.baldwin.cx> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 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: Tue, 31 Mar 2015 00:32:46 -0000 On Mon, Mar 30, 2015 at 04:37:10PM -0400, John Baldwin wrote: > On Monday, March 30, 2015 08:24:34 PM Konstantin Belousov wrote: > > > That is not what Bruce said. He suggested using bitcount64() for the fallback > > > if the cpuid check fails. He did not say to remove the runtime check to use > > > popcnt if it is available: > > > > > > "Always using [bitcount64] would lose the micro-optimization... [to] keep > > > [it], it seems best to keep the inline asm but replace popcnt_pc_map_elem(elem) > > > by [bitcount64(elem)]." > > Ok, thank you for the clarification. > > > > I updated the pmap patch, see the end of the message. > > I think the pmap change looks fine. If we know which compilers include a > workaround we might also consider specifying "-mno-popcount" for everything > except known-ok compilers in at least kern.mk. Right now the compilers which implement the workaround are gcc 4.9.2 and gcc trunk, to be released as gcc 5.0. In-tree clang 3.6.0 does not try to eliminate the false dependency. > > > > This looks fine to me. It seems to be manually converting certain symbols > > > to use a dynamic lookup that must be explicitly resolved before first > > > use? > > I am not sure what do you mean by dynamic lookup, but possibly it > > was mentioned. I can emulate the ifuncs more sincerely, by requiring > > a resolver function, which is called on the first real function > > invocation. I did not see it as very useful, but it is definitely > > doable. > > I just mean that the effect at runtime is similar to that of dynamic > symbols once they are resolved (a call into a PLT entry (or is it GOT? > I keep getting those confused) that does a jump to the resolved symbol). PLT is slightly more expensive, since after the resolution it gives call symbol@plt jmp *symbol@gotpcrel while this code results in call *symbol_selector