[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200428104543.3926eaaf@gandalf.local.home>
Date: Tue, 28 Apr 2020 10:45:43 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Xiao Yang <yangx.jy@...fujitsu.com>
Cc: "Joel Fernandes (Google)" <joel@...lfernandes.org>,
<linux-kernel@...r.kernel.org>, Ingo Molnar <mingo@...hat.com>
Subject: Re: [PATCH] kernel/trace: Stop and wait for kthread on preempt irq
module unload
On Tue, 28 Apr 2020 10:44:09 -0400
Steven Rostedt <rostedt@...dmis.org> wrote:
> On Tue, 28 Apr 2020 18:19:05 +0800
> Xiao Yang <yangx.jy@...fujitsu.com> wrote:
>
> > Hi Joel,
> >
> > Thanks for your quick fix.
> >
> > Unfortunately, it fixes my original panic but introduces other
> > issues(two wanings and one panic) on my arm64 vm, as below:
> >
>
> Does the following on top of Joel's patch fix it?
>
> -- Steve
>
> diff --git a/kernel/trace/preemptirq_delay_test.c b/kernel/trace/preemptirq_delay_test.c
> index 1c28ca20e30b..6d9131ae7e8c 100644
> --- a/kernel/trace/preemptirq_delay_test.c
> +++ b/kernel/trace/preemptirq_delay_test.c
> @@ -113,15 +113,27 @@ static int preemptirq_delay_run(void *data)
>
> for (i = 0; i < s; i++)
> (testfuncs[i])(i);
> +
> + while (!kthread_should_stop()) {
> + schedule();
> + set_current_state(TASK_INTERRUPTIBLE);
> + }
> +
> + __set_current_state(TASK_RUNNING);
> +
> return 0;
> }
>
The below isn't needed, as the return does check IS_ERR().
-- Steve
> static struct task_struct *preemptirq_start_test(void)
> {
> + struct task_struct *task;
> char task_name[50];
>
> snprintf(task_name, sizeof(task_name), "%s_test", test_mode);
> - return kthread_run(preemptirq_delay_run, NULL, task_name);
> + task = kthread_run(preemptirq_delay_run, NULL, task_name);
> + if (IS_ERR(task))
> + return NULL;
> + return task;
> }
>
>
>
Powered by blists - more mailing lists