* [PATCH] small bugfix to tasklet_kill
@ 2003-01-12 9:45 Juergen Quade
0 siblings, 0 replies; only message in thread
From: Juergen Quade @ 2003-01-12 9:45 UTC (permalink / raw)
To: linux-kernel
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);
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2003-01-12 9:37 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-12 9:45 [PATCH] small bugfix to tasklet_kill Juergen Quade
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox