Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751374AbdH2BnS (ORCPT ); Mon, 28 Aug 2017 21:43:18 -0400 Received: from mail-io0-f195.google.com ([209.85.223.195]:37612 "EHLO mail-io0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751215AbdH2BnR (ORCPT ); Mon, 28 Aug 2017 21:43:17 -0400 MIME-Version: 1.0 In-Reply-To: <71ea8331-78da-c22b-d46d-99ab6c187bbf@nokia.com> References: <1503476475-21069-1-git-send-email-matt.redfearn@imgtec.com> <71ea8331-78da-c22b-d46d-99ab6c187bbf@nokia.com> From: Huacai Chen Date: Tue, 29 Aug 2017 09:43:15 +0800 Message-ID: Subject: Re: [PATCH] MIPS: Revert "MIPS: Fix race on setting and getting cpu_online_mask" To: Matija Glavinic Pecotic Cc: Matt Redfearn , Ralf Baechle , Linux MIPS Mailing List , Marcin Nowakowski , Paul Gortmaker , "linux-kernel@vger.kernel.org" , Ingo Molnar , Paul Burton Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1285 Lines: 25 I suggest to drop sync_r4k completely, because it is inaccurate. You can use IPI to synchronize count/compare instead, as Loongson-3 does. Huacai On Mon, Aug 28, 2017 at 6:07 PM, Matija Glavinic Pecotic wrote: > On 08/23/2017 10:21 AM, Matt Redfearn wrote: >> As noted in the commit message, upstream differs in this area. The >> hotplug code now waits on a completion event in bringup_wait_for_ap, >> which is set by the starting CPU in cpuhp_online_idle once it calls >> cpu_startup_entry. Thus there is no possibility of a race in upstream, >> and this commit has only re-introduced the deadlock condition, which can >> be observed on multiple platforms when running a heavy load test at the >> same time as hotplugging CPUs. See commit 8f46cca1e6c06 ("MIPS: SMP: Fix >> possibility of deadlock when bringing CPUs online") for details. > > I personally do not like the fact that synchronization is implicitly done by the callers, it is the reason why the patch was proposed. As noted before, it is enough someone checks cpu online mask somewhere in between and there is race again. > > How about moving synchronise_count_slave before setting the cpu online? Is there dependency it has to be done after completion? > > Regards, > > Matija >