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: 13742869 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 22B81C3DA49 for ; Fri, 26 Jul 2024 15:07:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7FE506B0098; Fri, 26 Jul 2024 11:07:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7AE8D6B009A; Fri, 26 Jul 2024 11:07:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 64E546B009C; Fri, 26 Jul 2024 11:07:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 485FE6B0098 for ; Fri, 26 Jul 2024 11:07:55 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id B8CC5A17F4 for ; Fri, 26 Jul 2024 15:07:54 +0000 (UTC) X-FDA: 82382233668.16.3C10397 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf02.hostedemail.com (Postfix) with ESMTP id 13A6D80003 for ; Fri, 26 Jul 2024 15:07:51 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=a18ah69M; spf=pass (imf02.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1722006405; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=hcrSbRRNq3UgkpcRSzhVfFxj5WTgmNA01IUpGR6Hr34=; b=JLRwQf/ZZl06WF5BLeDO7Ijr0lQNXi69sRm+OqEVuV/M6tCrbGEADoOU/sVGu/57OCAo5E pEP+KCSfnTBa2N8V/mi/7eX97TalwtxQvXB4KiE+Tl1tCAiGgz6R7520gl51wD/l9/TSI8 qrzG7dnM4B5MoFfoTTu8fN1snh9jxMU= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=a18ah69M; spf=pass (imf02.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1722006405; a=rsa-sha256; cv=none; b=60jprhpx4sKjbXCK+dpqEZB3wIQ+q0Am953pqDvIov9aJHAxQWZGGMYmhgz6QeMERThJdK anEdVTHtQx39JE2299kLGh7wqdagE872LWXDbfoxuIiwG3TtVTFHIuEUau9LKaY5KIFliE 7fr0kt8CTougcGqVLovcA6ElCEoGDk4= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1722006471; 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=a18ah69MSKeoJob364woeg3M6A+Jehvm/+HMD4m0na7XskwyF40hvR8EZMK8JZm5sezpTM +tVkMSSGaAAIqeMU/1rGWbGWYw981vc2/18A24BW7KM9GaX5rAbAboPvzmguLwif0H/r/P CzPGb7SUeSXP1n7tzBizjnRzrYIJ1yY= 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 X-MC-Unique: uU9eNeBmOBmxsbHiNspYkQ-1 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) 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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Q3lfEcGkojR7BATFfmVcFTFYt5CNAOKJ9KAqi777zz 0Fl+29SH DnNFQvXpoIgyEUCHYP05tXzZD6Gpk6lKem9d9X5Hf4ibSDYhN9rf3yz10Q9glhZ1UM8x+P00jIQ35Ybx9ZJvKb1uYzz0f/LmI9v/CUNcgtBLNJ8RcNTHv/NDrN8nOLdFCmQnB2LtfnwkamScPT5WG5KhcGvr8crD4MWlmoRNA1gFfvaoAljOF1eowh1HlJUAN93YQTqlDxb2Lbq5wXJyddYWwS7hNZ/BywkZrR1na5n5Z2xWrXVVcIyQVm1AD/5FLp8eoUnz6jdNnc9TPk9GPPtnlGu0ygNNcYmEFY5H5xua/hkFK9JUirjcGAI/ORtDOVuvlrZxc2DCYmhzgal9uY28Kq0X3QGEBuJNrF6jMlszKbaBDsjSVRhW0dcpfxGWND5zPtmizOxaD5KNPsiMuFEEMoLhXjSDQe1filQZqcPavptLTqGzGkUrBsYvtaOXg2r1rGpid3RQ7hJ/j9hz7dhz6FyUtoCkJlQ3lOfpvJH72yDOuxxKpEtm4jOVUl7NxSn4LVb5J8kaJr/Ar/sUVRf73BDPUeL4RvenEu1F9uwAsl7XGpKpXnGl2pQADPt9AUE1NMgnipTuiypkYlfyT/gLsKC5aj/jgwkkDLfV2263SZT0r6w0GVIpOUFYrfec8YEiAgC0yDMrmSO6yOrkjrHxslmLAvkLc/54w526lyJ6Y3EuzjV0+VnUzZyDjcC3iAumtDya8I3RyAVmfly0kl5oAeg== 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: List-Subscribe: List-Unsubscribe: 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(-)