Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756274AbZCFSMc (ORCPT ); Fri, 6 Mar 2009 13:12:32 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751621AbZCFSMX (ORCPT ); Fri, 6 Mar 2009 13:12:23 -0500 Received: from hrndva-omtalb.mail.rr.com ([71.74.56.124]:52975 "EHLO hrndva-omtalb.mail.rr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751276AbZCFSMW (ORCPT ); Fri, 6 Mar 2009 13:12:22 -0500 Date: Fri, 6 Mar 2009 13:12:19 -0500 (EST) From: Steven Rostedt X-X-Sender: rostedt@gandalf.stny.rr.com To: Mathieu Desnoyers cc: Masami Hiramatsu , Ingo Molnar , Andrew Morton , Nick Piggin , Andi Kleen , Linux Kernel Mailing List , Thomas Gleixner , Peter Zijlstra , Frederic Weisbecker , Linus Torvalds , Arjan van de Ven , Rusty Russell , "H. Peter Anvin" Subject: Re: [PATCH -tip 0/4] Text edit lock and atomic text_poke() In-Reply-To: <20090306180911.GB14236@Krystal> Message-ID: References: <49B1428A.9050500@redhat.com> <20090306180911.GB14236@Krystal> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1708 Lines: 43 On Fri, 6 Mar 2009, Mathieu Desnoyers wrote: > * Masami Hiramatsu (mhiramat@redhat.com) wrote: > > Hi, > > > > Here is a series of patches which introduce text_mutex for protecting > > editing kernel text from each other subsystems, and make text_poke() > > atomic by using fixmap. > > > > BTW, > > > > > Paravirt and alternatives are always done when SMP is inactive, so there is no > > > need to use locks. > > > > Mathieu, I'm not sure that means. alternatives will be called from module > > init code and other place where the system has already been running multi- > > -threads(and they use smp_alt mutex). So, is it possible that those functions > > will sleep or yield to another process? > > > > As I remember, module code uses text_poke_early when modifying the > module text _before_ the module is made available to the rest of the > kernel. Therefore, it behaves as if it was in a UP system, and that's > ok, because only one CPU has to touch the text. Therefore, there is no > need to use text_poke, and therefore no need to take the text mutex. > > Or maybe has it changed ? But I doubt so. > That is correct. Currently ftrace simply does a probe_kernel_write on module code to convert the calls to mcount into nops. This is done before the module is available, and does not require stop_machine nor break points. Since modules are not included in the DEBUG_RODATA there's no need to play games with the page tables either. -- Steve -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/