From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id D7756C433F5 for ; Mon, 10 Jan 2022 02:40:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EE69B6B0071; Sun, 9 Jan 2022 21:40:29 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E6D426B0073; Sun, 9 Jan 2022 21:40:29 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D0E096B0074; Sun, 9 Jan 2022 21:40:29 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0071.hostedemail.com [216.40.44.71]) by kanga.kvack.org (Postfix) with ESMTP id BCF496B0071 for ; Sun, 9 Jan 2022 21:40:29 -0500 (EST) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 7463F96374 for ; Mon, 10 Jan 2022 02:40:29 +0000 (UTC) X-FDA: 79012823778.17.1FB97E2 Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) by imf19.hostedemail.com (Postfix) with ESMTP id 2691C1A0004 for ; Mon, 10 Jan 2022 02:40:27 +0000 (UTC) Received: from imladris.surriel.com ([96.67.55.152]) by shelob.surriel.com with esmtpsa (TLS1.2) tls TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1n6kXT-0003a3-Qh; Sun, 09 Jan 2022 21:36:03 -0500 Message-ID: Subject: Re: [PATCH 16/23] sched: Use lightweight hazard pointers to grab lazy mms From: Rik van Riel To: Andy Lutomirski , Linus Torvalds Cc: Will Deacon , Catalin Marinas , Andrew Morton , Linux-MM , Nicholas Piggin , Anton Blanchard , Benjamin Herrenschmidt , Paul Mackerras , Randy Dunlap , linux-arch , the arch/x86 maintainers , Dave Hansen , "Peter Zijlstra (Intel)" , Nadav Amit , Mathieu Desnoyers Date: Sun, 09 Jan 2022 21:36:03 -0500 In-Reply-To: <00f58dff-9df5-45ac-a078-d852f13b1dfe@www.fastmail.com> References: <7c9c388c388df8e88bb5d14828053ac0cb11cf69.1641659630.git.luto@kernel.org> <3586aa63-2dd2-4569-b9b9-f51080962ff2@www.fastmail.com> <430e3db1-693f-4d46-bebf-0a953fe6c2fc@www.fastmail.com> <484a7f37-ceed-44f6-8629-0e67a0860dc8@www.fastmail.com> <00f58dff-9df5-45ac-a078-d852f13b1dfe@www.fastmail.com> Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-EaNlVd+rYIrB0vBh/aoH" User-Agent: Evolution 3.40.3 (3.40.3-1.fc34) MIME-Version: 1.0 X-Stat-Signature: epkpxtoxw53cdnhgkih64unhndp5qp4s X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 2691C1A0004 Authentication-Results: imf19.hostedemail.com; dkim=none; spf=none (imf19.hostedemail.com: domain of riel@shelob.surriel.com has no SPF policy when checking 96.67.55.147) smtp.mailfrom=riel@shelob.surriel.com; dmarc=none X-HE-Tag: 1641782427-776559 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: --=-EaNlVd+rYIrB0vBh/aoH Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, 2022-01-09 at 17:52 -0700, Andy Lutomirski wrote: > On Sun, Jan 9, 2022, at 1:51 PM, Linus Torvalds wrote: >=20 >=20 >=20 > > > exit_mmap(); > > > for each cpu still in mm_cpumask: > > > =C2=A0 smp_load_acquire > > >=20 > > > That's it, unless the mm is actually in use > >=20 > > Ok, now do this for a machine with 1024 CPU's. > >=20 > > And tell me it is "scalable". > >=20 >=20 > Do you mean a machine with 1024 CPUs and 2 bits set in mm_cpumask or > 1024 CPU with 800 bits set in mm_cpumask?=C2=A0 In the former case, this > is fine.=C2=A0 In the latter case, *on x86*, sure it does 800 loads, but > we're about to do 800 CR3 writes to tear the whole mess down, so the > 800 loads should be in the noise.=C2=A0 (And this series won't actually d= o > this anyway on bare metal, since exit_mmap does the shootdown.) Also, while 800 loads is kinda expensive, it is a heck of a lot less expensive than 800 IPIs. --=20 All Rights Reversed. --=-EaNlVd+rYIrB0vBh/aoH Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEKR73pCCtJ5Xj3yADznnekoTE3oMFAmHbm5MACgkQznnekoTE 3oNRwggAuuCij8MbGWiAc10bmbNIP8YJDmlwcGw1kmYen0ynu8MioDOdKXhA8h8d Eg85rRYlJQK3BLEsGRHuB9E01Pu9Co2syWXpk0bQe+efrvqoJdqOVVnk5A8tRrKK YjQJJ7X0Lz3dM5+0CJNEFcX7guiek/ylvDo6Yy8H7AzSJj+BoO2wlNBonCFSpRvK IE9tcrHVtVE0/aqLt3KUL6y1SUnj7B5XEt3BZMsZO7o+eGul0E8/E+IZISqJ4r+Q towyfaJ8HaxWg4t40x8RsE91YGkcjf2CU0J8dtAnJrPyJ7WbabHe3R+r9SC2hx2F RVbrF1N2DcD2eJwvRhVV0iAW445lKg== =VOyH -----END PGP SIGNATURE----- --=-EaNlVd+rYIrB0vBh/aoH--