Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp999698pxu; Wed, 2 Dec 2020 08:34:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJxAfQdfsgcLdBYzkXbP9SWAz5GCeYuf3fNAMR8EpoXbA11xehqzHGVeHk2nGXlWux6VvOqb X-Received: by 2002:a50:d757:: with SMTP id i23mr752272edj.116.1606926865934; Wed, 02 Dec 2020 08:34:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606926865; cv=none; d=google.com; s=arc-20160816; b=e96j+t20tHkJxnsPG5pq7+Oo8YpVblT2Vqni34yWmVxyL5tVHAHZKbgYzhYcO6gvWD NGqBDMJf+sAWjsaOXkSWyeQkiVwSlDNy5A3VUUT+YhKDN6K4PsM+Qy6wiLvojQy5KSne weE3A+qjiMfAvPBJWBuq77igXc/q0JS8eeQAEnxhlKaNq76+eSbgNwTZxkzVO0Lvh6JQ 85RKDVcU6D96MfSULMHWalkb/CxWEG9JOBL5y0N21J9Sd3LrnhEj6uxeWJmjCgso146l ywd7jKCSvkghd0onQytJ2ME38pJvLNICRXGd1HVHyoOKATRClywSitdofJE8/FR9klSp bLJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=GlOw3b7M/4i8hX4WqqCNrb13MBql3ucRIPQK5dDn1/s=; b=yZzgeFdyZuQwfJToVVKAeUFrhVkG6rg70iOZl3RKwpE/O6YYbG+c0WkVWybqCkY3xv zRlp3umpNM9ZuA/MlgBzaYWDRDLJ1M68GbhlhELFOwYBxfskkcg6A559Iif93nxepztd 5iHH3zgEqxnhPq4qzUsTZjiAWsiyio3z5g33G7c6VQTRp9xNcKPPgpGku0tOZLz2tI7v Ks4zO0PZqYuJVOaoF8xBxekWdgTgUZzfCy7CHMzPl3yPDMRn+YP2SMhbbSYi+otuoODW SPCIGcp1MKgIpB+e8+YA0htpaaoAFzYPLGzhMm+NGa07sH8jyPKz4Gt5bZtFU6hT3bLe 8sKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=merlin.20170209 header.b=nMLwDQ5G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r20si242062edq.561.2020.12.02.08.34.02; Wed, 02 Dec 2020 08:34:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=merlin.20170209 header.b=nMLwDQ5G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389138AbgLBQbJ (ORCPT + 99 others); Wed, 2 Dec 2020 11:31:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389126AbgLBQbI (ORCPT ); Wed, 2 Dec 2020 11:31:08 -0500 Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B35FC0613D4; Wed, 2 Dec 2020 08:29:59 -0800 (PST) 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 Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 02, 2020 at 06:38:12AM -0800, Andy Lutomirski wrote: > > > On Dec 2, 2020, at 6:20 AM, Peter Zijlstra wrote: > > > > On Sun, Nov 29, 2020 at 02:01:39AM +1000, Nicholas Piggin wrote: > >> + * - A delayed freeing and RCU-like quiescing sequence based on > >> + * mm switching to avoid IPIs completely. > > > > That one's interesting too. so basically you want to count switch_mm() > > invocations on each CPU. Then, periodically snapshot the counter on each > > CPU, and when they've all changed, increment a global counter. > > > > Then, you snapshot the global counter and wait for it to increment > > (twice I think, the first increment might already be in progress). > > > > The only question here is what should drive this machinery.. the tick > > probably. > > > > This shouldn't be too hard to do I think. > > > > Something a little like so perhaps? > > I don’t think this will work. A CPU can go idle with lazy mm and 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... :/