Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755442AbbHYIbG (ORCPT ); Tue, 25 Aug 2015 04:31:06 -0400 Received: from mail-wi0-f182.google.com ([209.85.212.182]:36940 "EHLO mail-wi0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750863AbbHYIbD (ORCPT ); Tue, 25 Aug 2015 04:31:03 -0400 Date: Tue, 25 Aug 2015 10:30:59 +0200 From: Ingo Molnar To: Wanpeng Li Cc: Leo Yan , Peter Zijlstra , linux-kernel@vger.kernel.org Subject: Re: [PATCH] sched: fix tsk->pi_lock isn't held when do_set_cpus_allowed() Message-ID: <20150825083059.GA20801@gmail.com> References: <20150825081358.GA13299@leoy-linaro> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 901 Lines: 28 * Wanpeng Li wrote: > >>--- a/kernel/cpuset.c > >>+++ b/kernel/cpuset.c > >>@@ -2376,8 +2376,12 @@ void cpuset_cpus_allowed(struct task_struct *tsk, struct cpumask *pmask) > >> void cpuset_cpus_allowed_fallback(struct task_struct *tsk) > >> { > >>+ unsigned long flags; > >>+ > >> rcu_read_lock(); > >>+ raw_spin_lock_irqsave(&tsk->pi_lock, flags); > >> do_set_cpus_allowed(tsk, task_cs(tsk)->effective_cpus); > >>+ raw_spin_lock_irqsave(&tsk->pi_lock, flags); > >Just curious, Will introduce deadlock after acquire lock twice? ;) > > Could you point out where acquires lock twice? In the code you quote? Thanks, Ingo -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/