From patchwork Wed Jun 16 03:21:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Lutomirski X-Patchwork-Id: 12323803 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=-11.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 E8DF0C48BDF for ; Wed, 16 Jun 2021 03:21:18 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5D358613BF for ; Wed, 16 Jun 2021 03:21:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5D358613BF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 9BAAD6B006C; Tue, 15 Jun 2021 23:21:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 991896B006E; Tue, 15 Jun 2021 23:21:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 87FF46B0070; Tue, 15 Jun 2021 23:21:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0044.hostedemail.com [216.40.44.44]) by kanga.kvack.org (Postfix) with ESMTP id 58EFB6B006C for ; Tue, 15 Jun 2021 23:21:17 -0400 (EDT) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id DB288F048 for ; Wed, 16 Jun 2021 03:21:16 +0000 (UTC) X-FDA: 78258136152.23.EBB73F1 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf20.hostedemail.com (Postfix) with ESMTP id C672D371 for ; Wed, 16 Jun 2021 03:21:03 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 790A661246; Wed, 16 Jun 2021 03:21:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1623813675; bh=rOudsK9P7bMhTK2OtdWpKbEvj8MV63gh3o1URze326c=; h=From:To:Cc:Subject:Date:From; b=nwBg7NXU86tjS9hw+PrWm7ZikqKiel5aE9OxQyWP6my3RTBNdx0JBxZP1ybHFZVha DGADS6+CJMndKBo/uPWHrPN2oBys9zp8keSaitE8gY18gVL1oxe+cztsz7tFffA5U0 i6c2B4WUjd+l086Kjx81pEmqGc997WkmFXA3e3W94t/1Ut5EOfRGFFcnLSEA6W/L/P R0v65CwSLI8vzQ8yWlr1LsXD+vdzEZEyZaUXdnMfv7MjKxY6XVrO97uw8oJwkaHX20 N9AWz2jiCGJJ3DhOCZ3Tc6P/XU2HDaPjahNfW1gH72fheKST+IyGPuTDcTyUxaEM9l WBYYkH1LtDrMQ== From: Andy Lutomirski To: x86@kernel.org Cc: Dave Hansen , LKML , linux-mm@kvack.org, Andrew Morton , Andy Lutomirski Subject: [PATCH 0/8] membarrier cleanups Date: Tue, 15 Jun 2021 20:21:05 -0700 Message-Id: X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=nwBg7NXU; spf=pass (imf20.hostedemail.com: domain of luto@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=luto@kernel.org; dmarc=pass (policy=none) header.from=kernel.org X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: C672D371 X-Stat-Signature: nfkkjscucpkqa3hgq3nxmk36hq933fth X-HE-Tag: 1623813663-72810 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: membarrier() is unnecessarily tangled with the core scheduler. Clean it up. While we're at it, remove the documentation and drop the pretence that SYNC_CORE can ever be a well-defined cross-arch operation. Andy Lutomirski (8): membarrier: Document why membarrier() works x86/mm: Handle unlazying membarrier core sync in the arch code membarrier: Remove membarrier_arch_switch_mm() prototype in core code membarrier: Make the post-switch-mm barrier explicit membarrier, kthread: Use _ONCE accessors for task->mm powerpc/membarrier: Remove special barrier on mm switch membarrier: Remove arm (32) support for SYNC_CORE membarrier: Rewrite sync_core_before_usermode() and improve documentation .../membarrier-sync-core/arch-support.txt | 68 +++++------------ arch/arm/Kconfig | 1 - arch/arm64/include/asm/sync_core.h | 19 +++++ arch/powerpc/include/asm/membarrier.h | 27 ------- arch/powerpc/include/asm/sync_core.h | 14 ++++ arch/powerpc/mm/mmu_context.c | 2 - arch/x86/Kconfig | 1 - arch/x86/include/asm/sync_core.h | 7 +- arch/x86/kernel/alternative.c | 2 +- arch/x86/kernel/cpu/mce/core.c | 2 +- arch/x86/mm/tlb.c | 54 ++++++++++--- drivers/misc/sgi-gru/grufault.c | 2 +- drivers/misc/sgi-gru/gruhandles.c | 2 +- drivers/misc/sgi-gru/grukservices.c | 2 +- fs/exec.c | 2 +- include/linux/sched/mm.h | 42 +++++----- include/linux/sync_core.h | 21 ----- init/Kconfig | 3 - kernel/kthread.c | 16 +--- kernel/sched/core.c | 44 +++-------- kernel/sched/membarrier.c | 76 +++++++++++++++++-- 21 files changed, 210 insertions(+), 197 deletions(-) create mode 100644 arch/arm64/include/asm/sync_core.h delete mode 100644 arch/powerpc/include/asm/membarrier.h create mode 100644 arch/powerpc/include/asm/sync_core.h delete mode 100644 include/linux/sync_core.h