Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2659245lqz; Wed, 3 Apr 2024 05:08:55 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUtNFbewm7SfqU7uyUej5P2MHn4jnE/DrPzbIBJf2NcfP6XMAzRDIbBb5TfTpO/VXXvnCOPuYBoHew20VEr/wi2PNyfGsB6ii107zzCyg== X-Google-Smtp-Source: AGHT+IHc80qvsgMYFjK/hGyHqelBUFu25jhkHLoizNnYjjDRQEo7J6RBp9YWyCEbZBbTmWJZ7uUQ X-Received: by 2002:ad4:5c6b:0:b0:699:2d85:6437 with SMTP id i11-20020ad45c6b000000b006992d856437mr141966qvh.42.1712146135234; Wed, 03 Apr 2024 05:08:55 -0700 (PDT) Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id q10-20020a056214018a00b00698fae8027asi9509150qvr.385.2024.04.03.05.08.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 05:08:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-129704-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=nNh21PyA; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-129704-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-129704-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id E24821C23F8C for ; Wed, 3 Apr 2024 12:08:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 14C20145FF7; Wed, 3 Apr 2024 12:08:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="nNh21PyA" Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2108.outbound.protection.outlook.com [40.107.243.108]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6C32B142E75 for ; Wed, 3 Apr 2024 12:08:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.243.108 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712146127; cv=fail; b=GdH0MF07AoIQMK8+Sm8QgmdEnolo/m4rH3CzCxueXBVdLJRbX1jJNsLkBAMVtxC83R+j8wtFeocGR0yiw4TnbDbC2DRay1SVAV2kH9pI5XPgMH6oXnJ+daddhN9MqAzo3ieQ7psg+q3vqh/+i6RjCetbyoE6SgTtQIHxMkJomLg= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712146127; c=relaxed/simple; bh=ey6GObOp6GAC6yvzCP0d4BEwZGPPCiEDNvj6pwYT46I=; h=Date:From:To:Cc:Subject:Message-ID:References:Content-Type: Content-Disposition:In-Reply-To:MIME-Version; b=PP5gjG+S9MjCf/vzU2zJslaP6Kb68FJNt82W+jejC7l8TKo7eI3+AmSOfP6XEL7sN/44Ts6iLgoM5ZTcis6BD900Uh/u9dEAi+DFDI8hb/7imCWllKSEMLGwdyRWJPzhHgbhFEFq0Kb89Po09rCAWZMqgS5+JM0grh7UiBfGoo0= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=nNh21PyA; arc=fail smtp.client-ip=40.107.243.108 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Mj6dg4NgXo2koQtkxJccWHqoD9exTFAZ7XqmMBHt2j6bzxzC9Fz+7Rv5redlgK8/FObJm573nkAHJzqj2moDyw90r0Gh6xYzND8Ny1fLsHtjJK88tN3CmRlxzdlhqswuK5DNc5PLmXQ66STFixqkFdqVgENTAaRYCyTWaU+m6bMvBOxo4Ze5/aif7N74JuJTT158/VJR9yLHE67SpilOVEkza2emlx+xz7lJzwcBUqlE85fpF+312HDjoYKwqHvxi0Q7Atg6ERfkyjPmDGo1IoQ/U173p38oJzmRmmZmOmjhXtz5qY15MWrjbtOdFoNWToe/zmOJnIpu8XIBn4/RRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Y36j+coR/veq+AhDz/Y+4pEbXQYKqpMkg02kmZ1Xx7w=; b=MuUizv83Rhxn4VS4aGFUcHnpuSZ5s8NNyf27SZnbUoIPUK6a1uPchW0fNkLvc1rTBvbnpPLjWBBEqn4lGyN8Y3dfR+j+1RiSwncXEzeAkJf05NqdKRIC514YnmjxYfcklVoWr8o2GxrCEdrw9V0l+pJRnLslDRIMQe1FapX7ojNIU0sjpl8GOVth+o43U/B1TIRKKmyWbKGauZtcQW1spBQNs4Q/4pdIPOepBKiTgsx87P3j5FzC15JmYiL7yFMGop6z01U6G9TPBn83jY3s/bRav4NrrM7NeUOu+gJagu4ZKPtoZQkt2Uro3BP6g7BrXrh5lROCskvP7bvtpiROug== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Y36j+coR/veq+AhDz/Y+4pEbXQYKqpMkg02kmZ1Xx7w=; b=nNh21PyAgJxzCDOH2FGKmvSP/mLF96W2rtbne/m0oCpmtP94e9woHSJpUsOH+aemqUVMMuKDdIHs46WFpndxeR319vgq0bnSPY+S+2m1pGhI/ZTPlRwMha3SU0iUnw9SHTdzAYdAyvx0WCNQHkLaP+NSLwhwhM9kNnyazQnS5x1Tuca5sgdbM9qlKNG62RKORIx9Fa6g0lrkin+UPuHKbRZnMiVaCAnjj70H6QsINU7bnAp9KndAHHfnrzGgJOf4QETiaTfvXLdrP2owYTwc2A5OnXn3FpOFPIsa5LiQyWJWxiQMKg1RNNCaXf9juzVUBTxFraZCv3qcpVqzY/+/Bw== Received: from DM6PR12MB3849.namprd12.prod.outlook.com (2603:10b6:5:1c7::26) by DS7PR12MB8290.namprd12.prod.outlook.com (2603:10b6:8:d8::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46; Wed, 3 Apr 2024 12:08:43 +0000 Received: from DM6PR12MB3849.namprd12.prod.outlook.com ([fe80::6aec:dbca:a593:a222]) by DM6PR12MB3849.namprd12.prod.outlook.com ([fe80::6aec:dbca:a593:a222%5]) with mapi id 15.20.7409.042; Wed, 3 Apr 2024 12:08:42 +0000 Date: Wed, 3 Apr 2024 09:08:41 -0300 From: Jason Gunthorpe To: Peter Xu Cc: Nathan Chancellor , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Yang Shi , "Kirill A . Shutemov" , Mike Kravetz , John Hubbard , Michael Ellerman , Andrew Jones , Muchun Song , linux-riscv@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, Christophe Leroy , Andrew Morton , Christoph Hellwig , Lorenzo Stoakes , Matthew Wilcox , Rik van Riel , linux-arm-kernel@lists.infradead.org, Andrea Arcangeli , David Hildenbrand , "Aneesh Kumar K . V" , Vlastimil Babka , James Houghton , Mike Rapoport , Axel Rasmussen , Huacai Chen , WANG Xuerui , loongarch@lists.linux.dev Subject: Re: [PATCH v4 05/13] mm/arch: Provide pud_pfn() fallback Message-ID: <20240403120841.GB1723999@nvidia.com> References: <20240327152332.950956-1-peterx@redhat.com> <20240327152332.950956-6-peterx@redhat.com> <20240402190549.GA706730@dev-arch.thelio-3990X> <20240402225320.GU946323@nvidia.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: SN7PR18CA0020.namprd18.prod.outlook.com (2603:10b6:806:f3::14) To DM6PR12MB3849.namprd12.prod.outlook.com (2603:10b6:5:1c7::26) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR12MB3849:EE_|DS7PR12MB8290:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7d5Drxicj9Ag1dwLcDuEFcEjNK03/mtTdDuPv/+0E+qGLHKkCQJoVH/u/CbZuPLrYXgRmrapnirIFA8LOIf+KAfaAtuQOakqev5oc5paMcTrbB/rWzX3wTWeHLi21/NKaXJG56APRAl510740g0mTHTr8lLMD85wWg+80d5g9NphVzfb1lRhqUjSx0yGfper/3RV/PE9Yli757VwRSQOiRFhsmuSxeBOhc5rL2FbEXL6yPixi4l4pBHb9Td0rJ4i4+z5UuoErAraZgnUcmcSY/x+oE6T0DpI3R63biiThXd+OzETp+/QitfdEg7LPguZHqORJ4D/xSxj95U9DW/yKRP8tTG08s0Qc5fxiRndmgbumhCzY6hiB+cuuxCWWFRI38RMXo1h+Ox+E2quJoahUCdFKzQ+7KJKetSkAySmrnEl4SkHeWQmEXpPR7YE+QyumqVEODAP75hTSuPRdIP72xftv+wcahF27t2thJOk/GC3oQxqD6YvOzDGHQFHLaJ375C+wLidEWxjwdBzadQxyGdkqLgMWfuW1OlavfEVWoq4CVLpmb5U6fKT6eBf93R/Md9TZJESBJVclwGwhJs5c7tIp6OSjrqjbIrLWk9ZOvKHN8rLN3eb98PH3xJVzCnUFQHsX1m/QLHklfgCyxpbhTFMNWbe57Ujtcu4rQ+99lc= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR12MB3849.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(7416005)(366007)(1800799015)(376005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?7dPeEXo85Anym/htRXm3/v05s5CWDH+IEgsNsIZxrBbSa8kn5SRwnvHx0zO3?= =?us-ascii?Q?BiHLYAXHNVH4310Zc0aQpo/IA53d5xwMcckgup+QMmBYdDiYTJI39SvTszdT?= =?us-ascii?Q?w4+SMkfeJ423XVaj8aWv4KY9fzYFLvV2BguAsBelaGL5yDUtPEsMewddwTpd?= =?us-ascii?Q?bAE39gwVqcHAcz5L4hi2ap8lmvPD0zfXBO3HY9lxTcey7RbJO9SPZ8BARaif?= =?us-ascii?Q?AaLTTChfm33lXZvRVq0aVLSpaizO5q8ONd1uLKApKp5cE+MktygcWLxJoP9U?= =?us-ascii?Q?48G1Cr71fX+pJ0dr9EskqPz34ZuogK6Ta3P1ZXlEccpDminsRkRi+OhYpkbz?= =?us-ascii?Q?enzlx6pmOLhXT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R6pK?= =?us-ascii?Q?skCGyu+XeoNzd+mvvlts5zud8to0B2FKqMeoS5jeiEgi7Pi/JjGPTIFokTGt?= =?us-ascii?Q?0mhuOr0uOL0PRkESYaFn8u+ma29q0X+y8j9f90caka86CJLwhVXoj4oltS/i?= =?us-ascii?Q?7hajPSpTT/8wgTYcSmYioLVmgs1WGhBFFz0LPUMsn/7yOVHCshnJcg1tXmng?= =?us-ascii?Q?2SBXwnriXVc03Ow+KkTUNzeljeGL7W6zd25KiuC1XHWLuLdjCmaxTo9trLDs?= =?us-ascii?Q?SenWy/wo3Yx1Le+tIv4gae89tC501DynX8L60nzeZTKTDQ7KLXrqfrab1e2X?= =?us-ascii?Q?O3AG/VstJQkpQqp49tiE8dvlG1ySaio++uCogt3O?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1ce796d5-6291-4946-c6c0-08dc53d6ce35 X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB3849.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Apr 2024 12:08:42.8975 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: vcqeO8smnJ2yHXJiT4G/jEqlS6nSh+02kCcBY902wQMF8jp2DjJMB4trd+v+y+SW X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB8290 On Tue, Apr 02, 2024 at 07:35:45PM -0400, Peter Xu wrote: > On Tue, Apr 02, 2024 at 07:53:20PM -0300, Jason Gunthorpe wrote: > > On Tue, Apr 02, 2024 at 06:43:56PM -0400, Peter Xu wrote: > > > > > I actually tested this without hitting the issue (even though I didn't > > > mention it in the cover letter..). I re-kicked the build test, it turns > > > out my "make alldefconfig" on loongarch will generate a config with both > > > HUGETLB=n && THP=n, while arch/loongarch/configs/loongson3_defconfig has > > > THP=y (which I assume was the one above build used). I didn't further > > > check how "make alldefconfig" generated the config; a bit surprising that > > > it didn't fetch from there. > > > > I suspect it is weird compiler variations.. Maybe something is not > > being inlined. > > > > > (and it also surprises me that this BUILD_BUG can trigger.. I used to try > > > triggering it elsewhere but failed..) > > > > As the pud_leaf() == FALSE should result in the BUILD_BUG never being > > called and the optimizer removing it. > > Good point, for some reason loongarch defined pud_leaf() without defining > pud_pfn(), which does look strange. > > #define pud_leaf(pud) ((pud_val(pud) & _PAGE_HUGE) != 0) > > But I noticed at least MIPS also does it.. Logically I think one arch > should define either none of both. Wow, this is definately an arch issue. You can't define pud_leaf() and not have a pud_pfn(). It makes no sense at all.. I'd say the BUILD_BUG has done it's job and found an issue, fix it by not defining pud_leaf? I don't see any calls to pud_leaf in loongarch at least Jason