[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+55aFwiVYfFfTjN5j-C6cwA1z3hkCaq7A+hqaW4dG4Yon4Saw@mail.gmail.com>
Date: Tue, 28 Jun 2016 14:40:53 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Andy Lutomirski <luto@...capital.net>
Cc: Oleg Nesterov <oleg@...hat.com>, Andy Lutomirski <luto@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Tejun Heo <tj@...nel.org>, LKP <lkp@...org>,
LKML <linux-kernel@...r.kernel.org>,
kernel test robot <xiaolong.ye@...el.com>
Subject: Re: kthread_stop insanity (Re: [[DEBUG] force] 2642458962: BUG:
unable to handle kernel paging request at ffffc90000997f18)
On Tue, Jun 28, 2016 at 2:35 PM, Linus Torvalds
<torvalds@...ux-foundation.org> wrote:
> On Tue, Jun 28, 2016 at 2:21 PM, Andy Lutomirski <luto@...capital.net> wrote:
>
>> If so, that seems considerably more complicated than just adding a reference count.
>
> Fair enough.
Ahh, and if you put the reference count just in the task_struct (next
to the ->stack pointer), then I guess that's particularly trivial.
Then try_get_task_stack(tsk) becomes
void *try_get_task_stack(struct task_struct *tsk)
{
void *stack = tsk->stack;
if (!atomic_inc_not_zero(&tsk->stackref))
stack = NULL;
return stack;
}
ok, color me convinced.
Linus
Powered by blists - more mailing lists