From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751218AbdFANMK (ORCPT ); Thu, 1 Jun 2017 09:12:10 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:37833 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751062AbdFANMI (ORCPT ); Thu, 1 Jun 2017 09:12:08 -0400 Date: Thu, 1 Jun 2017 15:12:04 +0200 From: Peter Zijlstra To: Josh Poimboeuf Cc: x86@kernel.org, linux-kernel@vger.kernel.org, live-patching@vger.kernel.org, Linus Torvalds , Andy Lutomirski , Jiri Slaby , Ingo Molnar , "H. Peter Anvin" Subject: Re: [RFC PATCH 10/10] x86/unwind: add undwarf unwinder Message-ID: <20170601131204.odhgktimjz6czdyu@hirez.programming.kicks-ass.net> References: <89552d4047e5aed843f7b6a54277f9af62da6a82.1496293620.git.jpoimboe@redhat.com> <20170601121356.5yoeq74el77sewoo@hirez.programming.kicks-ass.net> <20170601123609.ku5zq2huhlneq2dn@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170601123609.ku5zq2huhlneq2dn@treble> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 01, 2017 at 07:36:09AM -0500, Josh Poimboeuf wrote: > On Thu, Jun 01, 2017 at 02:13:56PM +0200, Peter Zijlstra wrote: > > So we do that lookup for every single frame. That's going to hurt. > > > > Would it make sense to cache the last 'module' in an attempt to at least > > avoid that lookup again? Something like so: > > The only thing with caching the module is, what if the module goes away? Yeah.. *boom* ;-) We could of course play games with module_get() and module_put(), but meh. > Based on your previous comment I was thinking I would disable preemption > for the entire unwind_next_frame() step, but not *between* steps. I > suppose we could require the unwind caller to disable preemption but I'd > like to avoid that if possible. Right, keeping it disabled across a frame should be ok I suppose.