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 X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 18780C47436 for ; Thu, 3 Dec 2020 14:46:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 65BBA207A4 for ; Thu, 3 Dec 2020 14:27:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730735AbgLCO1S (ORCPT ); Thu, 3 Dec 2020 09:27:18 -0500 Received: from shelob.surriel.com ([96.67.55.147]:35106 "EHLO shelob.surriel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729431AbgLCO1R (ORCPT ); Thu, 3 Dec 2020 09:27:17 -0500 Received: from imladris.surriel.com ([96.67.55.152]) by shelob.surriel.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1kkpZ2-00023G-Re; Thu, 03 Dec 2020 09:26:32 -0500 Message-ID: <0239dde7da2d6b6499970f343c7498c711ce14c2.camel@surriel.com> Subject: Re: [MOCKUP] x86/mm: Lightweight lazy mm refcounting From: Rik van Riel To: Matthew Wilcox , Andy Lutomirski Cc: Nicholas Piggin , Anton Blanchard , Arnd Bergmann , linux-arch , LKML , Linux-MM , linuxppc-dev , Mathieu Desnoyers , X86 ML , Will Deacon , Catalin Marinas , Dave Hansen Date: Thu, 03 Dec 2020 09:26:32 -0500 In-Reply-To: <20201203123129.GH11935@casper.infradead.org> References: <7c4bcc0a464ca60be1e0aeba805a192be0ee81e5.1606972194.git.luto@kernel.org> <20201203123129.GH11935@casper.infradead.org> Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-s09L+bRyOvtccCU/oR2v" User-Agent: Evolution 3.34.4 (3.34.4-1.fc31) MIME-Version: 1.0 Sender: riel@shelob.surriel.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-s09L+bRyOvtccCU/oR2v Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, 2020-12-03 at 12:31 +0000, Matthew Wilcox wrote: > And this just makes me think RCU freeing of mm_struct. I'm sure it's > more complicated than that (then, or now), but if an anonymous > process > is borrowing a freed mm, and the mm is freed by RCU then it will not > go > away until the task context switches. When we context switch back to > the anon task, it'll borrow some other task's MM and won't even > notice > that the MM it was using has gone away. One major complication here is that most of the active_mm borrowing is done by the idle task, but RCU does not wait for idle tasks to context switch. That means RCU, as it is today, is not a mechanism that mm_struct freeing could just piggyback off. --=20 All Rights Reversed. --=-s09L+bRyOvtccCU/oR2v Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEKR73pCCtJ5Xj3yADznnekoTE3oMFAl/I9ZgACgkQznnekoTE 3oM1Xwf7BP5sCqPmSgYX7xGoYDG/xK8xty72ALiZ2ixV5SAzOInMZX7m2nmOLZ9k 0Nu3ycKqeKKdjvuqou4W+DEuiBR0Sy8hkkrlCcrzpmTQ0fv/igXyrRChA4V5u5Ki SbE5tojr7tuCNj7O7iQF92x36A63PAVpI7k3hKxEvJtemPOYdxdxldF66nXm9/u9 1UJRMYEZHqvLJxWrSHe+NwZxcaYwGTWlnn6G69RJ5uC3leyuyFyKUdKcCLJR8c0/ nD001j/kwgtM+bkieMMCrWOEsKKCkLZGjSrZN0z/mDykDD26ITyCXrLgixXn+reJ zFtzuMl49QDCB66Xb1d9oMbFcUzlJA== =yjqa -----END PGP SIGNATURE----- --=-s09L+bRyOvtccCU/oR2v--