Re: [PATCH v3] sched/numa: fix unsafe get_task_struct() in task_numa_assign()
From: Peter Zijlstra
Date: Tue Oct 21 2014 - 05:46:17 EST
On Mon, Oct 20, 2014 at 10:50:06PM +0200, Oleg Nesterov wrote:
> Let me explain what I personally dislike in v3:
>
> - I think that we do not have enough reasons for
> SLAB_DESTROY_BY_RCU. This is the serious change.
What exactly would the downsides be? SDBR has very limited space
overhead iirc.
> - Again, perhaps we should start we a simple and stupid fix.
> We can do get_task_struct() under rq->lock or, if nothing
> else, just
>
> raw_spin_lock_irq(&rq->lock);
> cur = rq->curr;
> if (is_idle_task(cur) || (cur->flags & PF_EXITING))
> cur = NULL;
> raw_spin_unlock_irq(&rq->lock);
I think I agree with you, this is the simple safe option and is
something we can easily backport. After that we can add creative bits on
top.
I think I prefer the SLAB_DESTROY_BY_RCU thing over the probe_kernel
thing -- but we can take our time once we've fixed the immediate issue
with the simple option.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/