From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755528AbcHWVKA (ORCPT ); Tue, 23 Aug 2016 17:10:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36096 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753147AbcHWVJ6 (ORCPT ); Tue, 23 Aug 2016 17:09:58 -0400 Date: Tue, 23 Aug 2016 16:08:42 -0500 From: Josh Poimboeuf To: Andy Lutomirski Cc: Linus Torvalds , Frederic Weisbecker , Thomas Gleixner , Kees Cook , "H . Peter Anvin" , Nilay Vaish , the arch/x86 maintainers , Steven Rostedt , Ingo Molnar , Linux Kernel Mailing List , Brian Gerst , Byungchul Park , Peter Zijlstra Subject: Re: [PATCH v4 54/57] x86/mm: convert arch_within_stack_frames() to use the new unwinder Message-ID: <20160823210842.ic63wnjeknhcdbix@treble> References: <62fab36288792edae0181274641d6b4c62157fea.1471525031.git.jpoimboe@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.0.1 (2016-04-01) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 23 Aug 2016 21:08:44 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 23, 2016 at 01:31:20PM -0700, Andy Lutomirski wrote: > On Aug 23, 2016 12:11 AM, "Linus Torvalds" > So the fact that this seems to have any significant effect on > performance suggests to me that it's being run unnecessarily Yeah, I think check_object_size() is being run unnecessarily in a lot of cases. Calling it only when size is non-const would probably speed things up a lot. > or that somehow we're walking all the way to the top of the stack in > cases where we shouldn't have done so. I know that's not happening because this code would print a warning. > Josh, can you see an example call site in a profile of your test to > find out what this code is doing? I can try to figure it out tomorrow. But really it doesn't surprise me much that this patch makes arch_within_stack_frames() an order of magnitude slower. The original code was very simple, whereas __unwind_start() and unwind_next_frame() have a lot more code. -- Josh