From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758083AbcIURZM (ORCPT ); Wed, 21 Sep 2016 13:25:12 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:17871 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756023AbcIURZI (ORCPT ); Wed, 21 Sep 2016 13:25:08 -0400 From: Santosh Shilimkar Subject: Re: + softirq-fix-tasklet_kill-and-its-users.patch added to -mm tree To: Sergey Senozhatsky , ssantosh@kernel.org References: <57e1b041.zRoBcsxStpPQoyeo%akpm@linux-foundation.org> <20160921051810.GA396@swordfish> <20160921080942.GA476@swordfish> Cc: akpm@linux-foundation.org, davem@davemloft.net, giovanni.cabiddu@intel.com, gregkh@linuxfoundation.org, herbert@gondor.apana.org.au, isdn@linux-pingi.de, mingo@elte.hu, pebolle@tiscali.nl, peterz@infradead.org, salvatore.benedetto@intel.com, tadeusz.struk@intel.com, tglx@linutronix.de, mm-commits@vger.kernel.org, linux-kernel@vger.kernel.org, sfr@canb.auug.org.au, linux-next@vger.kernel.org, sergey.senozhatsky@gmail.com Organization: Oracle Corporation Message-ID: Date: Wed, 21 Sep 2016 10:23:52 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160921080942.GA476@swordfish> Content-Type: multipart/mixed; boundary="------------D4BE268B7B74EE035CC92F8B" X-Source-IP: aserv0022.oracle.com [141.146.126.234] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is a multi-part message in MIME format. --------------D4BE268B7B74EE035CC92F8B Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit On 9/21/2016 1:09 AM, Sergey Senozhatsky wrote: > didn't look into the issue, but this thing > Thanks for reporting Sergey. >>> tasklet_init() == Init and Enable scheduling > [..] >>> @@ -559,7 +559,7 @@ void tasklet_init(struct tasklet_struct >>> { >>> t->next = NULL; >>> t->state = 0; >>> - atomic_set(&t->count, 0); >>> + atomic_set(&t->count, 1); > ^^^^^^^^ >>> t->func = func; >>> t->data = data; >>> } > > seems to be in conflict with > Static helpers also needs to follow the API. > #define DECLARE_TASKLET(name, func, data) \ > struct tasklet_struct name = { NULL, 0, ATOMIC_INIT(0), func, data } > ^^^^^^^ > > #define DECLARE_TASKLET_DISABLED(name, func, data) \ > struct tasklet_struct name = { NULL, 0, ATOMIC_INIT(1), func, data } > ^^^^^^^ > > > as well as with the tasklet_{disable, enable} helpers > Those are fine since they work like a pair and the use count is always balanced. Am assuming one of the driver in your test is using the DECLARE_TASKLET to init the tasklet and killed by tasklet_kill() which leaves that tasklet to be still scheduled by tasklet action. Can you please try below patch and see if you still see the issue ? Attaching the same, just in case mailer eat the tabs. Regards, Santosh From e3e676e501a59b2a7de6e9f99ec3917c157e9caf Mon Sep 17 00:00:00 2001 From: Santosh Shilimkar Date: Wed, 21 Sep 2016 09:58:51 -0700 Subject: [PATCH] softirq: fix DECLARE_TASKLET[_DISABLE] macros init state In linux-next, commit 1f5e9c3bc47f ("softirq: fix tasklet_kill() and its users") changed the init state of the tasklet but missed to update the macros. Fix them too. Reported-by: Sergey Senozhatsky Cc: Andrew Morton Cc: Greg Kroah-Hartman Signed-off-by: Santosh Shilimkar --- include/linux/interrupt.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index 72f0721..cabf575 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h @@ -521,10 +521,10 @@ struct tasklet_struct }; #define DECLARE_TASKLET(name, func, data) \ -struct tasklet_struct name = { NULL, 0, ATOMIC_INIT(0), func, data } +struct tasklet_struct name = { NULL, 0, ATOMIC_INIT(1), func, data } #define DECLARE_TASKLET_DISABLED(name, func, data) \ -struct tasklet_struct name = { NULL, 0, ATOMIC_INIT(1), func, data } +struct tasklet_struct name = { NULL, 0, ATOMIC_INIT(2), func, data } enum -- 1.9.1 --------------D4BE268B7B74EE035CC92F8B Content-Type: text/x-diff; name="0001-softirq-fix-DECLARE_TASKLET-_DISABLE-macros-init-sta.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-softirq-fix-DECLARE_TASKLET-_DISABLE-macros-init-sta.pa"; filename*1="tch" >>From e3e676e501a59b2a7de6e9f99ec3917c157e9caf Mon Sep 17 00:00:00 2001 From: Santosh Shilimkar Date: Wed, 21 Sep 2016 09:58:51 -0700 Subject: [PATCH] softirq: fix DECLARE_TASKLET[_DISABLE] macros init state In linux-next, commit 1f5e9c3bc47f ("softirq: fix tasklet_kill() and its users") changed the init state of the tasklet but missed to update the macros. Fix them too. Reported-by: Sergey Senozhatsky Cc: Andrew Morton Cc: Greg Kroah-Hartman Signed-off-by: Santosh Shilimkar --- include/linux/interrupt.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index 72f0721..cabf575 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h @@ -521,10 +521,10 @@ struct tasklet_struct }; #define DECLARE_TASKLET(name, func, data) \ -struct tasklet_struct name = { NULL, 0, ATOMIC_INIT(0), func, data } +struct tasklet_struct name = { NULL, 0, ATOMIC_INIT(1), func, data } #define DECLARE_TASKLET_DISABLED(name, func, data) \ -struct tasklet_struct name = { NULL, 0, ATOMIC_INIT(1), func, data } +struct tasklet_struct name = { NULL, 0, ATOMIC_INIT(2), func, data } enum -- 1.9.1 --------------D4BE268B7B74EE035CC92F8B--