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 8CAC2CD1288 for ; Wed, 3 Apr 2024 18:25:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 04F7D6B008A; Wed, 3 Apr 2024 14:25:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F41C16B008C; Wed, 3 Apr 2024 14:25:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DE25A6B0093; Wed, 3 Apr 2024 14:25:29 -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 BE4806B008A for ; Wed, 3 Apr 2024 14:25:29 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 49D3C1206B3 for ; Wed, 3 Apr 2024 18:25:29 +0000 (UTC) X-FDA: 81969048378.02.911D2E7 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf23.hostedemail.com (Postfix) with ESMTP id E652014001A for ; Wed, 3 Apr 2024 18:25:26 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=P7wQeRaO; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf23.hostedemail.com: domain of peterx@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=peterx@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1712168727; 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=YXsmqoOHzY6mBushOHoxlZz3TK/EfZqT4lQukaq20AM=; b=BsyS48Woci2dXQQwjm95+HOoWFZ03yD/mQhk6JruMMnUk9IBZlg9axTyqDjqi5yeRmuqJl qlxGutqlRFvJ98spDoeJRZoTDUnw9jTM6KqMZWzL0kDGQneJ46UyzKU+UG1iiKIX55mFxe zcO1Bu1hbdYAprOZETlu4JQSocpnk7c= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=P7wQeRaO; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf23.hostedemail.com: domain of peterx@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=peterx@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1712168727; a=rsa-sha256; cv=none; b=0EiQIlGHnWH6ZKMlSlbzPxdHrttuKKmcE0Dpl55Hqh41JTUNbDaQCKYEmDiWFCIGcNHOLw w12ssm9EjuPljHPKVQjuiwqfQPLoUwJMl2ynmqo9E5BOgn/rlHQdc7X0IDNg94Cqkl/8Od DG+oSr3H1vMBLeqOZKpV/WLwK5gc9TY= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1712168726; 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=YXsmqoOHzY6mBushOHoxlZz3TK/EfZqT4lQukaq20AM=; b=P7wQeRaO8pvv+bsOulr62tjYpf9C/Ld0fZFLGcYNPH5EYnIjilLCjxadWI9eW7sFMOz2Sl YOtZmbPJrKk3igLm1q8w23oy+TciBsvtxjKiAoMtSgx1j9gd25lh9l5ZeYbV3Zmx4aZXY2 s47pBu5TUZPUCNmoQImKpUIaxAbU+eE= Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-121-9ZS4i2M_Pz6887d5lE9_-w-1; Wed, 03 Apr 2024 14:25:24 -0400 X-MC-Unique: 9ZS4i2M_Pz6887d5lE9_-w-1 Received: by mail-qv1-f69.google.com with SMTP id 6a1803df08f44-69120b349c9so127146d6.1 for ; Wed, 03 Apr 2024 11:25:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712168724; x=1712773524; 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=YXsmqoOHzY6mBushOHoxlZz3TK/EfZqT4lQukaq20AM=; b=AYhLMThRqPfKIfqIoicYmjED9nui/b/jrYSZnYq6OFppJOnmcipVD9thM+2yNMzl4L PFPvh2DaTwO8i6QnCnb3i5nZupAsubpvhyq93MdcK6VlEHVREHVS5r7VFItorqqjFHQM D+XdPLnhRE9kHUU3nauLaaQNjP7+R77EJ30Uz8h9LuZa86f5IY2cOdALImTrV9WQTMA2 jGT2ah99YyA4IZ3H8f0YurCBW7hjFfhpmAyrdSubReAtxeyEyXQPRQk8aITbcmzK7TwL aF/cwbRUY4L0b8sdtUrlGwi+56/11YI+1OmcDLZZLVnmV3H3hn4GuOO2PQzeVXqj6Yek JWuA== X-Forwarded-Encrypted: i=1; AJvYcCV01jkQ22v/40+CrcoSJ0OGdMaDhQvm7Rr/yfDizdI3grjtuqReA6W5s4ZZJ7zYCIkPVD8C8ib8GtVy9rdLx8CzWxE= X-Gm-Message-State: AOJu0Yyd9tfqIJ5BhetkszCXVJziaCYRaiSd0yPHBPLOyQx2QbtKC5Zi 9UWElicbVszCZ4w8iONQEIlifRq4HRv6hLvD1TmPRNaTC5I5uPGocM4uYwx4onOzt2Yy8BQrjuQ ENG63zel/mxhYSOsJDMeeoZndX8V3Yhb2Ksow5HLg5iDjzX3o X-Received: by 2002:ad4:5cab:0:b0:699:2242:4ee8 with SMTP id q11-20020ad45cab000000b0069922424ee8mr129106qvh.3.1712168724107; Wed, 03 Apr 2024 11:25:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHOuNMZozoa6aScFD4XBgyXphotERni3kWeSwgWQ4wF27W29jsLbCwW0feeq4rwhZfTMS4o4A== X-Received: by 2002:ad4:5cab:0:b0:699:2242:4ee8 with SMTP id q11-20020ad45cab000000b0069922424ee8mr129072qvh.3.1712168723495; Wed, 03 Apr 2024 11:25:23 -0700 (PDT) Received: from x1n ([99.254.121.117]) by smtp.gmail.com with ESMTPSA id s15-20020a0562140caf00b00698fd63d167sm4435500qvs.123.2024.04.03.11.25.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 11:25:23 -0700 (PDT) Date: Wed, 3 Apr 2024 14:25:20 -0400 From: Peter Xu To: Jason Gunthorpe 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: References: <20240327152332.950956-1-peterx@redhat.com> <20240327152332.950956-6-peterx@redhat.com> <20240402190549.GA706730@dev-arch.thelio-3990X> <20240402225320.GU946323@nvidia.com> <20240403120841.GB1723999@nvidia.com> MIME-Version: 1.0 In-Reply-To: <20240403120841.GB1723999@nvidia.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: E652014001A X-Stat-Signature: n35sbs3daiwnwwc48d7bm7orn1w7nkyg X-Rspam-User: X-HE-Tag: 1712168726-476567 X-HE-Meta: U2FsdGVkX1/TW04LItPz/LevDQvUH29i13r9FFL41VrV1jBP7aHGGaKqYBhLjx5CKmYV/hVBZyAPhzCCVtRA8PJ0Agrb1CrRnzC7Yj5Kt6KdY2aS6g6T82hUPeecxYT9Jl9P6c+CG+ZdGACQUjCBnkBOivvxEuTfJ9hNha4zsZ4I6UG/3E/b1DwJ+8wSJIDhONSip73oQc9y2+P6IJqMrNGqiaucwCyhKj79C5fJ2lzMchQDB28/LLgB65qO9g5AxyV2kS+ryq2QtYP3r6Vqp8hOKsZzZ4KTVzT4XoCHBJ2AdFx0aUUxzn+GpEAS+0QyGgnFvj+Yy6HxU4gwtouo1iNNBre8JQg9ZR8W7COp3LEZok2QgxL11vkRCcOc6f/5lo22WOHP30RCFekA8/sbOSckYhkddKJFIStib8fDe6tPJT/EB04g3V4vkWdrnZ4P5JBDnI4DHMue7qIu6lORHaB6lYif7ZYoTBqcGqHpwiQ4e/sONeODj6cuNPYozkhe49iifozI/ktAXwrnhyDTLhwtP9tacgjspHpNug7sQVQaYwXSHhHk++H6EuuBJFFZvTl99pfwGYzeoifIfw013UVjlkYTqiS/j/8Gcb/ybIN+d+mM+IN4q8vRxTMc0PgU0KxAL8J6G/jJq123pl2GMbBN6UzbQBniLhV9aiG/SqzMuSKqUfYFi0JtEZVhHMY+9lJY/8Z50JbVUDrbiniX24Z6xtTSy5El91+7OJSxtFGWJ/dIXroEvWdVzdmLQSYlhtLnJQRw1ddJsyqVvITT0/6zsPndUfKLELkdROeab5Y09jSmO7uxV2dlMTq3bDWleln7hB9/GplFkmTW9yeJKu5A6HEeIGjFQVUX4dKLkdV3gktvKQhlmZsXh6Eo8BsZqSAF7FORF7GvYoIGfnuQIMJrF+R2trSmZLq0HuZHDudVgQtvjvQ15x0X4BtBZhP2gU8vSHXeRMg5wm2gNKY NwwJ13wR YHEN1icyON78dFFyJHPCQljMVC2p54LcKbO4plIA68gkZG84JU+AwMKXCb4wdInGGPFu//KM4cBT/U/0eIHTGmoJDQEXW+M0OIc9NVADdiiF2BvT69wh4SGIFM8MEBzq6g32Z53gkLwVQR10h3RjQPmYPIBgZAFZEmiTpBgBTD9jCiMyfPq/eX/A8K8LorUZEpIfPMHxohjjpsvrw4pHii8gbt6UUWYXSCWwm8jfN+/yB1PY5G2UWjaAtZ+l5JOb4rXWMVq7KfOac+Znnzu9fMkw08XuioCFw9+GuAzAMQj+gQxYCggpSktyVvuwXNtl/WhCgRzihhBuSO7atN45s10uDM2NZqJsBNk7mO4KP3LIMuTWjmYug7w3oa0htyFYQUdeD8/W4DkyRYaxjGU0kRIaKvVeMfxw3uay8 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: On Wed, Apr 03, 2024 at 09:08:41AM -0300, Jason Gunthorpe wrote: > 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 Yes, that sounds better too to me, however it means we may also risk other archs that can fail another defconfig build.. and I worry I bring trouble to multiple such cases. Fundamentally it's indeed my patch that broke those builds, so I still sent the change and leave that for arch developers to decide the best for the archs. I think if wanted, we can add that BUILD_BUG() back when we're sure no arch will break with it. So such changes from arch can still be proposed alongside of removal of BUILD_BUG() (and I'd guess some other arch will start to notice such build issue soon if existed.. so it still more or less has similar effect of a reminder..). Thanks, -- Peter Xu