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 1C177C5AD4C for ; Thu, 23 Nov 2023 19:46:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8BC718D0058; Thu, 23 Nov 2023 14:46:56 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 846798D0002; Thu, 23 Nov 2023 14:46:56 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6E5BD8D0058; Thu, 23 Nov 2023 14:46:56 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 5C2088D0002 for ; Thu, 23 Nov 2023 14:46:56 -0500 (EST) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 3D1FC1A0C77 for ; Thu, 23 Nov 2023 19:46:56 +0000 (UTC) X-FDA: 81490252032.11.664B73E Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf19.hostedemail.com (Postfix) with ESMTP id 1A3CB1A000D for ; Thu, 23 Nov 2023 19:46:53 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=QzAYerPW; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf19.hostedemail.com: domain of peterx@redhat.com designates 170.10.133.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=1700768814; 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=/x0+ehpuka6vaGTVf1NB1DVm2JcgVurz702wP4rKKMc=; b=eX1y0xz0zdB5lhC78GpAG9W2r8ofqGJDaTLxGKFfg7d77sTNU7JvwzBKH2AqeRpEUABrM3 EOucKJPpi6NFAH7cHn2PTi5WXWEEqa/UDCpWZrd8NaJdaoUh24lJtWLu/ptirjbMUF+WFJ u1X3kqdOod35kyRlTovOXNz4HEYdV/4= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=QzAYerPW; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf19.hostedemail.com: domain of peterx@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=peterx@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1700768814; a=rsa-sha256; cv=none; b=UCYiACmkXRKyvHanEcO7Qx4n6NuuV2+G3foo59ON2JddUWpYI5h7TJNtFbfI0fJITqEOBd 2OLzDpCPSQNJx7yxF697Ik4Hxsw46p1zwKaveXLsskE3q+eBnSGWCuPKl90BK1Kg2eWJVM WHby3yCJ1jJNbO2S+lRaNhcphxaEZHo= 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-602-zmTuscwIMz6xRqnenitSLQ-1; Thu, 23 Nov 2023 14:46:52 -0500 X-MC-Unique: zmTuscwIMz6xRqnenitSLQ-1 Received: by mail-qv1-f70.google.com with SMTP id 6a1803df08f44-679d8383224so2916316d6.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=1700768811; x=1701373611; 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=TblePX6ri9h29IN5A75B5nB0Xv3owbybC6Q6Q9weTbJhB92Jj8A0TXmBiKonT+eCOm OstN2TEkC3qVH7xdXXWF9J6DLgoaHKKQFLCyqVxNydbGP6tcOoXrXjXzskSXKPRahmBh i7ZXVEE5ZkMbolmJjCzKhIwWYed3Jy31CY1TaCslO1UgrrgXjZu/4eyL4M2SRCUUWdSA HoejOfQeol2CzTYzNrNj7UTgmm1TULvlaQCveYYk4XWkpQYOZnpd56ue0ElTN75DXhPJ +6g4xY2aBs8v2RUmv8vIJK2BtszLf9ptRA7BjwyiaaPr/izJD/xBBWPofp9nPwj/00jg X+/A== X-Gm-Message-State: AOJu0YyIdyDRPdIf1HPrg05jadkdpFqZmdpThY+wg3ere88UGTgc5iSP HWhsLVnrLMo3tqcbcC86gMZWFfBJYCdeI0+kq1s8Y1IIVCGcdiTB3sdQF9IPIx5EKmUxdSB5IMQ l+Ux+9L50wDk= X-Received: by 2002:a05:6214:5845:b0:679:d92e:3915 with SMTP id ml5-20020a056214584500b00679d92e3915mr481407qvb.6.1700768811699; Thu, 23 Nov 2023 11:46:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IHzBI31IcH5oeMakKOYAtr+L45e77XcNn9sZZWA3VceZj7679x6/xkQISZE37o50DvBfsjvDg== 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 In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 1A3CB1A000D X-Stat-Signature: rhnexjpwuo5y7f7nh5ran7tdqsuqc657 X-HE-Tag: 1700768813-527985 X-HE-Meta: U2FsdGVkX19jG4Wpcey5AMRMO3macXK7Ru/M+CcYRwVNxZy1XR9p07kGYD8TQIQl0Pojj7481UjAVwwrsxXudm/xxl6sA5Rvc7AtzuBb7iLWwQ8354719cKpPy0viRUqJgg6b9lJ21O0GzeF0EN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dU1VcziL7d9Du5t6E7VPA3Lg3ZvgRjq/mg53RoXuZ1HkkA3cjWwH30SsDuFSKksCjNizDkhhFwovTKNzHf7dSZvAED5lxMXKsCBsB5otp+Bl5O2Ek4i6q9g6oGw4ZQ+lWK6ySj+nfyEKMG7MoefL0ohDN6pDu2LAq/dyX4V7Um2RUgovUA47TQCLd2M7KC3Jl0Gr6blynza9BJVadFJHfJn8q3Wr3QvGDwSfdBrLKPgKcxgNiYEY/KLPYfcSBWcpn2pEXUHU7gFvyKax+rN50jmjQA0KeB+QFHrg== 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 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