From owner-svn-src-head@FreeBSD.ORG Sun Nov 23 18:02:17 2014 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 4764B65C; Sun, 23 Nov 2014 18:02:17 +0000 (UTC) Received: from mailrelay004.isp.belgacom.be (mailrelay004.isp.belgacom.be [195.238.6.170]) by mx1.freebsd.org (Postfix) with ESMTP id 60D6417B; Sun, 23 Nov 2014 18:02:16 +0000 (UTC) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AuIIAPUfclRbsIAD/2dsb2JhbABcgw5VWYMGtzyBUo9qhmoCgQQXAQEBAQF9hAMBAQQjVhALFAQCAgUhAgIPKgwSBhOILAMWAQi3R5UwAQEBAQEBAQMBAQEBAQEcgS2NIYIKMweCeYFVBYUvBpIYhSWCDpAdhn6DfkcwAYJKAQEB Received: from 3.128-176-91.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([91.176.128.3]) by relay.skynet.be with ESMTP; 23 Nov 2014 19:02:09 +0100 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.9/8.14.9) with ESMTP id sANI27Jv043264; Sun, 23 Nov 2014 19:02:07 +0100 (CET) (envelope-from tijl@FreeBSD.org) Date: Sun, 23 Nov 2014 19:02:06 +0100 From: Tijl Coosemans To: Scott Long Subject: Re: svn commit: r274489 - in head/sys/amd64: amd64 include Message-ID: <20141123190206.37942760@kalimero.tijl.coosemans.org> In-Reply-To: <13EC3116-6146-42FC-8941-2C7C009224B3@yahoo.com> References: <201411132211.sADMBjP3009246@svn.freebsd.org> <35E5EAD8-99C1-43C0-8D01-B3B5B86ECA25@me.com> <13EC3116-6146-42FC-8941-2C7C009224B3@yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Scott Long , Rui Paulo 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: Sun, 23 Nov 2014 18:02:17 -0000 On Fri, 21 Nov 2014 16:26:47 -0700 Scott Long wrote: > On Nov 20, 2014, at 11:33 PM, Rui Paulo wrote: >> On Nov 13, 2014, at 14:11, Scott Long wrote: >>>=20 >>> Author: scottl >>> Date: Thu Nov 13 22:11:44 2014 >>> New Revision: 274489 >>> URL: https://svnweb.freebsd.org/changeset/base/274489 >>>=20 >>> Log: >>> Extend earlier addition of stack frames to most of support.S. This mak= es >>> stack traces in KDB, HWPMC, and DTrace much more reliable and useful. >>=20 >> No performance differences? The kernel enables/disables the compiler >> option to omit the frame pointer based on the kernel config file. If >> DDB, DTrace, or HWPMC is enabled, the frame pointer is always saved in >> C functions. >>=20 >> Some of these functions are in the hot path, so if you didn't see any >> performance problem, I wonder if we should disable -fomit-frame-pointer >> always. >=20 > That=E2=80=99s a good question to look further into. I didn=E2=80=99t se= e any measurable > differences with this change. I think that the cost of the function call > itself masks the cost of a few extra instructions, but I didn=E2=80=99t t= est with > switching it on/off for the entire kernel. That said, I purposely > implemented this as macros so it could be easily changed in the future. > If someone finds that this measurably impacts a certain workload, I > wouldn=E2=80=99t object to making it conditional, though it does complica= te any > hand-written ASM code that tries to access the stack via %esp offsets. > We don=E2=80=99t have anything like that now, but Kip was concerned enoug= h about > it in the future that I left it enabled unconditionally. An alternative is to annotate the functions with .cfi directives. Stack unwinding doesn't need frame pointers then. http://www.logix.cz/michal/devel/gas-cfi/ https://sourceware.org/binutils/docs-2.24/as/CFI-directives.html