From patchwork Fri Jul 26 15:07:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 13742873 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AEFB1C3DA4A for ; Fri, 26 Jul 2024 15:08:08 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.765455.1176036 (Exim 4.92) (envelope-from ) id 1sXMXz-0008UA-Ho; Fri, 26 Jul 2024 15:07:55 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 765455.1176036; Fri, 26 Jul 2024 15:07:55 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sXMXz-0008U3-FI; Fri, 26 Jul 2024 15:07:55 +0000 Received: by outflank-mailman (input) for mailman id 765455; Fri, 26 Jul 2024 15:07:54 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sXMXy-0008Tx-Of for xen-devel@lists.xenproject.org; Fri, 26 Jul 2024 15:07:54 +0000 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id d458a013-4b60-11ef-bbff-fd08da9f4363; Fri, 26 Jul 2024 17:07:53 +0200 (CEST) Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-260-uU9eNeBmOBmxsbHiNspYkQ-1; Fri, 26 Jul 2024 11:07:47 -0400 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 396AC1955D4D; Fri, 26 Jul 2024 15:07:42 +0000 (UTC) Received: from t14s.redhat.com (unknown [10.39.193.153]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id AF9BB1955D45; Fri, 26 Jul 2024 15:07:31 +0000 (UTC) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: d458a013-4b60-11ef-bbff-fd08da9f4363 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1722006472; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=hcrSbRRNq3UgkpcRSzhVfFxj5WTgmNA01IUpGR6Hr34=; b=XRacDgs/Mzs2TRDlJQVyC6a336xwSil5aqS5yuXTP8IVRDDjK1CGK+fzRS2R9garMIlqId Ftt8/bEmY7kyYiLWHzzLMACB1LAHJe4oFhkYhHpbgkVeNl3BiHMrGx38tBiFL545r38ZM1 Rg0QMMalGMXndwZxIiq5YWPQeaE2AdE= X-MC-Unique: uU9eNeBmOBmxsbHiNspYkQ-1 From: David Hildenbrand To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, x86@kernel.org, linuxppc-dev@lists.ozlabs.org, xen-devel@lists.xenproject.org, linux-fsdevel@vger.kernel.org, David Hildenbrand , Andrew Morton , Oscar Salvador , Peter Xu , Muchun Song , Russell King , Michael Ellerman , Nicholas Piggin , Christophe Leroy , "Naveen N. Rao" , Juergen Gross , Boris Ostrovsky , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Alexander Viro , Christian Brauner Subject: [PATCH v1 0/3] mm: split PTE/PMD PT table Kconfig cleanups+clarifications Date: Fri, 26 Jul 2024 17:07:25 +0200 Message-ID: <20240726150728.3159964-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 This series is a follow up to the fixes: "[PATCH v1 0/2] mm/hugetlb: fix hugetlb vs. core-mm PT locking" When working on the fixes, I wondered why 8xx is fine (-> never uses split PT locks) and how PT locking even works properly with PMD page table sharing (-> always requires split PMD PT locks). Let's improve the split PT lock detection, make hugetlb properly depend on it and make 8xx bail out if it would ever get enabled by accident. As an alternative to patch #3 we could extend the Kconfig SPLIT_PTE_PTLOCKS option from patch #2 -- but enforcing it closer to the code that actually implements it feels a bit nicer for documentation purposes, and there is no need to actually disable it because it should always be disabled (!SMP). Did a bunch of cross-compilations to make sure that split PTE/PMD PT locks are still getting used where we would expect them. [1] https://lkml.kernel.org/r/20240725183955.2268884-1-david@redhat.com Cc: Andrew Morton Cc: Oscar Salvador Cc: Peter Xu Cc: Muchun Song Cc: Russell King Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Christophe Leroy Cc: "Naveen N. Rao" Cc: Juergen Gross Cc: Boris Ostrovsky Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen Cc: "H. Peter Anvin" Cc: Alexander Viro Cc: Christian Brauner David Hildenbrand (3): mm: turn USE_SPLIT_PTE_PTLOCKS / USE_SPLIT_PTE_PTLOCKS into Kconfig options mm/hugetlb: enforce that PMD PT sharing has split PMD PT locks powerpc/8xx: document and enforce that split PT locks are not used arch/arm/mm/fault-armv.c | 6 +++--- arch/powerpc/mm/pgtable.c | 6 ++++++ arch/x86/xen/mmu_pv.c | 7 ++++--- fs/Kconfig | 4 ++++ include/linux/hugetlb.h | 5 ++--- include/linux/mm.h | 8 ++++---- include/linux/mm_types.h | 2 +- include/linux/mm_types_task.h | 3 --- kernel/fork.c | 4 ++-- mm/Kconfig | 18 +++++++++++------- mm/hugetlb.c | 8 ++++---- mm/memory.c | 2 +- 12 files changed, 42 insertions(+), 31 deletions(-)