From: Juergen Quade <quade@hsnr.de>
To: linux-kernel@vger.kernel.org
Subject: [PATCH] small bugfix to tasklet_kill
Date: Sun, 12 Jan 2003 10:45:45 +0100 [thread overview]
Message-ID: <20030112094545.GA1420@hsnr.de> (raw)
Find a mini-patch below, which is a bugfix to the tasklet_kill()
code. It removes the last line of the function, which clears the
TASKLET_STATE_SCHED bit.
Some more explanation:
That a tasklet has been scheduled for processing is marked by
the TASKLET_STATE_SCHED bit. If this bit is set, a call to
tasklet_schedule() does nothing. If it is cleared, the tasklet
is put on the processing queue (call to __tasklet_schedule()).
After processing the tasklet the TASKLET_STATE_SCHED bit is
cleared (so by calling tasklet_schedule() it will be put on the
processing queue).
The trick to kill a tasklet (function tasklet_kill() ) is:
- set the TASKLET_SCHEDULE_BIT, but at the same time
- take care that the tasklet is _not_ on the processing queue.
This is done by waiting for the execution of the tasklet (if it
is scheduled) and then _setting_ the bit.
==================================================================
diff -urN linux-2.5.56/kernel/softirq.c linux/kernel/softirq.c
--- linux-2.5.56/kernel/softirq.c 2003-01-02 04:21:21.000000000
+0100
+++ linux/kernel/softirq.c 2003-01-12 10:13:06.000000000 +0100
@@ -258,7 +258,6 @@
while (test_bit(TASKLET_STATE_SCHED, &t->state));
}
tasklet_unlock_wait(t);
- clear_bit(TASKLET_STATE_SCHED, &t->state);
}
reply other threads:[~2003-01-12 9:37 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=20030112094545.GA1420@hsnr.de \
--to=quade@hsnr.de \
--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