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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id CCF47C54E5D for ; Tue, 12 Mar 2024 20:01:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3267B6B029D; Tue, 12 Mar 2024 16:01:24 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 260AD6B029F; Tue, 12 Mar 2024 16:01:24 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0DB356B029E; Tue, 12 Mar 2024 16:01:24 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id EBEAA6B02B1 for ; Tue, 12 Mar 2024 16:01:23 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 6F761120B00 for ; Tue, 12 Mar 2024 20:01:23 +0000 (UTC) X-FDA: 81889456446.06.F0164C1 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf06.hostedemail.com (Postfix) with ESMTP id 27F2F18001E for ; Tue, 12 Mar 2024 20:01:20 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Ssdzl1tc; spf=pass (imf06.hostedemail.com: domain of peterx@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=peterx@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=1710273681; 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-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=sq8Q7APw4DcVkqWc+oejv1fuFkz+jT1GPn/e6E4W0Yk=; b=g5j5OoWoVpQHCThxVpdTibKE+C616akgOjg8irL/dqjEExpV9XllV+Mnx/o6/GdTtW5gxe Wz8taxgtyo+dxyW8J72KMvJLlLbzoUSiuSCfj/1tnAyN+vmwWcuD0rk/NEyziXP3fG03wE Uz00GMPmgivyCg0L4rMZWYLjWdGtQIA= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1710273681; a=rsa-sha256; cv=none; b=ogYBNEYcF8TdivqN/rV22/LyDHbyypuP3h7q7k/GkRo398zQ2JjFhEv1xmGMJrhrnP5C5u XuqityEzUJ3c/hkrg0ntxnUfTbD8TW15uKocRl+kFmdkkm5G9shzg4tYNR3zm1Ti0X2Ux+ 2iINXCGxxCXOLKX/F1a4NETIWiEImZI= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Ssdzl1tc; spf=pass (imf06.hostedemail.com: domain of peterx@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1710273680; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=sq8Q7APw4DcVkqWc+oejv1fuFkz+jT1GPn/e6E4W0Yk=; b=Ssdzl1tcJyX3A5Ni+bh5+qjHz6HBHNM5e1zo3guh50e8sMRROo6pMGe0W7hb4lVouv/L7Q oaR3ZJRPvVvHS3CWjWMJXlTSldoW7PWoi0MzCRufktfh/mQvA8OkqN/AANS0tm6S3sRl4Y c18n03dEieLWj6cYsGVc1YpXN4J59ao= Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-596-5RC_leWgOB-W5o8Lhy5K6w-1; Tue, 12 Mar 2024 16:01:18 -0400 X-MC-Unique: 5RC_leWgOB-W5o8Lhy5K6w-1 Received: by mail-qt1-f198.google.com with SMTP id d75a77b69052e-42ed8fb8ce0so5362881cf.1 for ; Tue, 12 Mar 2024 13:01:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710273677; x=1710878477; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=sq8Q7APw4DcVkqWc+oejv1fuFkz+jT1GPn/e6E4W0Yk=; b=syqovKzIbcBip5NUr8nZ7TjMESK1hN4oShNBkSJL8zyNoihXdQcFJVXs25JXqFci3b ldG8yLa7W/xo7qn18bWnTRpL7IxYeGdRc5/lAgMjR5SXSaTs22EM+PTICZqOIv8TxMxY 1XVjcSv/6x9hh7c2QLj3GeOKZTGCs/wcELLc7yhX4QHWds1RtbphVlpxafDjAIwFYl4R 72+dWuVvn6gbCSRSGDk+i32RYhsAjKZ60vK6P4fdJQfH0UqSlmFGn88K427UBTAiJhjK mWjVhZygy3ldv9zkTKK1Me5b3fhFe7eZe4wDlYrKjCpA95vqWhmxcCT5XgW/+b9VqZU8 rIAw== X-Gm-Message-State: AOJu0YzQi5HtZi1sSu1tzw28+MVv9K/p81wuXZOXy8TBlCs3Jx2jZazj hbIOkiFBpFMzrWPTudaWpbqzS504dpC/ge4Og8RgRNtNAu0UjXJF3P/QmN2s3ItaftRlpJHVDcn nJ68//iyqwpHdboGGoXsPz1Y66OxvaZSk26Z1J0mI4AFG1F2D X-Received: by 2002:a05:620a:2715:b0:788:79d3:402e with SMTP id b21-20020a05620a271500b0078879d3402emr3492043qkp.7.1710273677507; Tue, 12 Mar 2024 13:01:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGFci8LJ7emFKeNaMhqM4be32i5qK2b8ngNE0xIpit/UyC+7KzN+KAk6ieS3wmiUOL3/zXkrQ== X-Received: by 2002:a05:620a:2715:b0:788:79d3:402e with SMTP id b21-20020a05620a271500b0078879d3402emr3492030qkp.7.1710273677131; Tue, 12 Mar 2024 13:01:17 -0700 (PDT) Received: from x1n (cpe688f2e2cb7c3-cm688f2e2cb7c0.cpe.net.cable.rogers.com. [99.254.121.117]) by smtp.gmail.com with ESMTPSA id f18-20020a05620a12f200b007882915ca34sm3977850qkl.40.2024.03.12.13.01.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 13:01:16 -0700 (PDT) Date: Tue, 12 Mar 2024 16:01:14 -0400 From: Peter Xu To: Christophe Leroy Cc: "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , "linuxppc-dev@lists.ozlabs.org" , Andrew Morton , Muchun Song , Jason Gunthorpe , Matthew Wilcox , Mike Rapoport , "x86@kernel.org" , "sparclinux@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" Subject: Re: [PATCH RFC 00/13] mm/treewide: Remove pXd_huge() API Message-ID: References: <20240306104147.193052-1-peterx@redhat.com> MIME-Version: 1.0 In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-Rspamd-Queue-Id: 27F2F18001E X-Rspam-User: X-Stat-Signature: 8uympfraanizrak1gcui3nf3bgmha98d X-Rspamd-Server: rspam03 X-HE-Tag: 1710273680-310381 X-HE-Meta: U2FsdGVkX184R4bJOR/viTb5RiT5/0UdE2Q9em8PLnZpY12kvKz6UxUKf0CvQRCX7gZEut9Ny5kl88agUR3aHdZghA6c8/qXnEqsZupeXPSovHJFVt6v5rNA1kLS+WQErXGsyeP7pB4YnyVZT2Kzkw9o+uHlmWLvwSk8ZX12KWU7fcP0745l/dbwfq7dCyDWaFJpRRbGtn1RyVOHQncg+pXYtAsaMtLyzeOz004VbB0k/+gDguLQ85b01BeBzW577MhU5Ts39oS+7Htn6AWhhuOVjoGeG/8hx+Pq5AXjSislNaAsl+yeiH2VoTAOiabpPytC9t75OoftQV+pPC06zyeSCOp362luwHOGkCRrbrXHLr2OSmsYKHMhISeo5F73LzWTISppbSV9PSoKtiZljnJRfO39JEvEkw2PyJTKkJr3bqvFJKyJ/oa6EV7UXkstBqTgJTIuLDFZpvIn92im2/Wk397ihCAJ6J8e59CMIjUUFxuFc6V+0dmPpumceajT0psZ1zsAJkbyvt4U7qEP6B3GlzalB66DsEN12xtlqgZ2Jv4t3xxWZrAg1GiDqnt/vQzb1le7TwFhHtYVsXEedK797Leocjc1BA4ixdz69G+FspXBy2m3bRiLDDxH10pVEcgLYW+ogw9fu68oDJ7O6cWuwLnRPgLyDk1v1RK95nCNIqnvzOfzK3gJTWyLOBbYhlVkzVrwkexS1AYC994nakSA5dvbfHeikX6V+keQyTcTReOmkPB3oE/Qcwqp1HwNDhhXhdhzvwxygs8pyzquGbLWQXzG0s0/7SpPfHM2ORdj25qYL53epnNyQFzNNbfwCqt5aSt27Li1x3gNxD5s1ubkgcchur/n2T+XH65z+ycqGFx8S1kgvCyECcwFczogn/E+lND7Q1Pc2ilGml+NwgV1yH/o2wRgtJGJoeTKBSIxDZf4AIPUVnTDgpgDqLcCYvpDv+Mcb+feECGynWa BpCz+tBX HDN1/C6XaV5xUte8Xeu5DyYumcw83PP4/bJiLnjtjxY3Q2nU3siUKpCKrGeUNJk7byiaaFN5e2q0ReG+/ug81w34Bv/5vcMxMLSXVhXCAjcrFq08lKM2AHNlw6MEqSGLLHmYGCv5q4PEBPp7TjefLGR8kGCL3P/5Gn9KNSfddGr29VlQTvE4DoM5jzg== 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: Hi, Christophe, On Mon, Mar 11, 2024 at 09:58:47AM +0000, Christophe Leroy wrote: > Hi Peter, and nice job you are doing in cleaning up things around _huge > stuff. Thanks. I appreciate your help along the way on Power. > > One thing that might be worth looking at also at some point is the mess > around pmd_clear_huge() and pud_clear_huge(). > > I tried to clean things up with commit c742199a014d ("mm/pgtable: add > stubs for {pmd/pub}_{set/clear}_huge") but it was reverted because of > arm64 by commit d8a719059b9d ("Revert "mm/pgtable: add stubs for > {pmd/pub}_{set/clear}_huge"") > > So now powerpc/8xx has to implement pmd_clear_huge() and > pud_clear_huge() allthough 8xx page hierarchy only has 2 levels. Those are so far out of my radar, as my focus right now is still more on hugetlbfs relevant side of things, while kernel mappings are not yet directly involved in hugetlbfs, even though they're still huge mappings. It's a pity to know that broke arm and got reverted, as that looks like a good thing to clean it up if ever possible. I tend to agree with you that it seems for 3lvl we should define pgd_huge*() instead of pud_huge*(), so that it looks like the only way to provide such a treewide clean API is to properly define those APIs for aarch64, and define different pud helpers for either 3/4 levels. But I confess I don't think I fully digested all the bits. Thanks, -- Peter Xu