Re: [PATCH v10 07/12] task_isolation: add debug boot flag

From: Chris Metcalf
Date: Wed Mar 02 2016 - 15:56:44 EST


On 3/2/2016 3:37 PM, Peter Zijlstra wrote:
On Wed, Mar 02, 2016 at 03:09:31PM -0500, Chris Metcalf wrote:
+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);
As I think Oleg keeps reminding me, this is not actually a safe thing to
do.

So what's the right solution? The fast path in task_isolation_debug_task basically
just uses the new "task_isolation_flags", and "pid" and "comm". I would think those
would all have to be safe because of the get_task_struct().

The piece that might be problematic is the eventual call to send_sig_info() using the
task_struct pointer (called via task_isolation_debug_task -> task_isolation_interrupt).
Clearly this is safe at some level, since that's more or less what sys_kill() does and the
process could similarly evaporate half way through sending the signal.

Suggestions? Thanks!

--
Chris Metcalf, Mellanox Technologies
http://www.mellanox.com