From patchwork Sat Jun 5 01:42:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 12301123 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=-8.5 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT 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 7A432C47082 for ; Sat, 5 Jun 2021 04:34:00 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id F16306141B for ; Sat, 5 Jun 2021 04:33:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F16306141B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 642666B0036; Sat, 5 Jun 2021 00:33:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 619DE6B006C; Sat, 5 Jun 2021 00:33:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4BB2C6B006E; Sat, 5 Jun 2021 00:33:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0192.hostedemail.com [216.40.44.192]) by kanga.kvack.org (Postfix) with ESMTP id 1B4516B0036 for ; Sat, 5 Jun 2021 00:33:59 -0400 (EDT) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id B09DC8248047 for ; Sat, 5 Jun 2021 04:33:58 +0000 (UTC) X-FDA: 78218402556.17.628C73D Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) by imf11.hostedemail.com (Postfix) with ESMTP id 463922001100 for ; Sat, 5 Jun 2021 04:33:58 +0000 (UTC) Received: by mail-pf1-f177.google.com with SMTP id d16so8859624pfn.12 for ; Fri, 04 Jun 2021 21:33:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=HN/yxlFRhCXI2lz6pRuRsVES8dA6IrWBhzB/BkiqJsM=; b=N0fg6MCuH9s4HsYj1nxf2+QZ+2ZtLPsunpN49Xp5z9VUsR5/shhK52a/meE/srVFid ft3AwOKvuTu/Ow2IgqFiVkW+hUu4T7Ionoz8cv1WWEoa5akwrzvX7R5m2v5rgExT+PF/ 80Sawjo8WzzUNSO196wSDIAJeVG//SnGL/MQYgOknM38h4n7joShRzKzbxANFS1n4ErI 0waMLNoO0AdM0p+GbsvLSeQQaM3zAG+RNT/VsygJupHzRbiVdrvw3HkJXTiRWHSSZE2N SYuLVx7C6U51dFDBdLP7UeYGg5fDNixmKSsgJtcyUcv3cfd2uaIt1Nmq+H0oB3m4TYVt wCMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=HN/yxlFRhCXI2lz6pRuRsVES8dA6IrWBhzB/BkiqJsM=; b=Nf6BuM1aKzbOp2f6q8pxle1Lb1iK+kHhlSYFhiog9Ae5yP9BDvQdgP0rsNymzDaePq TkIwe9RQKclqceHO0Tm+sFo8U+gPI8/iEtmlISRNrDsmUuGt9WF5N/6rMUboqqXOk3cD UToK0P97Vgbzxv0cjFO0q2DcZnYmOnqCVf9CjgmNOD/9242MlHjJcrxeNzQtH30Rfz4J DFsiMDcgfAoPnT+TVH7sRmn69z017N+2uPDOQ6p4Yo0YSTyV86itzW7+GRW7hEC2a0Fu NV2ZER1YA+mbw9M4ZqqHjw1j1GLCnTG2q/HL9wdJMNrLX9BaUlGlYRnWXHqdPgZjvR97 Wfaw== X-Gm-Message-State: AOAM531ABBTuvbatCWlNVR/MFCRyhNMs0cj8Es317Ic9DEtKP7zT0D8e 7fSnW6HmoeLA/0u0/VPZ8TR3hQgUBgU= X-Google-Smtp-Source: ABdhPJzIPBaIsLM9CINwZgXyOGPdZc74cQHpiU2KKEGygcnKSh9Gm9bVFr7pTSjQUx6UdhKyvKVXDg== X-Received: by 2002:a17:902:eccb:b029:106:def0:2717 with SMTP id a11-20020a170902eccbb0290106def02717mr7216193plh.66.1622857346021; Fri, 04 Jun 2021 18:42:26 -0700 (PDT) Received: from bobo.ozlabs.ibm.com (60-242-147-73.tpgi.com.au. [60.242.147.73]) by smtp.gmail.com with ESMTPSA id q68sm5779056pjq.45.2021.06.04.18.42.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Jun 2021 18:42:25 -0700 (PDT) From: Nicholas Piggin To: Andrew Morton Cc: Nicholas Piggin , Randy Dunlap , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org, Anton Blanchard , Andy Lutomirski Subject: [PATCH v4 0/4] shoot lazy tlbs Date: Sat, 5 Jun 2021 11:42:12 +1000 Message-Id: <20210605014216.446867-1-npiggin@gmail.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=N0fg6MCu; spf=pass (imf11.hostedemail.com: domain of npiggin@gmail.com designates 209.85.210.177 as permitted sender) smtp.mailfrom=npiggin@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Stat-Signature: oygd3jxcbnzz9bdr45dy6ofpb1z6pemh X-Rspamd-Queue-Id: 463922001100 X-Rspamd-Server: rspam01 X-HE-Tag: 1622867638-91484 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: The additional unused config option was a valid criticism, so this now purely just toggles refcounting of the lazy tlb mm. Thanks, Nick Since v3: - Removed the extra config option, MMU_LAZY_TLB=n. This can be resurrected if an arch wants it. Nicholas Piggin (4): lazy tlb: introduce lazy mm refcount helper functions lazy tlb: allow lazy tlb mm refcounting to be configurable lazy tlb: shoot lazies, a non-refcounting lazy tlb option powerpc/64s: enable MMU_LAZY_TLB_SHOOTDOWN arch/Kconfig | 17 ++++++++++ arch/arm/mach-rpc/ecard.c | 2 +- arch/powerpc/Kconfig | 1 + arch/powerpc/kernel/smp.c | 2 +- arch/powerpc/mm/book3s64/radix_tlb.c | 4 +-- fs/exec.c | 4 +-- include/linux/sched/mm.h | 20 +++++++++++ kernel/cpu.c | 2 +- kernel/exit.c | 2 +- kernel/fork.c | 51 ++++++++++++++++++++++++++++ kernel/kthread.c | 11 +++--- kernel/sched/core.c | 35 +++++++++++++------ kernel/sched/sched.h | 4 ++- 13 files changed, 132 insertions(+), 23 deletions(-)