Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755301AbbHYIiX (ORCPT ); Tue, 25 Aug 2015 04:38:23 -0400 Received: from blu004-omc1s28.hotmail.com ([65.55.116.39]:57249 "EHLO BLU004-OMC1S28.hotmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752320AbbHYIiV (ORCPT ); Tue, 25 Aug 2015 04:38:21 -0400 X-TMN: [P6hcDpXkPPwqXatigQHgSfV6wbo0/Us4] X-Originating-Email: [wanpeng.li@hotmail.com] Message-ID: Subject: Re: [PATCH] sched: fix tsk->pi_lock isn't held when do_set_cpus_allowed() To: Ingo Molnar References: <20150825081358.GA13299@leoy-linaro> <20150825083059.GA20801@gmail.com> CC: Leo Yan , Peter Zijlstra , linux-kernel@vger.kernel.org From: Wanpeng Li Date: Tue, 25 Aug 2015 16:38:14 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <20150825083059.GA20801@gmail.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 25 Aug 2015 08:38:18.0764 (UTC) FILETIME=[64854CC0:01D0DF11] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1058 Lines: 33 On 8/25/15 4:30 PM, Ingo Molnar wrote: > * 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? Shame me, sorry for sending out the wrong version. I fix in it soon in v2. Regards, Wanpeng Li > > 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/