mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* task switch hook - crashes
@ 2001-03-15 16:11 Krisztian Flautner
  0 siblings, 0 replies; only message in thread
From: Krisztian Flautner @ 2001-03-15 16:11 UTC (permalink / raw)
  To: linux-kernel


I am experimenting with adding a few hooks to the kernel.
One of the hooks gets invoked every time the kernel switches
two tasks. To do this I added a single line to schedule() right
before the tasks are switched:

      ...
      if (task_switch_hook) task_switch_hook(prev, next)

      switch_to(prev, next, prev);
      ...

I then wrote a module that attaches a function to this hook
in its init_module() function. The problem is that if I do this,
the kernel crashes. Sometimes, the hooks are invoked a few times,
other times, the machine locks up immediately. I previous version
that compiled everything into the kernel worked fine.

I don't quite understand why this does not work. Is this due
to some virtual memory interactions? Maybe the problem is that
modules are vmalloc-ed and the hook function should be kmalloc-ed?

Any insights?


Thanks, -- Kris


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-03-15 16:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-03-15 16:11 task switch hook - crashes Krisztian Flautner

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

all inboxes | Powered by JetHome®