Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2390920lqz; Tue, 2 Apr 2024 16:36:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW4bxckrsLpV9x170ryk3IZnL9La6eO1zNdOJU3TEvXQj8lTF4ALN0M2Ks45nPRT+a0Fwon5+toa8qGn4BwhOQZMY4VYAq57+5vM1t9jw== X-Google-Smtp-Source: AGHT+IEFeXCV55w9CWptF0M3nyHD+gU3DYrq2kgOBNjKpw9H1Oe9B+ULLa82xijwc9qb66kHdU00 X-Received: by 2002:a05:6402:268d:b0:56d:c937:7558 with SMTP id w13-20020a056402268d00b0056dc9377558mr7615432edd.9.1712100962146; Tue, 02 Apr 2024 16:36:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712100962; cv=pass; d=google.com; s=arc-20160816; b=MYpXCASIFvk0PFOPd881JIES3ygjqe24rq2SRJK4HjnVUwW/du4StHoI7RrTfvgvCm WXgCzyLdWP0FVUpOiEbr+Js0VeH8wdMlNytGLF0N2+bbh73XGxVdPXbYmaMyPAYJXM2v sg8tqUkVLXQhGjapiVJdOP8U9AFx3GFs2EK5ls9SC3r8vjPCHH1AqTgEz25p4N5d1uvk ZBVsjCoqYPc725FpA0W/LV8yGJB4iJKReUF/gRiBRN4Fo3qqGUsoXot7DhV5LGNIfkYl oxrNkH/ptnjX9Xond7oowTG0GjpquvaMABjsQDOwrIr0pVkFk4Kt+dsnPta6lFYYC1GB hD4w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=HP6iCpNSGY021srGiNxOfFS1yawEzwYl7dLs1n/YW+Y=; fh=gzxJCejOwHx9lGoMXXQ80tdP3srOrzvIsCszkV+4fpI=; b=V0RfyiB8uQHCk3iGi+P4pJ1JuthK/wHSC7Z6rIR8gUheQQejCCwL+Bu0F6nMBB409r QJlvQ9ey0qbOJ4bYpDGLp2/uI1aT+cUBcRL39e4NZXOwaHdWhHUGfctuNuQzowuuCj54 8ZLOmPB6XNGX2Z3ugZrJe07cXeXdJ8lEaLxWA63cL1cRqNCEOA+Kh5Du5yeVDJkgEQn/ HSuwOl3dU0KN7331lObzo7gxlfqyxhskEEFAVHQQPWeNl+rmDruJ2YMwhEBTuvuaqKWK Xk9gNoKI5S+CbRS73XmSksyrQN161a4oEKRA+QJdMOglPJL9QtfypNMTL+WZKegBMh9Z asrw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=SernlilP; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-128834-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-128834-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id b102-20020a509f6f000000b0056dc8647852si3518006edf.114.2024.04.02.16.36.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 16:36:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-128834-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=SernlilP; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-128834-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-128834-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 99EA41F22B57 for ; Tue, 2 Apr 2024 23:36:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9D62F4DA13; Tue, 2 Apr 2024 23:35:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="SernlilP" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 393F9208B6 for ; Tue, 2 Apr 2024 23:35:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712100953; cv=none; b=Ji7+SB1l4lit82cm/kplZWkJSCF3/zhMpPpRPfz6qBnW5NA3CtHN6RTiQYSe7Hfk5EtigdN8an+u0h5lvsI1hYbCcI86P2ty3Q0RItXxITwGT0PnP4hVVK/akRUP2a+oQykAVsz4kgVgtkXrR/oAdQMDdTbY0LfeCoSOlpV4wfk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712100953; c=relaxed/simple; bh=dCoRqma6yqwIrFc2Ju/9ocy+ca8jMOV5zqLtsYm4O98=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=r5pLASKpV+QzEwKoWmrDij3miwGh/0SBQKuQsSTYdJh07FeAtwyK5SXTiXA3SwsH7hxwID8PXOMkzOATUWqnDXFxbf0JPepRjrMttrZlyl6W40jndhXowva8YJzH011jhnVWJ7GBGGOrwvVaYQeed4wzZ63GBP3mg0KevGN/1o4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=SernlilP; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com 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-f70.google.com (mail-ot1-f70.google.com [209.85.210.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-481-Iy4ky1w-MWCd6zocw9lK8Q-1; Tue, 02 Apr 2024 19:35:50 -0400 X-MC-Unique: Iy4ky1w-MWCd6zocw9lK8Q-1 Received: by mail-ot1-f70.google.com with SMTP id 46e09a7af769-6e6cb8055b8so1936328a34.1 for ; Tue, 02 Apr 2024 16:35:50 -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=Z9nRAUnQo+e02+TYWjgawM88xopFDyKyym7a3zbg4F8OboLKbAaElBcmFt+Z6Iv1Cu RGWeYJmRsZv7r/Ltuu8Z5mM7PeWC06pIrQZVzImKVaTDj9gHuxIz+DvAS/76eKkev/vO BNvDpCnyruuMQEdzBhQcN6n0+9Jd8zPn0PnYyOx2yA5ug4nz0mjJKngtjY6R6JEtH/do EujFyGloCLn/iFdFSsqbnd06LUIl6tHaubM9qigdvsqevFb8gGBEzHy4+lr7WjT5esed 3g6FIPMJ6Lae+Uc7YpWjzYMLEixVxciyUMvoXoqhuRVLNYvk2Vz0QDK5oZ/3YNGBSnGw 8X1Q== X-Forwarded-Encrypted: i=1; AJvYcCXoOMVIkDSi9I6k6i0dLK/tIL7tsKlB/ZSbH0Lk0PJFEMBJaIBGnQcDW7RSEECb4gaFxoj/ITX0VdYLKzSyYZXNEJk7TgtPTqjY6IEZ X-Gm-Message-State: AOJu0YyTmahq96pSOETJUYMdklnacRTCnvkywYQPtb3f4Sxq8GdTcAQx Oz28bdPhdoXDtaoYN8kudoMPewFT/7kLbIQvywLX9wlkFCsKz0/NHY1D2RuUTqorrWtWxNpWiHY QtDUT9jT4T/0++zAUAi46rcNttBDO6HmgVJUcnnnJgi1tAzaSJ7/8f0JCovq+Sg== X-Received: by 2002:a9d:4c86:0:b0:6e7:7ef6:10da with SMTP id m6-20020a9d4c86000000b006e77ef610damr13684097otf.1.1712100949125; Tue, 02 Apr 2024 16:35:49 -0700 (PDT) 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20240402225320.GU946323@nvidia.com> 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