mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Krisztian Flautner <manowar@engin.umich.edu>
To: linux-kernel@vger.kernel.org
Subject: task switch hook - crashes
Date: Thu, 15 Mar 2001 11:11:03 -0500	[thread overview]
Message-ID: <3AB0E997.2070603@engin.umich.edu> (raw)


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


                 reply	other threads:[~2001-03-15 16:05 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3AB0E997.2070603@engin.umich.edu \
    --to=manowar@engin.umich.edu \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®