lkml.org 
[lkml]   [2016]   [May]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v12 07/13] task_isolation: add debug boot flag
On Wed, May 18, 2016 at 12:35:19PM -0400, Chris Metcalf wrote:
> On 5/18/2016 9:56 AM, Peter Zijlstra wrote:
> >On Tue, Apr 05, 2016 at 01:38:36PM -0400, Chris Metcalf wrote:
> >>+#ifdef CONFIG_TASK_ISOLATION
> >>+void task_isolation_debug(int cpu)
> >>+{
> >>+ struct task_struct *p;
> >>+
> >>+ if (!task_isolation_possible(cpu))
> >>+ return;
> >>+
> >>+ rcu_read_lock();
> >>+ p = cpu_curr(cpu);
> >>+ get_task_struct(p);
> >>+ rcu_read_unlock();
> >>+ task_isolation_debug_task(cpu, p);
> >>+ put_task_struct(p);
> >
> >This is still broken...
>
> I don't know how or why, though. :-) Can you give me a better idiom?
> This looks to my eye just like how it's done for something like
> sched_setaffinity() by one task on another task, and I would have
> assumed the risks there of the other task evaporating part way
> through would be the same as the risks here.

Because rcu_read_lock() does not stop the task pointed to by
cpu_curr(cpu) from disappearing on you entirely.

See also the discussion around:

lkml.kernel.org/r/20160518170218.GY3192@twins.programming.kicks-ass.net


\
 
 \ /
  Last update: 2016-05-18 19:41    [W:0.088 / U:0.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site