Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m5jnk-0003A5-PX for pgsql-hackers@arkaria.postgresql.org; Tue, 20 Jul 2021 07:04:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m5jnj-0004d6-DS for pgsql-hackers@arkaria.postgresql.org; Tue, 20 Jul 2021 07:04:23 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m5jnj-0004cy-5g for pgsql-hackers@lists.postgresql.org; Tue, 20 Jul 2021 07:04:23 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m5jnd-0001kM-1n for pgsql-hackers@postgresql.org; Tue, 20 Jul 2021 07:04:22 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 05CF85C0160; Tue, 20 Jul 2021 03:04:16 -0400 (EDT) Received: from imap35 ([10.202.2.85]) by compute3.internal (MEProxy); Tue, 20 Jul 2021 03:04:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= mime-version:message-id:in-reply-to:references:date:from:to:cc :subject:content-type; s=fm2; bh=09qZ7jGYlHk4smqthsmFR3jnUsPv3E6 CLF+T64hKdTM=; b=NzDn5M7y8ABqYTkXIUOm+Oy57Y+aES5LqV5tcG71V39d6mH LyxIHt3vKswdAKo9AlMnJYUCR5Jr51vBN/HJht3lxUVFDpBKcJ9cgbOLTw/6Cg+0 9XhaoBiwhYsofvzwioDRwdvDix154/vUmpBEkn0G7GGxU1bwh6IAKO8iWuy0kcg6 E+Wi0nGbVG0oihdIm+AV1hUnAL2P7je/WQzD58jrHRcSm2sSz4D/Z3rMJWI7xtZi 7UIL+tWcncntgjrsZV026d8PCEEe8tC5c5JXO5gvncQPQ9J5UHZjkme449C2Dlc9 cXrCPJ844z2MiAcJTI/p1a3g2hyDV1na2srddSg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=09qZ7j GYlHk4smqthsmFR3jnUsPv3E6CLF+T64hKdTM=; b=nwzp0TSWp7QhBd7reASX3G zNYMRuBo4VlW1my6wl/Hgg1VaprHGKr74YFcUAvRwx1ycMtMi8VRdC+PVUjy/i8m MgjEIV8JCsKhIH2RVjm8UNPz6APz7udAUvzdw8GM7xdIKn/0p8yW1Y39nVDlrnc3 ki9f3Q2rEM/Nm/BOja55plqZcQyYwWifs8Zi8qf+i0QnXibqDDMjSB9bzWj+YecX yO2CesREGCUQagO2JZrwPEM8IzNG+6rTUTNd13H1c8HUfewePAIREDfQxyQHGD2o s7XIX0O1G9487wgtiJLOCIJumdsksexGwVVjcwA03LMzMy3FfTMXSYeYDDUvqzfA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrfedugddutdejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgesthdtredtreerjeenucfhrhhomhepfdetnhgu rhgvshcuhfhrvghunhgufdcuoegrnhgurhgvshesrghnrghrrgiivghlrdguvgeqnecugg ftrfgrthhtvghrnhepjeeuffejkefhtdeguddvheejkefggeetiefhudekiefhudduveef hfegtdevjeelnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homheprghnughrvghssegrnhgrrhgriigvlhdruggv X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 194FA15A007C; Tue, 20 Jul 2021 03:04:14 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-533-gf73e617b8a-fm-20210712.002-gf73e617b Mime-Version: 1.0 Message-Id: <189e4a79-c477-44e0-b3a2-e242b491948d@www.fastmail.com> In-Reply-To: References: <20210719195950.gavgs6ujzmjfaiig@alap3.anarazel.de> <20210720061657.bcueir3krgmkt6m5@alap3.anarazel.de> Date: Tue, 20 Jul 2021 00:03:51 -0700 From: "Andres Freund" To: "David Rowley" Cc: "PostgreSQL Development" , "Robert Haas" , "Michael Paquier" , "Tomas Vondra" Subject: =?UTF-8?Q?Re:_Avoid_stack_frame_setup_in_performance_critical_routines_u?= =?UTF-8?Q?sing_tail_calls?= Content-Type: text/plain List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On Mon, Jul 19, 2021, at 23:53, David Rowley wrote: > On Tue, 20 Jul 2021 at 18:17, Andres Freund wrote: > > Any chance you could show a `perf annotate AllocSetAlloc` and `perf annotate > > palloc` from a patched run? And perhaps how high their percentages of the > > total work are. E.g. using something like > > perf report -g none|grep -E 'AllocSetAlloc|palloc|MemoryContextAlloc|pfree' > > Sure. See attached. > > David > > Attachments: > * AllocateSetAlloc.txt > * palloc.txt > * percent.txt Huh, that's interesting. You have some control flow enforcement stuff turned on (the endbr64). And it looks like it has a non zero cost (or maybe it's just skid). Did you enable that intentionally? If not, what compiler/version/distro is it? I think at least on GCC that's -fcf-protection=... Andres