All of lore.kernel.org
 help / color / mirror / Atom feed
From: greg@kroah.com (Greg KH)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Reboot not calling module_exit of LKM
Date: Fri, 5 Aug 2011 12:06:30 -0700	[thread overview]
Message-ID: <20110805190630.GA15499@kroah.com> (raw)
In-Reply-To: <CAFNhLUVJO3JmsorNiab-A8OEtT503KUEb4-DX3FSEdO6d1tkTQ@mail.gmail.com>

On Fri, Aug 05, 2011 at 11:39:16AM -0700, Ramesh.P wrote:
> Hi,
> 
> Good day!
> 
> When a system is rebooted, the loadable kernel modules 'module_exit'
> functions are not called. I see this behavior in a custom kernel. My
> questions are
> 
> a. Is this applicable in mainline/normal kernel too?

Yes.

> b. If yes, what are the reasons? (One reason may be, not to get into
> new problems while cleaning up the module)

You don't need to unload a module as the machine is about to be turned
off.

> c. Is there anyway for the kernel module to know the system is getting
> rebooted? (Apart from letting userspace to indicate the kernel
> module).

Yes, hook to the reboot notifier.

  reply	other threads:[~2011-08-05 19:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-05 18:39 Reboot not calling module_exit of LKM Ramesh.P
2011-08-05 19:06 ` Greg KH [this message]
2011-08-05 22:59   ` Ramesh.P

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=20110805190630.GA15499@kroah.com \
    --to=greg@kroah.com \
    --cc=kernelnewbies@lists.kernelnewbies.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.