From: Yuly Finkelberg <liquidicecube@gmail.com>
To: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Scheduler: Spinning until tasks are STOPPED
Date: Sun, 8 May 2005 20:10:17 -0400 [thread overview]
Message-ID: <92df31750505081710502c872@mail.gmail.com> (raw)
In-Reply-To: <427D8EC3.9040409@yahoo.com.au>
> Well it still sounds like the kernel is doing too much. For example,
> why don't you just have a syscall (or char device) just to send out
> the events, and do everything else (all the queueing and
> synchronisation and signalling) in userspace?
True, it does :)
However, the operation requires that a consistent in-kernel state will
hold for the tasks. They all (except for the last one) do some work,
send a SIGSTOP to themselves, and return to usermode (handling the
STOP signal). The last task does not stop itself, but instead
verifies that all of the others are stopped before it returns.
> OK, for a simple example, instead of spinning on yield(), do a
> down() on a locked mutex.
> Then have maybe an `atomic_t nr_running` which is incremented for
> each worker task running. When they are ready to stop, they can
> do an atomic_dec_and_test of nr_running, and the last one can up()
> the mutex. If you absolutely need to know when the process is
> actually stopped, why?
I need to ensure that the internal state of the processes will not
change (unless of course some other signal gets delivered, which will
not be the case).
It doesn't look like the problem is with the task that is spinning
until the others have stopped. Instead, it looks like one of the
other tasks is spinning somewhere in between the time that it wakes up
its successor and the time that it sends it self the STOP signal. It
is clearly getting preempted but then makes no progress (sometimes for
a VERY long time).
next prev parent reply other threads:[~2005-05-09 0:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-07 6:31 Scheduler: Spinning until tasks are STOPPED Yuly Finkelberg
2005-05-07 7:12 ` Nick Piggin
2005-05-07 17:36 ` Yuly Finkelberg
2005-05-08 4:00 ` Nick Piggin
2005-05-09 0:10 ` Yuly Finkelberg [this message]
[not found] ` <92df317505050817071d852623@mail.gmail.com>
2005-05-09 6:05 ` Nick Piggin
[not found] <41r8S-6Y0-13@gated-at.bofh.it>
[not found] ` <41rLz-7zl-5@gated-at.bofh.it>
[not found] ` <41BrD-79c-29@gated-at.bofh.it>
2005-05-07 22:38 ` Bodo Eggert <harvested.in.lkml@posting.7eggert.dyndns.org>
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=92df31750505081710502c872@mail.gmail.com \
--to=liquidicecube@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=nickpiggin@yahoo.com.au \
/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.