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