Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp494822rdh; Thu, 23 Nov 2023 09:23:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IHDnce+l2RmmwLbIXR9rEzhueVY8cQQgLs7vFUUsjS93libtMz5QxQW6e4fjQep/79eej4s X-Received: by 2002:a05:6e02:1585:b0:35b:37a:52e5 with SMTP id m5-20020a056e02158500b0035b037a52e5mr274815ilu.31.1700760188154; Thu, 23 Nov 2023 09:23:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700760188; cv=none; d=google.com; s=arc-20160816; b=afDeg9fUJ5Pmj2Iym0JA9JmCqCutNCABuK5tYVVvi8ZEAZMSBumY8LnWDD9jWIoNko yv1M2zimr4OsOGQ7HCi8bjsJ+uRyD79aL7+wu7iarnkLh1zx2E9IR+gCdKcTDwFunJKa kUGcl+CGTpxxK5vIEyRlI2IjOMDqXR+ZeR2KF43MR24x/o+jyELxE5G/EI/F/2pvffRs yFKdMHQ+rXEh/GuyecnCWo2EnWPyHgmT+2RQ9X1XHQKf6EofGuGd2/FefFzAKhlIflcm DUvlOgyQVBRC3RtKlGKW/uTit1kpCWZnp2bbHRlFRX4bVmbazK7dBKzl6OyNjrd1wQaM qWEA== 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=KcpnTT0f+98xbE3/g5MCgDaaep2Eqio0fEdLtHv5RPs=; fh=2oiUAc7K0c+S9N587JlbF0mjVfo+UA5ABnXjUtlquAg=; b=dab11tR6Pgo3YkDSZZXc/M3PhVrtv02GehY4dyva6o5c74pEfuACFCPuUEkJltHSGK mxW1SNYvtL7w9RIEsZfAAQTeAhbDuI9Ckp34rvoAZIDNyt9tNfGMuglODqzWzx10AE9z PHKvseMBek4tiqPwS9bvk++g5MZSuswOehyVU+h1qa1I7R3DxWuZ8HyHQz05w5m9NfsR sTy7HdR4aWRdKHi6E4kEwkLLN74CopP26dQno6pe1Qg35Ex64iRg9VKlEsEi9XVfrUFE AfRNoRytlvN+034r//woRNXScd+DmhRO5/hGJFhPi53A1xeWTkyccg8cuY8m+xYs071a r1FA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=I8ZJ2h7A; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id x9-20020a63fe49000000b005bddb417affsi1590724pgj.291.2023.11.23.09.23.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 09:23:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=I8ZJ2h7A; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (Postfix) with ESMTP id 7B4508362D85; Thu, 23 Nov 2023 09:22:34 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345173AbjKWRWL (ORCPT + 99 others); Thu, 23 Nov 2023 12:22:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229462AbjKWRWK (ORCPT ); Thu, 23 Nov 2023 12:22:10 -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 EE4EE1BE for ; Thu, 23 Nov 2023 09:22:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700760136; 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=KcpnTT0f+98xbE3/g5MCgDaaep2Eqio0fEdLtHv5RPs=; b=I8ZJ2h7AaT766iPN0geurxhX/0Yh+izuejW/FCC+aJu2yJntwYbkEXqSXRrM/gO5FWU6bf MMoiiCboQV59vlhm5BZlHs67ZYHbnsxB6/GEIEgTTYyC3VMY9YM/dL+0tjeETXT/TI9NH2 AxMIO5oRThPwwt9qiKzBZUwjSpvCoEo= Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-636-N3Lxx3bJMVycVLX9aCDZ-g-1; Thu, 23 Nov 2023 12:22:14 -0500 X-MC-Unique: N3Lxx3bJMVycVLX9aCDZ-g-1 Received: by mail-qt1-f200.google.com with SMTP id d75a77b69052e-421be23b19aso2491471cf.1 for ; Thu, 23 Nov 2023 09:22:14 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700760134; x=1701364934; 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=KcpnTT0f+98xbE3/g5MCgDaaep2Eqio0fEdLtHv5RPs=; b=il6fJrSnABFg3FJKuRBfohLD4xCllNVAVECFrkq1vHEgQeOCLQNvw7GwEQo9SqxJnd ssaL4Fjts++4qJf3Di6sb2cXqgfuIR9koxgY7aj4v8eIj6rsRLNImzN4rWbDg3shyDck NDkyYVAydV6KMTwJpI/f2i/toWaBke3qq3QC8ygkXxVjhRK2dKbTngKI2illke7G1EMA YmTaPA3eKXk4ZWxoDI4PlHjAaN2kAixmpCoaz1VRCVxPSvE1ngflRyinlw0d/2Xhf+PT mqvm4b4xXJVDbhAZTkmpWGEGC82tVNs1xXBSR/w9daeJibQyhvtB71ZbMI24kAvga4jX Pu+w== X-Gm-Message-State: AOJu0YyZKEaP+SzxV9DZWtyCzHGaZvz37ec/guzbTooLthNRNhx5fn0s bTAFQ+7cRBIfmuTURJmt6AX5wcd1w8oCoieR7ufpBYFLclvxRX1raHQGcg8TX12sAJq7vau3lX1 HSzc2Ho2WYoAAElsreFU0cc47 X-Received: by 2002:a05:6214:16cb:b0:66d:1178:8729 with SMTP id d11-20020a05621416cb00b0066d11788729mr210882qvz.0.1700760134477; Thu, 23 Nov 2023 09:22:14 -0800 (PST) X-Received: by 2002:a05:6214:16cb:b0:66d:1178:8729 with SMTP id d11-20020a05621416cb00b0066d11788729mr210872qvz.0.1700760134200; Thu, 23 Nov 2023 09:22:14 -0800 (PST) Received: from x1n (cpe688f2e2cb7c3-cm688f2e2cb7c0.cpe.net.cable.rogers.com. [99.254.121.117]) by smtp.gmail.com with ESMTPSA id x5-20020a0ce785000000b0067a0b48a4f9sm451474qvn.66.2023.11.23.09.22.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 09:22:13 -0800 (PST) Date: Thu, 23 Nov 2023 12:22:11 -0500 From: Peter Xu To: Matthew Wilcox Cc: 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 , Ryan Roberts 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 groat.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 (groat.vger.email [0.0.0.0]); Thu, 23 Nov 2023 09:22:34 -0800 (PST) On Thu, Nov 23, 2023 at 03:47:49PM +0000, Matthew Wilcox wrote: > It looks like ARM (in the person of Ryan) are going to add support for > something equivalent to hugepd. If it's about arm's cont_pte, then it looks ideal because this series didn't yet touch cont_pte, assuming it'll just work. From that aspect, his work may help mine, and no immediately collapsing either. There can be a slight performance difference which I need to measure for arm's cont_pte already for hugetlb, but I didn't worry much on that; quotting my commit message in the last patch: There may be a slight difference of how the loops run when processing GUP over a large hugetlb range on either ARM64 (e.g. CONT_PMD) or RISCV (mostly its Svnapot extension on 64K huge pages): each loop of __get_user_pages() will resolve one pgtable entry with the patch applied, rather than relying on the size of hugetlb hstate, the latter may cover multiple entries in one loop. However, the performance difference should hopefully not be a major concern, considering that GUP just yet got 57edfcfd3419 ("mm/gup: accelerate thp gup even for "pages != NULL""), and that's not part of a performance analysis but a side dish. If the performance will be a concern, we can consider handle CONT_PTE in follow_page(), for example. So IMHO it can be slightly different comparing to e.g. page fault, because each fault is still pretty slow as a whole if one fault for each small pte (of a large folio / cont_pte), while the loop in GUP is still relatively tight and short, comparing to a fault. I'd boldly guess more low hanging fruits out there for large folio outside GUP areas. In all cases, it'll be interesting to know if Ryan has worked on cont_pte support for gup on large folios, and whether there's any performance number to share. It's definitely good news to me because it means Ryan's work can also then benefit hugetlb if this series will be merged, I just don't know how much difference there will be. Thanks, -- Peter Xu