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.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 6D033C5519F for ; Mon, 30 Nov 2020 09:26:41 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9865C207BC for ; Mon, 30 Nov 2020 09:26:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="gPDAemu8" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9865C207BC 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 22EE36B005D; Mon, 30 Nov 2020 04:26:40 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1E0618D0002; Mon, 30 Nov 2020 04:26:40 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0F6CD8D0001; Mon, 30 Nov 2020 04:26:40 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0165.hostedemail.com [216.40.44.165]) by kanga.kvack.org (Postfix) with ESMTP id EE91C6B005D for ; Mon, 30 Nov 2020 04:26:39 -0500 (EST) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id B5B508249980 for ; Mon, 30 Nov 2020 09:26:39 +0000 (UTC) X-FDA: 77540554518.01.lock87_5c03f5d273a0 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin01.hostedemail.com (Postfix) with ESMTP id 977B910045BE6 for ; Mon, 30 Nov 2020 09:26:39 +0000 (UTC) X-HE-Tag: lock87_5c03f5d273a0 X-Filterd-Recvd-Size: 3258 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by imf04.hostedemail.com (Postfix) with ESMTP for ; Mon, 30 Nov 2020 09:26:37 +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-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=aCfkGM0vlzXViK81UTEMgfauupgXmRJw3cav7RA9s0E=; b=gPDAemu81O47vOcuWY7I29THXg nt+YeRVZDtqqPty2L/qNFCh1BXnXk3Dv7qDJwyEEgVb4dK0GxUXPgcAl8NI/6mp9emA9xbKp47l9S Z7Ta23ItKhhlkoOviUnMz2mSEMonmx4Oqc4mal+jvAyXLWU0+aVTvGDOmelPJgvI+OD1anH7/HsfL DJWmoiB7pzkyBM45X1RNHYTOPY0QzuSQ2cnM37FR83FpEC9FGwdnNBjiK+sYJ2YlUd9Y5wulyKbiZ tXMZ4bNYyY91+m9jhDQwd8fysDaCrorLLb/VGndWhaXGf6ND5jk9XmBHpvJkAGSbmr7ow1twPDl/m ypseg8Sw==; 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 1kjfS3-00085i-54; Mon, 30 Nov 2020 09:26:31 +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 78D48301179; Mon, 30 Nov 2020 10:26:28 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 5AE9B2B2690EC; Mon, 30 Nov 2020 10:26:28 +0100 (CET) Date: Mon, 30 Nov 2020 10:26:28 +0100 From: Peter Zijlstra To: Andy Lutomirski Cc: Nicholas Piggin , LKML , X86 ML , Mathieu Desnoyers , Arnd Bergmann , linux-arch , linuxppc-dev , Linux-MM , Anton Blanchard Subject: Re: [PATCH 6/8] lazy tlb: shoot lazies, a non-refcounting lazy tlb option Message-ID: <20201130092628.GL2414@hirez.programming.kicks-ass.net> References: <20201128160141.1003903-1-npiggin@gmail.com> <20201128160141.1003903-7-npiggin@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Sat, Nov 28, 2020 at 07:54:57PM -0800, Andy Lutomirski wrote: > Version (b) seems fairly straightforward to implement -- add RCU > protection and a atomic_t special_ref_cleared (initially 0) to struct > mm_struct itself. After anyone clears a bit to mm_cpumask (which is > already a barrier), No it isn't. clear_bit() implies no barrier what so ever. That's x86 you're thinking about. > they read mm_users. If it's zero, then they scan > mm_cpumask and see if it's empty. If it is, they atomically swap > special_ref_cleared to 1. If it was zero before the swap, they do > mmdrop(). I can imagine some tweaks that could make this a big > faster, at least in the limit of a huge number of CPUs.