Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp570551rdh; Thu, 23 Nov 2023 11:47:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IEjyblRr48lDC72/7e5v+wEmkU6xaWsx/RbSCqH29H/p54SWiZ22/B50jz3STP65gJY+rAB X-Received: by 2002:a05:6a21:78a6:b0:187:eb60:d6ef with SMTP id bf38-20020a056a2178a600b00187eb60d6efmr759410pzc.1.1700768856038; Thu, 23 Nov 2023 11:47:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700768856; cv=none; d=google.com; s=arc-20160816; b=mjj3ecaA176yBSRI17u0tZGkkYh01Fa3AZAxuP3rPkJWXSX555lxyYg+cWxGUOUDgy WMFK1Hm3+Y2dfyUImw7Feljl7s7LuV41cdRSxuFAXgo6wiGATJrK9J3pLudY0U7SZGoT VbBi9os3EQDFscC451MoKKyMiflAx2sASzrHrR9Yv7XmUsDezH+qA8usgbalOC/IgymY LOUJWwnE/EoPwu2sVe3d4JLa8ZUAIsnvZ6RMvNsO7V9g1JQKcqhko5sC4lkBCAgSLWnD DX3re/cdQ9oWm3CqnNDyUZSPIKeWUr37YeNh+fRRrho9bEKEgDzC0IVuHuV6MS2dt3fp a5wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=/x0+ehpuka6vaGTVf1NB1DVm2JcgVurz702wP4rKKMc=; fh=V1UiOHA0maIBv7dqAt578QDRKSrC0qNmD3y3v+8HN+4=; b=y/HQd/8QFYEA7sVZmv3NhOtQgaTif3GNN+mE1AAT7J6nTo7Ib8HQNG0yXpq4Deo4Ed jscddNKpW/ZUSYCejPCcspe5jyj6ZxIoNfxQOJHd1Mu5Y9IoadxaE+ubzJdJmudFndgo tD7uvCFJEJlbG9OYuq848LLay3UdJ7vB+R8vzDeVDdwJvdzHYc4g9uWY36Nht8r6xKPK cskRDf2PTutSOLsafOw1Xheh2bxOg7oenLh6CoNes6IB1Zx+MTL5zYGshQ7W2/0TM1M4 bZgmRrk/aDmgRZjn1y3ZQUYK3x3lLXGXInJfrn3ia5l4qsB+tx/8YIXwDa4S1agqsguI NExQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QzAYerPW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id r15-20020a17090a4dcf00b00283a2ae9f65si2410676pjl.92.2023.11.23.11.47.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 11:47:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QzAYerPW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 73087809AFC4; Thu, 23 Nov 2023 11:47:08 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229588AbjKWTqw (ORCPT + 99 others); Thu, 23 Nov 2023 14:46:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229453AbjKWTqv (ORCPT ); Thu, 23 Nov 2023 14:46:51 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C58DD47 for ; Thu, 23 Nov 2023 11:46:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700768813; 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=/x0+ehpuka6vaGTVf1NB1DVm2JcgVurz702wP4rKKMc=; b=QzAYerPW43t4fJjMBNKce+5LQxjAqzuk5ueqIdOhAnNnhC37tjfZjdP5YI5bjAxSdRg0nn 1pbvgegWHRYD5pX2KHBM1xMr5KiUqQIZlC9DnlrLgcUtpw9xs5wUYKtzHxN+kTxlVzB/Qo lstFvop9BphL2UlWiyvbMm14kPuz2kI= Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-580-26MA958aN6OVmDXVv-iRmg-1; Thu, 23 Nov 2023 14:46:52 -0500 X-MC-Unique: 26MA958aN6OVmDXVv-iRmg-1 Received: by mail-qv1-f70.google.com with SMTP id 6a1803df08f44-679d8383224so2916376d6.0 for ; Thu, 23 Nov 2023 11:46:52 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700768812; x=1701373612; 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=/x0+ehpuka6vaGTVf1NB1DVm2JcgVurz702wP4rKKMc=; b=ny6jGhq/VTJLnCIQUcrXmmb+JGeoq34BAFXML6pS1t6CpnHDklchGILJqXlooitRbg 6RNU0SfE+gntkg23cfnI5Gu+E2tINlab8reXN6P1UqJgeXQELXr7T8+eOPxqACjUkD+W GNyLWW76rkNaLJecsVKuQ0cxD1Hrb8F6tBTq41WUzL/EcTZ25RTGNrZB54gI+e5LEi4l d1C323+1genhowAN5G7Ue4opqTLJUGou/2gakHhBAdGeJoptkdJYGYyLOjERqfHjmALA ixvCUIjUH1vaUfzeDKjOIAma40uf3l3UsH0u4bIOlRc9Qyx8/eEczZ4cynhHo8xA1KlK n7dQ== X-Gm-Message-State: AOJu0Yz8hnfaPtTsAgU3SThf+zKNbwaztEPinevIJGluCcBMBv7aYEa2 2Qo2FdBK5hUxvNPzHaQcAZrDvkdYWnoIT/BQTORvW7vuT9iUHtweCYorU3qR/tNXh2YwqRJ97sT Z/n0Jp9GDM+gqrFrF7QEbn6c+ X-Received: by 2002:a05:6214:5845:b0:679:d92e:3915 with SMTP id ml5-20020a056214584500b00679d92e3915mr481404qvb.6.1700768811697; Thu, 23 Nov 2023 11:46:51 -0800 (PST) X-Received: by 2002:a05:6214:5845:b0:679:d92e:3915 with SMTP id ml5-20020a056214584500b00679d92e3915mr481383qvb.6.1700768811422; Thu, 23 Nov 2023 11:46:51 -0800 (PST) Received: from x1n (cpe688f2e2cb7c3-cm688f2e2cb7c0.cpe.net.cable.rogers.com. [99.254.121.117]) by smtp.gmail.com with ESMTPSA id o21-20020a05620a131500b0076cda7eab11sm663606qkj.133.2023.11.23.11.46.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 11:46:50 -0800 (PST) Date: Thu, 23 Nov 2023 14:46:46 -0500 From: Peter Xu To: Ryan Roberts Cc: Matthew Wilcox , Christoph Hellwig , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrea Arcangeli , James Houghton , Lorenzo Stoakes , David Hildenbrand , Vlastimil Babka , John Hubbard , Yang Shi , Rik van Riel , Hugh Dickins , Jason Gunthorpe , Axel Rasmussen , "Kirill A . Shutemov" , Andrew Morton , linuxppc-dev@lists.ozlabs.org, Mike Rapoport , Mike Kravetz Subject: Re: [PATCH RFC 06/12] mm/gup: Drop folio_fast_pin_allowed() in hugepd processing Message-ID: References: <20231116012908.392077-1-peterx@redhat.com> <20231116012908.392077-7-peterx@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Thu, 23 Nov 2023 11:47:08 -0800 (PST) On Thu, Nov 23, 2023 at 07:11:19PM +0000, Ryan Roberts wrote: > Hi, > > I'm not sure I've 100% understood the crossover between this series and my work > to support arm64's contpte mappings generally for anonymous and file-backed memory. No worry, there's no confliction. If you worked on that it's only be something nice on top. Also, I'm curious if you have performance numbers, because I'm going to do some test for hugetlb cont_ptes (which is only the current plan), and if you got those it'll be a great baseline for me, because it should be similar in you case even though the goal is slightly different. > > My approach is to transparently use contpte mappings when core-mm request pte > mappings that meet the requirements; and its all based around intercepting the > normal (non-hugetlb) helpers (e.g. set_ptes(), ptep_get() and friends). There is > no semantic change to the core-mm. See [1]. It relies on 1) the page cache using > large folios and 2) my "small-sized THP" series which starts using arbitrary > sized large folios for anonymous memory [2]. > > If I've understood this conversation correctly there is an object called hugepd, > which today is only supported by powerpc, but which could allow the core-mm to > control the mapping granularity? I can see some value in exposing that control > to core-mm in the (very) long term. For me it's needed immediately, because hugetlb_follow_page_mask() will be gone after the last patch. > > [1] https://lore.kernel.org/all/20231115163018.1303287-1-ryan.roberts@arm.com/ > [2] https://lore.kernel.org/linux-mm/20231115132734.931023-1-ryan.roberts@arm.com/ AFAICT you haven't yet worked on gup then, after I glimpsed the above series. It's a matter of whether one follow_page_mask() call can fetch more than one page* for a cont_pte entry on aarch64 for a large non-hugetlb folio (and if this series lands, it'll be the same to hugetlb or non-hugetlb). Now the current code can only fetch one page I think. Thanks, -- Peter Xu