public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* changing internal kernel system mechanism in runtime by a module patch
@ 2006-11-16 19:19 Yitzchak Eidus
  2006-11-16 19:29 ` Adrian Bunk
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Yitzchak Eidus @ 2006-11-16 19:19 UTC (permalink / raw)
  To: linux-kernel

is it possible to replace linux kernel internal functions such as
schdule () to lets say my_schdule ()  in a run time with a module
patch???
(so that every call in the kernel to schdule() will go to my_schdule()... ) ???

i am talking about a clean/standard way to do such thing
(without overwrite the mem address of the function and replace it in a
dirty way...)

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: changing internal kernel system mechanism in runtime by a module patch
  2006-11-16 19:19 changing internal kernel system mechanism in runtime by a module patch Yitzchak Eidus
@ 2006-11-16 19:29 ` Adrian Bunk
  2006-11-16 21:49   ` Jan Engelhardt
  2006-11-16 21:12 ` Stephen Hemminger
  2006-11-17  6:47 ` Muli Ben-Yehuda
  2 siblings, 1 reply; 7+ messages in thread
From: Adrian Bunk @ 2006-11-16 19:29 UTC (permalink / raw)
  To: Yitzchak Eidus; +Cc: linux-kernel

On Thu, Nov 16, 2006 at 09:19:50PM +0200, Yitzchak Eidus wrote:
> is it possible to replace linux kernel internal functions such as
> schdule () to lets say my_schdule ()  in a run time with a module
> patch???
> (so that every call in the kernel to schdule() will go to my_schdule()... ) 
> ???
> 
> i am talking about a clean/standard way to do such thing
> (without overwrite the mem address of the function and replace it in a
> dirty way...)

No.

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: changing internal kernel system mechanism in runtime by a module patch
  2006-11-16 19:19 changing internal kernel system mechanism in runtime by a module patch Yitzchak Eidus
  2006-11-16 19:29 ` Adrian Bunk
@ 2006-11-16 21:12 ` Stephen Hemminger
  2006-11-17  6:47 ` Muli Ben-Yehuda
  2 siblings, 0 replies; 7+ messages in thread
From: Stephen Hemminger @ 2006-11-16 21:12 UTC (permalink / raw)
  To: linux-kernel

On Thu, 16 Nov 2006 21:19:50 +0200
"Yitzchak Eidus" <ieidus@gmail.com> wrote:

> is it possible to replace linux kernel internal functions such as
> schdule () to lets say my_schdule ()  in a run time with a module
> patch???
> (so that every call in the kernel to schdule() will go to my_schdule()... ) ???
> 
> i am talking about a clean/standard way to do such thing
> (without overwrite the mem address of the function and replace it in a
> dirty way...)
> -
> 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/

Look at kprobe/jprobe.

-- 
Stephen Hemminger <shemminger@osdl.org>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: changing internal kernel system mechanism in runtime by a module patch
  2006-11-16 19:29 ` Adrian Bunk
@ 2006-11-16 21:49   ` Jan Engelhardt
  0 siblings, 0 replies; 7+ messages in thread
From: Jan Engelhardt @ 2006-11-16 21:49 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: Yitzchak Eidus, linux-kernel


On Nov 16 2006 20:29, Adrian Bunk wrote:
>On Thu, Nov 16, 2006 at 09:19:50PM +0200, Yitzchak Eidus wrote:
>> is it possible to replace linux kernel internal functions such as
>> schdule () to lets say my_schdule ()  in a run time with a module
>> patch???

Nothing is impossible.

>> (so that every call in the kernel to schdule() will go to my_schdule()... ) 
>> ???
>> 
>> i am talking about a clean/standard way to do such thing

Not clean. Not standard.
And it sounds evil too.

>> (without overwrite the mem address of the function and replace it in a
>> dirty way...)
>
>No.

You would have to patch _every_ callsite. That's too tedious to be 
useful.

