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=-10.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham 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 2B41CC1B0D8 for ; Mon, 14 Dec 2020 07:05:13 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DB32C225A9 for ; Mon, 14 Dec 2020 07:05:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DB32C225A9 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 577BD6B0036; Mon, 14 Dec 2020 02:05:11 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 5023F6B005C; Mon, 14 Dec 2020 02:05:11 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 416766B0068; Mon, 14 Dec 2020 02:05:11 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0056.hostedemail.com [216.40.44.56]) by kanga.kvack.org (Postfix) with ESMTP id 2916A6B0036 for ; Mon, 14 Dec 2020 02:05:11 -0500 (EST) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id D55151730869 for ; Mon, 14 Dec 2020 07:05:10 +0000 (UTC) X-FDA: 77591001180.10.sky60_360fd4527418 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin10.hostedemail.com (Postfix) with ESMTP id 9A01D16A4D4 for ; Mon, 14 Dec 2020 07:05:10 +0000 (UTC) X-HE-Tag: sky60_360fd4527418 X-Filterd-Recvd-Size: 3090 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf46.hostedemail.com (Postfix) with ESMTP for ; Mon, 14 Dec 2020 07:05:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender :Reply-To:Content-ID:Content-Description; bh=11D97b/WzRvk1qsJoszULXXa+WJR+vJxLMi5GNzHEEQ=; b=WLHgQn2cE+BA9xy+NIPDUPOgv+ 432s5Ln61W039LzswQHoMLWquHa6/jqpfuQRqVxcEmqKfCnT+hkyE2CVHUXEEwGFKO1rVcBaYcp2v VgFeeiJSLzFVu1Y1h5t/GYvGmjCuiU42tK3GgcekfVC3HgHgzpGhSjcFV539rGgs7W20DF1ny1CRM P0vKv8xRNXt7bKxZlPip3dAfRRPuGInt42pYGnkuNSaxpSLJjiVndJ7776L02vNwfaBO0N8ceXAIL BSAzbFybWkME+Cwljjsm5Gr3vyhTGhN0DfKLztgnP5ozDHK8k3ktyjeW5elwtQW+wuZdrQ1TYP64o Rn9HK7OQ==; Received: from [2601:1c0:6280:3f0::1494] by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1kohun-0005qn-Bh; Mon, 14 Dec 2020 07:05:01 +0000 Subject: Re: [PATCH v2 3/5] lazy tlb: shoot lazies, a non-refcounting lazy tlb option To: Nicholas Piggin , linux-kernel@vger.kernel.org Cc: linux-arch@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org, Anton Blanchard , Andy Lutomirski References: <20201214065312.270062-1-npiggin@gmail.com> <20201214065312.270062-4-npiggin@gmail.com> From: Randy Dunlap Message-ID: Date: Sun, 13 Dec 2020 23:04:55 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: <20201214065312.270062-4-npiggin@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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 12/13/20 10:53 PM, Nicholas Piggin wrote: > diff --git a/arch/Kconfig b/arch/Kconfig > index 84faaba66364..e69c974369cc 100644 > --- a/arch/Kconfig > +++ b/arch/Kconfig > @@ -443,9 +443,22 @@ config MMU_LAZY_TLB > config MMU_LAZY_TLB_REFCOUNT > def_bool y > depends on MMU_LAZY_TLB > + depends on !MMU_LAZY_TLB_SHOOTDOWN > help > - This must be enabled if MMU_LAZY_TLB is enabled until the next > - patch. > + This refcounts the mm that is used as the lazy TLB mm when switching > + switching to a kernel thread. duplicate "switching". > + > +config MMU_LAZY_TLB_SHOOTDOWN > + bool > + depends on MMU_LAZY_TLB > + help > + Instead of refcounting the "lazy tlb" mm struct, which can cause > + contention with multi-threaded apps on large multiprocessor systems, > + this option causes __mmdrop to IPI all CPUs in the mm_cpumask and > + switch to init_mm if they were using the to-be-freed mm as the lazy > + tlb. To implement this, architectures must use _lazy_tlb variants of > + mm refcounting, and mm_cpumask must include at least all possible > + CPUs in which mm might be lazy. > > config ARCH_HAVE_NMI_SAFE_CMPXCHG > bool --