From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755343AbbGFMss (ORCPT ); Mon, 6 Jul 2015 08:48:48 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:40224 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754965AbbGFMsq (ORCPT ); Mon, 6 Jul 2015 08:48:46 -0400 Date: Mon, 6 Jul 2015 14:48:27 +0200 From: Peter Zijlstra To: Xunlei Pang Cc: linux-kernel@vger.kernel.org, Steven Rostedt , Juri Lelli , Ingo Molnar , Xunlei Pang Subject: Re: [PATCH v4 1/2] sched/rt: Check to push the task away after its affinity was changed Message-ID: <20150706124827.GF3644@twins.programming.kicks-ass.net> References: <1435994483-2766-1-git-send-email-xlpang@126.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1435994483-2766-1-git-send-email-xlpang@126.com> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jul 04, 2015 at 03:21:22PM +0800, Xunlei Pang wrote: > @@ -1187,6 +1227,14 @@ int set_cpus_allowed_ptr(struct task_struct *p, const struct cpumask *new_mask) > } > > do_set_cpus_allowed(p, new_mask); > + /* > + * rq->lock might get released during __balance_callback(), > + * but if there's any successful migrating of @p, task_cpu(p) > + * will obviously be in the new_mask, as p->pi_lock is never > + * released; Thus, subsequent cpumask_test_cpu() is true and > + * will make it return safely in such case. > + */ > + __balance_callback(rq); > > /* Can the task run on the task's current CPU? If so, we're done */ > if (cpumask_test_cpu(task_cpu(p), new_mask)) This will trigger the lockdep_pin stuff.