(Hey there is SMP alternatives which sounds like it did just that - 
anyone?)



	-`J'
-- 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: changing internal kernel system mechanism in runtime by a module patch
  2006-11-16 19:19 changing internal kernel system mechanism in runtime by a module patch Yitzchak Eidus
  2006-11-16 19:29 ` Adrian Bunk
  2006-11-16 21:12 ` Stephen Hemminger
@ 2006-11-17  6:47 ` Muli Ben-Yehuda
  2006-11-17  6:58   ` Christoph Hellwig
  2 siblings, 1 reply; 7+ messages in thread
From: Muli Ben-Yehuda @ 2006-11-17  6:47 UTC (permalink / raw)
  To: Yitzchak Eidus; +Cc: linux-kernel

On Thu, Nov 16, 2006 at 09:19:50PM +0200, Yitzchak Eidus wrote:

> is it possible to replace linux kernel internal functions such as
> schdule () to lets say my_schdule () in a run time with a module
> patch???  (so that every call in the kernel to schdule() will go to
> my_schdule()... ) ???

Not in Linux.

> i am talking about a clean/standard way to do such thing
> (without overwrite the mem address of the function and replace it in a
> dirty way...)

k42 supports "dynamic hot-swap" and there's been some work done to
bring it into Linux, see e.g.,
http://ozlabs.org/pipermail/k42-discussion/2006-October/001615.html.

Cheers,
Muli



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: changing internal kernel system mechanism in runtime by a module patch
  2006-11-17  6:47 ` Muli Ben-Yehuda
@ 2006-11-17  6:58   ` Christoph Hellwig
  2006-11-17  7:06     ` Muli Ben-Yehuda
  0 siblings, 1 reply; 7+ messages in thread
From: Christoph Hellwig @ 2006-11-17  6:58 UTC (permalink / raw)
  To: Muli Ben-Yehuda; +Cc: Yitzchak Eidus, linux-kernel

On Fri, Nov 17, 2006 at 08:47:32AM +0200, Muli Ben-Yehuda wrote:
> > i am talking about a clean/standard way to do such thing
> > (without overwrite the mem address of the function and replace it in a
> > dirty way...)
> 
> k42 supports "dynamic hot-swap" and there's been some work done to
> bring it into Linux, see e.g.,
> http://ozlabs.org/pipermail/k42-discussion/2006-October/001615.html.

This kind of stuff is just sick.  Better let them play with their research
OS for this kind of thing :)  In practice any non-trivial bug fix requires
changes to global data structures so reloading a module doesn't make sense.
And for module-specific problems you should be able to hack around using
kprobes if you really need (but then again for a mission critical system
you should have proper active-active failover clustering anyway)

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: changing internal kernel system mechanism in runtime by a module patch
  2006-11-17  6:58   ` Christoph Hellwig
@ 2006-11-17  7:06     ` Muli Ben-Yehuda
  0 siblings, 0 replies; 7+ messages in thread
From: Muli Ben-Yehuda @ 2006-11-17  7:06 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: Yitzchak Eidus, linux-kernel

On Fri, Nov 17, 2006 at 06:58:29AM +0000, Christoph Hellwig wrote:

> This kind of stuff is just sick.  Better let them play with their research
> OS for this kind of thing :)

sick, research, what's the difference? :-)

> In practice any non-trivial bug fix requires
> changes to global data structures so reloading a module doesn't make
> sense.

... unless you have a mechanism (which k42 does) to interpose between
data structures and the users of said structures, which you can use to
decide when to repace them.

> And for module-specific problems you should be able to hack around using
> kprobes if you really need (but then again for a mission critical system
> you should have proper active-active failover clustering anyway)

I'm not advocating we merge this - nor have I seen the implementation
for Linux yet - no need to preemptively scorch it from orbit :-)

Cheers,
Muli

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2006-11-17  7:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-16 19:19 changing internal kernel system mechanism in runtime by a module patch Yitzchak Eidus
2006-11-16 19:29 ` Adrian Bunk
2006-11-16 21:49   ` Jan Engelhardt
2006-11-16 21:12 ` Stephen Hemminger
2006-11-17  6:47 ` Muli Ben-Yehuda
2006-11-17  6:58   ` Christoph Hellwig
2006-11-17  7:06     ` Muli Ben-Yehuda

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox