Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp930899rdh; Fri, 24 Nov 2023 01:06:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IGdG8jPzTcqXApSd68U3+skR8Isfszw9Y1PniawM5gdDLtycbxHGq0SN0vB9KWfaewFA84V X-Received: by 2002:a05:6602:2245:b0:7b3:7173:f5ec with SMTP id o5-20020a056602224500b007b37173f5ecmr2416852ioo.1.1700816775296; Fri, 24 Nov 2023 01:06:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700816775; cv=none; d=google.com; s=arc-20160816; b=F46ZRBNP/YcEgAXDI1fnhtNcD9WUzfBrnhlbSHawX873X6IkpvDX0tp/CEwcUgchRd 03UicLiETuoW13Hpw/EUGfZASn5XnB7XqlDG/Ol0oYiBuX9BmUO0ViE9C3O9DJGzoDcR AlmtTlI7QAvGMF0cIsKmH+BRPU5ZSjhePKOWunYQVbpsRs7BYakPnA1cahcpoEXs++UY vSN+phS/gDsbDDKpjEBNBLN5Ar+OOCu/iq+RI38oc/ObajhJjKcR1WoCgrsWzg9bb1Y4 oyHea6Ap0GlLXlaaOyX5M3AN0C6SKpcs6WnFfIyixY4oRuyp59BaWJXsCGz/pn+vhdde vfnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=lJGBGZlFxhbpxnAT7Gsiax5Mi3O89lnBnAbe3YyVYo0=; fh=nCigvfPsGmglCZAxmw+TsAvhUAWCKdw32BlSZFvQv4o=; b=W/iPk3id6UntbJ3kpprTY5VMl5rTOEUGG7JtAHO2r4CFt3W3UIEu1wZt0hYp/D6HDg dGQnHaYqhtRh2G3JLQ6IYqXQ/GBKedtr5wCpiYx1llbHYCoMbIhrnkbzLdiIAwSq72nT I8QRiEGmH+mlWWioodqSfg8iSH2Gbh0wACqKJQjS4BwxTsIDA/prp4iOMMFq+2VqQFi3 7hBPyi6YnZRdXvsqaYmSfm8s7AULThlZXCWOSE7HDUyLuQ3Lt5yRNRqPI5bpiHiuffqW I70bzZ7D+Ul9QTT5KDQFDbDGluly7xQJBbyPX2Cm/9vDUGW/FuBkpgKKzrLl1iRChHBg Cevw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id e36-20020a630f24000000b005ab92870413si3165808pgl.498.2023.11.24.01.06.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Nov 2023 01:06:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id E524D82663ED; Fri, 24 Nov 2023 01:06:12 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230012AbjKXJGC (ORCPT + 99 others); Fri, 24 Nov 2023 04:06:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229705AbjKXJGB (ORCPT ); Fri, 24 Nov 2023 04:06:01 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C6942BC for ; Fri, 24 Nov 2023 01:06:06 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B74521063; Fri, 24 Nov 2023 01:06:52 -0800 (PST) Received: from [10.57.71.2] (unknown [10.57.71.2]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 64DC23F73F; Fri, 24 Nov 2023 01:06:03 -0800 (PST) Message-ID: <510adc26-9aed-4745-8807-dba071fadbbe@arm.com> Date: Fri, 24 Nov 2023 09:06:01 +0000 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH RFC 06/12] mm/gup: Drop folio_fast_pin_allowed() in hugepd processing Content-Language: en-GB To: Peter Xu 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 References: <20231116012908.392077-1-peterx@redhat.com> <20231116012908.392077-7-peterx@redhat.com> From: Ryan Roberts In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Fri, 24 Nov 2023 01:06:13 -0800 (PST) On 23/11/2023 19:46, Peter Xu wrote: > 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, I have perf numbers for high level use cases (kernel compilation and Speedometer Java Script benchmarks) at https://lore.kernel.org/linux-arm-kernel/20230622144210.2623299-1-ryan.roberts@arm.com/ I don't have any micro-benchmarks for GUP though, if that's your question. Is there an easy-to-use test I can run to get some numbers? I'd be happy to try it out. > 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. No, I haven't touched GUP at all. The approach is fully inside the arm64 arch code (except 1 patch to core-mm which enables an optimization). So as far as GUP and the rest of the core-mm is concerned, there are still only page-sized ptes and they can all be iterated over and accessed as normal. > > 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, >