mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "karthikeyan S" <karthispeaks@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: A bug (probably) in stop_all_threads
Date: Sat, 13 Sep 2008 13:57:28 +0530	[thread overview]
Message-ID: <3bedf6ab0809130127j7ed9d372pcb15e1b001178600@mail.gmail.com> (raw)

Hi,

Apologies if I am posting this message in an incorrect mailing list
and for bringing up an issue with older kernel version (2.4), and if
the issue had been brought up earlier and I missed it.

There seems to be a bug with stop_all_threads function in 2.4. The
function sends SIGSTOP to all the threads in the thread group and
waits until all the threads get their state changed accordingly.

While waiting, if it finds that the event has not occurred, it tires
to yield the processor to other processes by calling
schedule_timeout().

Bur before calling schedule_timeout() it does not set the task state
to either TASK_INTERRUPTIBLE or TASK_UNINTERRUPTIBLE.
So schedule_timeout() does not do anything effectively.

This causes a problem in our device which uses kernel 2.4. When we
have a sigsegv from the task which runs at highest priority, the
control is stuck waiting for all the threads in the thread group to
change their task state. But the other threads never get a chance to
run and the SIGSTOP sent to them is of no effect.

When  I changed the stop_all_threads function to set the task state to
TASK_INTERRUPTIBLE, the problem disappears.

So is this a real issue that stop_all_threads() does not set the
current task to TASK_INTERRUPTIBLE before calling schedule_timeout()?

Please provide your feedback. Thanks a lot.

-karthik

             reply	other threads:[~2008-09-13  8:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-13  8:27 karthikeyan S [this message]
2008-09-13 10:07 ` Grant Coady
2008-09-16  5:17   ` Willy Tarreau
2008-09-16  5:49     ` karthikeyan S
2008-09-16  6:22       ` Willy Tarreau
2008-09-16  8:28         ` karthikeyan S
2008-09-16  9:28           ` Willy Tarreau
2008-09-16 19:30             ` karthikeyan S
2008-09-16 20:21               ` Willy Tarreau

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=3bedf6ab0809130127j7ed9d372pcb15e1b001178600@mail.gmail.com \
    --to=karthispeaks@gmail.com \
    --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®