From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932195Ab1JMQcl (ORCPT ); Thu, 13 Oct 2011 12:32:41 -0400 Received: from casper.infradead.org ([85.118.1.10]:44694 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932135Ab1JMQci convert rfc822-to-8bit (ORCPT ); Thu, 13 Oct 2011 12:32:38 -0400 Subject: Re: [PATCH RFC V4 06/10] jump_label: add arch_jump_label_transform_static() to optimise non-live code updates From: Peter Zijlstra To: Jason Baron Cc: Jeremy Fitzhardinge , Steven Rostedt , "David S. Miller" , David Daney , Michael Ellerman , Jan Glauber , the arch/x86 maintainers , Xen Devel , Linux Kernel Mailing List , Ingo Molnar , "H. Peter Anvin" , Jeremy Fitzhardinge , rth@redhat.com Date: Thu, 13 Oct 2011 18:32:05 +0200 In-Reply-To: <20111013155553.GD2455@redhat.com> References: <16f652166605c973e9817177b6ba6a081e3e5b3f.1318464413.git.jeremy.fitzhardinge@citrix.com> <1318501954.24856.5.camel@twins> <20111013135439.GA2455@redhat.com> <1318519758.27731.15.camel@twins> <20111013155553.GD2455@redhat.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Mailer: Evolution 3.0.3- Message-ID: <1318523526.27731.18.camel@twins> Mime-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2011-10-13 at 11:55 -0400, Jason Baron wrote: > > I actually need them to be either way.. no preference between on or off > > just a means of very _very_ infrequent runtime change in behaviour. > > > > ok, this is a new use case, all the current users are biased with gcc > out-of-lining the infrequent case. Right, > > If we can push jump_label init to before sched_init() all I need is a > > static_branch() without the unlikely() in to avoid GCC out-of-lining the > > branch. > > > > hmmm....the current code (I believe) is biased b/c gcc sees the > branch as always false, see: arch_static_branch() - its not b/c we have > an unlikely there. Without open coding the label, like we had before > everybody hated, I'll have to play around and see what will create an > unbiased branch...perhaps, somebody has an idea? Fix gcc and stick an unlikely in static_branch() ? :-) > > > and by patching them early > > > like this, at least for x86, we can avoid the stop machine calls. So its > > > the combination of most are expected to be off and no sense to call extra > > > stop machines that lead the code to its present state. > > > > But we could use arch_jump_label_transform_static because its before we > > actually execute any module text (sans the arg crap) which is > > stomp-machine free, removing that obstacle. > > > > Or am I confused more? > > > > The MODULE_COMING callback happens *after* the call to flush_module_icache(mod), > so I'm not sure that is safe... We can issue another one of those?