lkml.org 
[lkml]   [2009]   [Mar]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH -tip 0/4] Text edit lock and atomic text_poke()
* 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.

Mathieu

> Anyway, I added a new patch which locks text_mutex in alternative_smp_*.
>
> Thank you,
>
> arch/x86/include/asm/fixmap.h | 2 ++
> arch/x86/kernel/alternative.c | 29 ++++++++++++++++++++---------
> include/linux/memory.h | 6 ++++++
> kernel/kprobes.c | 15 +++++++++++++--
> mm/memory.c | 9 +++++++++
> 5 files changed, 50 insertions(+), 11 deletions(-)
>
> --
> Masami Hiramatsu
>
> Software Engineer
> Hitachi Computer Products (America) Inc.
> Software Solutions Division
>
> e-mail: mhiramat@redhat.com
>

--
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68


\
 
 \ /
  Last update: 2009-03-06 19:11    [W:0.101 / U:112.644 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site