From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757448AbcG1Tww (ORCPT ); Thu, 28 Jul 2016 15:52:52 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:27303 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751375AbcG1Twr (ORCPT ); Thu, 28 Jul 2016 15:52:47 -0400 From: Wengang Subject: tasklet_kill makes sure no future re-schedule? To: linux-kernel@vger.kernel.org Cc: Wengang Wang , Santosh Shilimkar , Srinivas Eeda Message-ID: <01b3cc9a-2563-e31a-12b2-9f80924e71ce@oracle.com> Date: Thu, 28 Jul 2016 12:52:17 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Source-IP: aserv0021.oracle.com [141.146.126.233] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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