Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1452077

tasklet_kill makes sure no future re-schedule?

From Wengang <wen.gang.wang@oracle.com>
Newsgroups linux.kernel
Subject tasklet_kill makes sure no future re-schedule?
Date 2016-07-28 22:00 +0200
Message-ID <rZZDj-2lv-7@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


Hi,

I recently hit an issue that after tasklet_kill called against a tasket, 
the tasklet can still be scheduled in IRQ context and run at a later time.
So my question is whether tasklet_kill is designed to make sure no 
future re-scheduling can be done. I didn't find an official document 
stating that, but find some non-official ones. The thing is that the 
voices are different:

Someone (http://www.makelinux.net/books/lkd2/ch07lev1sec3) says

"You can remove a tasklet from the pending queue via tasklet_kill(). 
This function receives a pointer as a lone argument to the tasklet's 
tasklet_struct. Removing a scheduled tasklet from the queue is useful 
when dealing with a tasklet that often reschedules itself. This function 
first waits for the tasklet to finish executing and then it removes the 
tasklet from the queue. Nothing stops some other code from rescheduling 
the tasklet, of course. This function must not be used from interrupt 
context because it sleeps."

And someone else (http://www.makelinux.net/ldd3/chp-7-sect-5) says

"This function ensures that the tasklet is not scheduled to run again; 
it is usually called when a device is being closed or the module 
removed. If the tasklet is scheduled to run, the function waits until it 
has executed. If the tasklet reschedules itself, you must prevent it 
from rescheduling itself before calling tasklet_kill, as with 
del_timer_sync."


Looking at the code, I prefer "Nothing stops some other code from 
rescheduling the lasklet". But I want a confirm here please!

Thanks,
Wengang

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

tasklet_kill makes sure no future re-schedule? Wengang <wen.gang.wang@oracle.com> - 2016-07-28 22:00 +0200

csiph-web