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.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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 9CE20C64E7C for ; Wed, 2 Dec 2020 16:29:54 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E99822065C for ; Wed, 2 Dec 2020 16:29:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E99822065C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 285CF8D0003; Wed, 2 Dec 2020 11:29:53 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 237618D0002; Wed, 2 Dec 2020 11:29:53 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 14DEE8D0003; Wed, 2 Dec 2020 11:29:53 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0024.hostedemail.com [216.40.44.24]) by kanga.kvack.org (Postfix) with ESMTP id F25318D0002 for ; Wed, 2 Dec 2020 11:29:52 -0500 (EST) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id AF4F6180AD806 for ; Wed, 2 Dec 2020 16:29:52 +0000 (UTC) X-FDA: 77548878624.26.fifth66_410d233273b4 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin26.hostedemail.com (Postfix) with ESMTP id 79F4C1804B656 for ; Wed, 2 Dec 2020 16:29:52 +0000 (UTC) X-HE-Tag: fifth66_410d233273b4 X-Filterd-Recvd-Size: 3734 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by imf10.hostedemail.com (Postfix) with ESMTP for ; Wed, 2 Dec 2020 16:29:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description; bh=GlOw3b7M/4i8hX4WqqCNrb13MBql3ucRIPQK5dDn1/s=; b=nMLwDQ5GVq0wfCdJBRBFD4WitS hcPd9A53uhlZQMAVq1dXH6tjQcVY6pI21qKQvKHspz/qVnC0v0XcnYlTplV5CSHAaGLL0EPAif2xm 3wnzYMGe0wFR8V+k3GX8BiwFRZQnUZu9actZuVGxAFG6LzR891aaFQj8PfjXuTVLZGYN3iQA5K+ZX BTvarfmDZ0EPpGuqWfwcKZfa1ZgoNpKIVj8SJmXRh0w71G9MT6ycw9dx/Q1JAFLnYwNyZ51OGDkke x2Z9mhY06HCkOxWH7QAJTMsy4heBYrcud3ETkLY7/nyqkvJmO9sQmplh/HPQnnNcRnMTnewrA12w8 MujyVPTg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1kkV0h-0004AB-Dg; Wed, 02 Dec 2020 16:29:43 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 96BE13035D4; Wed, 2 Dec 2020 17:29:41 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 73661201F097E; Wed, 2 Dec 2020 17:29:41 +0100 (CET) Date: Wed, 2 Dec 2020 17:29:41 +0100 From: Peter Zijlstra To: Andy Lutomirski Cc: Nicholas Piggin , linux-kernel@vger.kernel.org, x86@kernel.org, Mathieu Desnoyers , Arnd Bergmann , linux-arch@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org, Anton Blanchard Subject: Re: [PATCH 6/8] lazy tlb: shoot lazies, a non-refcounting lazy tlb option Message-ID: <20201202162941.GB2414@hirez.programming.kicks-ass.net> References: <20201202141957.GJ3021@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Content-Transfer-Encoding: quoted-printable 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: On Wed, Dec 02, 2020 at 06:38:12AM -0800, Andy Lutomirski wrote: >=20 > > On Dec 2, 2020, at 6:20 AM, Peter Zijlstra wro= te: > >=20 > > =EF=BB=BFOn Sun, Nov 29, 2020 at 02:01:39AM +1000, Nicholas Piggin wr= ote: > >> + * - A delayed freeing and RCU-like quiescing sequence base= d on > >> + * mm switching to avoid IPIs completely. > >=20 > > That one's interesting too. so basically you want to count switch_mm(= ) > > invocations on each CPU. Then, periodically snapshot the counter on e= ach > > CPU, and when they've all changed, increment a global counter. > >=20 > > Then, you snapshot the global counter and wait for it to increment > > (twice I think, the first increment might already be in progress). > >=20 > > The only question here is what should drive this machinery.. the tick > > probably. > >=20 > > This shouldn't be too hard to do I think. > >=20 > > Something a little like so perhaps? >=20 > I don=E2=80=99t think this will work. A CPU can go idle with lazy mm a= nd nohz > forever. This could lead to unbounded memory use on a lightly loaded > system. Hurm.. quite so indeed. Fixing that seems to end up with requiring that other proposal, such that we can tell which CPU has what active_mm stuck. Also, more complicated... :/