kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: mulyadi.santosa@gmail.com (Mulyadi Santosa)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Freeing work_struct memory
Date: Wed, 23 Nov 2011 00:52:39 +0700	[thread overview]
Message-ID: <CAGdaadam0RpvD2UHL3wbPCh9mrL868NR+fwATpsBQm1m+8q5GA@mail.gmail.com> (raw)
In-Reply-To: <4ECABACA.7030701@gnukai.com>

Hi ...

On Tue, Nov 22, 2011 at 03:55, Kai Meyer <kai@gnukai.com> wrote:
> I frequently get a kernel panic with a specific test, but the stack
> trace is rarely the same, which seems to indicate to me that I'm
> corrupting data somewhere. So my question is:
>
> Can I free the memory for "struct my_worker *worker" inside worker_fn?
> Or does the work_queue stuff need to continue to use the "struct
> work_struct work" member after the end of worker_fn?

I think it's due to the dequeueing out of the worker thread. So, it
tries to dequeue, but in fact it points to NULL.

You need to make sure it finishes completely first...then free it later.

-- 
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com

      reply	other threads:[~2011-11-22 17:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-21 20:55 Freeing work_struct memory Kai Meyer
2011-11-22 17:52 ` Mulyadi Santosa [this message]

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=CAGdaadam0RpvD2UHL3wbPCh9mrL868NR+fwATpsBQm1m+8q5GA@mail.gmail.com \
    --to=mulyadi.santosa@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).