Re: [PATCH 1/2] ftrace: nmi safe code modification

Ingo Molnar
2008-10-30T20:38:54Z

* Andrew Morton <akpm@linux-foundation.org> wrote:

> > + /* make sure NMIs see the cleared bit */
> > + smp_mb();
> > +
> > + wait_for_nmi();
> > +
> > + return mod_code_status;
> > +}
>
> I guess the weakness here is that the code will only allow a single
> contiguous hunk of text to be modified. One could envisage
> situations where two or more separate areas of memory need to be
> modified atomically/together.
>
> I guess we can cross that bridge when we fall off it.

yeah - the whole 'transaction' concept can be extended easily, in just
one place.

Not that i think that it would really be useful to go beyond the
current (target,len) abstraction - the less complex code patching is
done, the better.

Ingo