Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp784665ybm; Wed, 22 May 2019 11:26:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqwneZYYFFb8ZJa4KGF7D+Gmyus0qeOuf4KL6J0o+H2YrtNZ4R5UGW8xrQZdYgiXSDo8KSwJ X-Received: by 2002:a17:902:9348:: with SMTP id g8mr49433337plp.174.1558549600048; Wed, 22 May 2019 11:26:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558549600; cv=none; d=google.com; s=arc-20160816; b=WgHUkPQxHAL2f/XomsVfbKmMpjfHYwd0pvJqSgl4OvhJIsVKe8pQXoFNieSH2JTugG smZsqK58ABR6iwRcLg3/RJfcsTFXpYoVa/1H8QAYnfWVFwNejU8cadN1cD2ToleAu2EC 8gxbRBTHO6BvrZp+cKEDDD8XKLA2NLPZgAcDL4W74j0DD91sE10nuJ9HHJ7eRrjGejdJ O8ZS5HH09xSceaSIjGF6G4bO5hZ3bqjJib/a4ve0Xu+HFljVjC3RUXmRPHZUwTBmiSKf Spo71QMzUUboSMQPSEWspxle2I4PXtS/vbkswnhw2zTLjOMMSLOGzrvu833SSkLREXXR jdRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:date:cc:to:from:subject:message-id; bh=Y8oupPkSiFsm7m3eQQuW2wpyXO53F9NPDdBE1noBGGo=; b=lna6FSgyWPqhMJp+BhPhtp+aa/Kn3qzPMUB1EFDakPD6yYM/DTQJCjgedkgMABqDQK +ZkRAPEALQ1Ng1PautahpFnQw5RBc/BFQWczOeXS2En5tTa7E/RMmiwcti6B2Ai3/OJ3 HecHjDiUyThvqIxsG4fBdcKCzxo66gRvESl6KBs/CAyXQE0wR94UnqU51smyH9qQLGib 7JKwrL3OKC9bjkR08cb0Uct/0/lcObbTSJ+zXX0Vj8p/cuhfFGiI7a/UM1el4UCd0NT7 OV5eRrOKijvTHQjzNbz4DPV2T1HAr7SOlVsqxd8KXhzI9m//qDPfhJFkQ9XGpD84pGEa fzBw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j185si15986334pge.465.2019.05.22.11.26.24; Wed, 22 May 2019 11:26:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729583AbfEVSX4 (ORCPT + 99 others); Wed, 22 May 2019 14:23:56 -0400 Received: from shelob.surriel.com ([96.67.55.147]:40060 "EHLO shelob.surriel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728272AbfEVSX4 (ORCPT ); Wed, 22 May 2019 14:23:56 -0400 Received: from imladris.surriel.com ([96.67.55.152]) by shelob.surriel.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1hTVtz-0002ay-Uk; Wed, 22 May 2019 14:23:47 -0400 Message-ID: Subject: Re: [PATCH] smp,cpumask: Don't call functions on offline CPUs From: Rik van Riel To: Peter Zijlstra , Andrew Murray Cc: Thomas Gleixner , linux-kernel@vger.kernel.org Date: Wed, 22 May 2019 14:23:47 -0400 In-Reply-To: <20190522144918.GH16275@worktop.programming.kicks-ass.net> References: <20190522111537.27815-1-andrew.murray@arm.com> <20190522140921.GD16275@worktop.programming.kicks-ass.net> <20190522143711.GC8268@e119886-lin.cambridge.arm.com> <20190522144918.GH16275@worktop.programming.kicks-ass.net> Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-0vbLQ8PSxJ5AAaklNGAH" User-Agent: Evolution 3.30.5 (3.30.5-1.fc29) MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-0vbLQ8PSxJ5AAaklNGAH Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 2019-05-22 at 16:49 +0200, Peter Zijlstra wrote: > On Wed, May 22, 2019 at 03:37:11PM +0100, Andrew Murray wrote: > > > Is perhaps the problem that on_each_cpu_cond() uses > > > cpu_onlne_mask > > > without protection? > >=20 > > Does this prevent racing with a CPU going offline? I guess this > > prevents > > the warning at the expense of a lock - but is only beneficial in > > the > > unlikely path. (In the likely path this prevents new CPUs going > > offline > > but we don't care because we don't WARN if they aren't they when we > > attempt to call functions). > >=20 > > At least this is my limited understanding. >=20 > Hmm.. I don't think it could matter, we only use the mask when > preempt_disable(), which would already block offline, due to it using > stop_machine(). >=20 > So the patch is a no-op. >=20 > What's the WARN you see? TLB invalidation should pass mm_cpumask(), > which similarly should not contain offline CPUs I'm thinking. Does the TLB invalidation code have anything in it to prevent from racing with the CPU offline code? In other words, could we end up with the TLB invalidation code building its bitmask, getting interrupted (eg. hypervisor preemption, NMI), and not sending out the IPI to that bitmask of CPUs until after one of the CPUs in the bitmap has gotten offlined? --=20 All Rights Reversed. --=-0vbLQ8PSxJ5AAaklNGAH Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEKR73pCCtJ5Xj3yADznnekoTE3oMFAlzlk7MACgkQznnekoTE 3oMqLwf/Qre0ZBiGCS1ToLsApMEvym3Mq6QzFAX5MSjWE7mfxX56YVeIGWqULrie fReCb4ubNKv5TSLXTFRLweA07U57LmUfUdgtqLJdBvAgT1W3o32WiS/m83o9Fl9P Xf7zMtyNoiQXekB2gj85QtZgxsdvySgTwIYdPXRL9c0w2mNHz1gnpXfj9Ah2kV6q 3It3S3D6QOXHwPV/eXP3PghRmWgmVZKo4UHQaBGbUrFnNRSKCO25YZPDenBmc/DX 9ZE0gZM7KMAr8mu0YcI3YsGtuVyZUCv53KSJnpT7c9G9RyfoDjsu0IbW1VxsEfdW jV19/XX+8iMH29oWqsjVP2YBNXYeAw== =KvjP -----END PGP SIGNATURE----- --=-0vbLQ8PSxJ5AAaklNGAH--