On Fri, Apr 24, 2020 at 10:01:46AM -0400, Steven Rostedt wrote: > On Fri, 24 Apr 2020 17:26:32 +0800 > Xiao Yang <yangx.jy@xxxxxxxxxxxxxx> wrote: > > > Hi Steve, Joel > > > > Sorry to bother you. > > > > On my slow arm64 vm, inserting and removing preemptirq_delay_test module > > in loops triggers kernel panic sometimes. > > > > Reproduce steps: > > Do the following steps in loops(more than 10 times): > > [root@CentOS81-aarch64 ]# modprobe preemptirq_delay_test > > test_mode=preempt delay=500000; rmmod preemptirq_delay_test > > > > > > Joel, > > I never did really look at that module, but doing a quick scan, I see you > never clean up the task you start. > > Which means, you can remove the module and the task still exists, and when > it runs, it will execute code that has been freed. > > The module exit should still do a kthread_stop() on it. If anything, it > will prevent the task existing after the module is removed. Thanks Steve for taking a look, I will submit a fix for it ASAP and send it to you for -rc cycle. Thanks Xiao for the report. - Joel