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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 5C7A7CD1284 for ; Tue, 2 Apr 2024 23:36:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=UwezhUlyypsOin+tCbtJrCrHoYqACss5zgnI2Mi+h2s=; b=HhFD0LgOYMESYG CxhQRDQWLcjZagyIRoYtICfQrUtUrHG6D55/FjMlYLWJKHhB1PvUQpxTl4n+XbvJ8WZrrVArGETTJ f7idk/Y0gS3KCLVUjq8JwTW8eSHCwWKVDbOyPm6LtEaTZeHQMQaPqxcFW3+afDsdZA1mDiOeZPLiu YW/dLI/FUt7J28NQiWmXJaHprwGrZKlJVypE0hYPHZDnmFOq6lDcMqk0TNsT1SkIfL4kSmXEe+KJ0 6Jm5gLarxNdEv7Z2yF+x2OjWbOWrNs5Z48oNDAPb6Wp5PZWP0NWmu20/LLbHA8gVVp6o4HsRhEeXW rI+4OCANtRyN2v+6uKwQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rrnfX-0000000DCVt-2DeJ; Tue, 02 Apr 2024 23:35:55 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rrnfV-0000000DCUN-05tv for linux-arm-kernel@lists.infradead.org; Tue, 02 Apr 2024 23:35:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1712100951; 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=HP6iCpNSGY021srGiNxOfFS1yawEzwYl7dLs1n/YW+Y=; b=SernlilPx0ivm1TcTtzb7+vEpxjwHEyJDuDBqj8+JyXykNsdXTQ+HHACBTxSxQ11VzxUqg jMuV5q7ipH+LXIHpJd2lJTYx1H59Z9EHIpua3K+zyajwImDVX1FQE30CKeZ9C+Rah+Uo9E gk69vgrtq6qhJefGuiVsjjtP3HkkVbM= Received: from mail-ot1-f69.google.com (mail-ot1-f69.google.com [209.85.210.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-136-jqa_mk6_ONCUkd5MdF91Lg-1; Tue, 02 Apr 2024 19:35:50 -0400 X-MC-Unique: jqa_mk6_ONCUkd5MdF91Lg-1 Received: by mail-ot1-f69.google.com with SMTP id 46e09a7af769-6e6cb8055b8so1936321a34.1 for ; Tue, 02 Apr 2024 16:35:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712100949; x=1712705749; 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=HP6iCpNSGY021srGiNxOfFS1yawEzwYl7dLs1n/YW+Y=; b=eKFItPNb1Q0BWiLed32dyN/4OgfC/ZavQEELf9DACSGbVGWui/wBVpv4RXfUpfxM0C sjLhsgWJWO+3bNTGVkAkLDMCkN3KXh9QajaDInO+hquIzi3BguKVqCF4YMTvOgKogz7x y58zV0E0yqICLyJZ7iYJ7m91uTe2uv+kUt/IElI/a0kCNnrLx/FJn6WPo4XCgwenSz94 Xr/PisQG63l4oI3caSWSIK6yPDLybpm0grr6OSUmerjxyo3UJypBdSsXJ3Z2hVTBuScQ OnoCRX8W094FbAOe/fmFlOxqJ+i7gMZdN9YlATOBWeRPo4Gptu0ptF6a3+s/KcbJV9LZ 7ySA== X-Forwarded-Encrypted: i=1; AJvYcCXoxShmdGKHTdw8PzWiCVau9Pz4srl+vwuCcIGm/TgIjhIiBnkLbWyDO01BxWLnN1/q/l0Scl1jwqORNRSn0htErkQzi0SNIFubBeCYJeAkiIR4Vjw= X-Gm-Message-State: AOJu0YxmiSo9i6VAZ/ZyFTDv4LEGPSCyayYxIK4Rfx0X7CHF5lWQZ4ms dOn6jwngAOIlKAbghZ82zq+kuuUjRu1Xm4AOVhz1uW2ZfMynSgVU5sCOvMQQednhkCkjmjxVU76 fyhOxc9tj5Ia2wIdpP9YzXNNhi5VxTgim+w/ixpi6k7eqph+nwUyeFXxRujInlWz7wVN9vTf+ X-Received: by 2002:a9d:4c86:0:b0:6e7:7ef6:10da with SMTP id m6-20020a9d4c86000000b006e77ef610damr13684103otf.1.1712100949126; Tue, 02 Apr 2024 16:35:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEvGEFvbrAiLdQh8lUIUnqC+uQoSnGXUScHs/S+SFU0VVogBN2f5CbF/OzNKGljOo4S/t2faA== X-Received: by 2002:a9d:4c86:0:b0:6e7:7ef6:10da with SMTP id m6-20020a9d4c86000000b006e77ef610damr13684059otf.1.1712100948622; Tue, 02 Apr 2024 16:35:48 -0700 (PDT) Received: from xz-m1.local ([99.254.121.117]) by smtp.gmail.com with ESMTPSA id ob12-20020a0562142f8c00b0069046d929a3sm5893803qvb.145.2024.04.02.16.35.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 16:35:48 -0700 (PDT) Date: Tue, 2 Apr 2024 19:35:45 -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> MIME-Version: 1.0 In-Reply-To: <20240402225320.GU946323@nvidia.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240402_163553_281831_4F2247AF X-CRM114-Status: GOOD ( 20.69 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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. > > Perhaps the issue is that the pud_leaf() is too far from the pud_pfn? My understanding is follow_pud_mask() should completely get optimized and follow_huge_pud() will be dropped in the compiler output if pud_leaf()==false. Thanks, -- Peter Xu _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel