Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp621621rdb; Thu, 30 Nov 2023 13:41:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IE1/qfLzxfZkcK4X5xu/HsTuKpl7ds/BR+vBacFYAHxZQe6zMPyuNgqtyaB0qc+hRXkVpHW X-Received: by 2002:a17:903:190:b0:1cf:ff65:b7ca with SMTP id z16-20020a170903019000b001cfff65b7camr11205628plg.8.1701380488284; Thu, 30 Nov 2023 13:41:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701380488; cv=none; d=google.com; s=arc-20160816; b=ZnKFEGNeylZQJ43T0J2eso/w3QkMQTGNgJOXPBHxduzcD70SSx1cDld+wW/pkrDMua EBZnPBjlcFT1u07x5qlx15HtroK1NKEsT2WzN0bChCO7RsjSZ4VX2F7Iyu/NahwtXsa7 +FLdbtm+38KfHrmXVQNJF0wQUnhQvi3n179TY6DIJiuDhKceO4tK3UOJZny+KRH+3bJL kMbtHlYxhT/KFz7jIqnyI7OXlzAdAaZwxAVkqgv+KLPVt6qrM53RikpG+LoqrO0L6QOE BA8nh9HXg/L6CilOm5jW/Lce4SB7StrJYpvUIJlkiReXQRwBSoKMQoK8Hkm74vh4Z/ZC gvYA== 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=CRU7CkycS7SUcJkoz0E93L3cEZtHoI2nxjtl0XDIHtI=; fh=V1UiOHA0maIBv7dqAt578QDRKSrC0qNmD3y3v+8HN+4=; b=Jcg0IycSuRI4E3gcqcIIhtONZv0dgVg4TXV1LJv/HwXb5a2UhFqvsu9bZuG8ZTkW+D sLW0pEHamBVhosLURuojVCjypmbXuW89pMw8zOHcn8v3O2AMQo9Ift8qZnSS/6BxP83O xUk3YPCmGgqQUq1L1W7FbOsqJ9Sjj+4OS8xARFwXNmhXLrAfhQuNv+w2YTaP0u0540qC 03+M8Hnfa98xRigwZr+7EWkhPqZ6mi0M5QZ736cSSM+fGPdfsXI+QuVh4V7FReWcVRCF hvC7y03JY2lMpUMJW2/7opw9pyZlzkQpQzYCyMQ9HB6LteVVkmcJ8M6EtB7WtNAHbqQ+ P0RA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=MNyXjOeY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id jn13-20020a170903050d00b001cf96a6e95csi1891479plb.325.2023.11.30.13.41.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 13:41:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=MNyXjOeY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (Postfix) with ESMTP id D54838026A7A; Thu, 30 Nov 2023 13:31:15 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376878AbjK3VbA (ORCPT + 99 others); Thu, 30 Nov 2023 16:31:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229645AbjK3Va7 (ORCPT ); Thu, 30 Nov 2023 16:30:59 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91D7A1B4 for ; Thu, 30 Nov 2023 13:31:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701379864; 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=CRU7CkycS7SUcJkoz0E93L3cEZtHoI2nxjtl0XDIHtI=; b=MNyXjOeYCMi3d7PY+Iothk1aqIuuHcepB5STzcFYou6yGJl3AhqVaMOT+D2SRA0Xz2oQqi 1QgecfId4m4nuWaHcH10T4AFGlPHkD/Or6k0Y5gW8LbMNTJeeuIo8W8GZGzwA7CWlf5x2Z 3Q5Jsii1af4934f8BwxOyNkO13UehCQ= Received: from mail-oa1-f72.google.com (mail-oa1-f72.google.com [209.85.160.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-191-Yyff1DwLMTKsruloLPnCSQ-1; Thu, 30 Nov 2023 16:31:03 -0500 X-MC-Unique: Yyff1DwLMTKsruloLPnCSQ-1 Received: by mail-oa1-f72.google.com with SMTP id 586e51a60fabf-1fa8e147acdso453530fac.0 for ; Thu, 30 Nov 2023 13:31:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701379862; x=1701984662; 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=CRU7CkycS7SUcJkoz0E93L3cEZtHoI2nxjtl0XDIHtI=; b=XqPhhMEeLQobuUD1BmQrA6zG31aYqX3BDz0Cghl/JXPzJnw0UM91rYpWXuKQJw7901 Fswybt1q0H0NZRbgd1PjgWfPMSgewSr2gUPIfRB0rzg7mS3HFhyPksnk4Ucu/EDXgvnl 47zpwvSNZGb+RjfBgE7Zo8Xe1Ualxs5RHLyEmVwp1jIFGNeVVbLGfF4b4FhD7O1JyTv/ MNHHjqvnxWEzJaf4F6WDXKltG2ZGfztPFtVorBljQTOKg5OBhGT1Ljc1PEWK76aqO+Gb OYJFlOimqUsfXqCx5a1We7uCv8sNzZRQY28RlBDwq/wg9tI7QyXNlo5/HtIfFizYX6BP 8esw== X-Gm-Message-State: AOJu0Yznx6d8D5NBv+Bw5W7Zrgk1b7qbCdz4QpXwGEUO8g4haXNoJ1Od phNiNCGea16xm8a40D2KKmqYszzI6Ky0r4ayfQBKeIil+Aswv3Wc0gv5w4X8IqBUKbuUYVFfKCl jW3DMTwG0a27q8c0VgS0IL/Mf1G/Nm01x X-Received: by 2002:a05:6871:89f:b0:1fa:25e7:380c with SMTP id r31-20020a056871089f00b001fa25e7380cmr3376645oaq.4.1701379862197; Thu, 30 Nov 2023 13:31:02 -0800 (PST) X-Received: by 2002:a05:6871:89f:b0:1fa:25e7:380c with SMTP id r31-20020a056871089f00b001fa25e7380cmr3376607oaq.4.1701379861914; Thu, 30 Nov 2023 13:31:01 -0800 (PST) Received: from x1n (cpe688f2e2cb7c3-cm688f2e2cb7c0.cpe.net.cable.rogers.com. [99.254.121.117]) by smtp.gmail.com with ESMTPSA id b19-20020ac87553000000b00423b8a53641sm842916qtr.29.2023.11.30.13.31.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 13:31:01 -0800 (PST) Date: Thu, 30 Nov 2023 16:30:58 -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-7-peterx@redhat.com> <510adc26-9aed-4745-8807-dba071fadbbe@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=0.6 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SORBS_WEB,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.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 (agentk.vger.email [0.0.0.0]); Thu, 30 Nov 2023 13:31:16 -0800 (PST) On Fri, Nov 24, 2023 at 11:07:51AM -0500, Peter Xu wrote: > On Fri, Nov 24, 2023 at 09:06:01AM +0000, Ryan Roberts wrote: > > 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. > > Thanks Ryan. Then nothing is needed to be tested if gup is not yet touched > from your side, afaict. I'll see whether I can provide some rough numbers > instead in the next post (I'll probably only be able to test it in a VM, > though, but hopefully that should still reflect mostly the truth). An update: I finished a round of 64K cont_pte test, in the slow gup micro benchmark I see ~15% perf degrade with this patchset applied on a VM on top of Apple M1. Frankly that's even less than I expected, considering not only how slow gup THP used to be, but also on the fact that that's a tight loop over slow gup, which in normal cases shouldn't happen: "present" ptes normally goes to fast-gup, while !present goes into a fault following it. I assume that's why nobody cared slow gup for THP before. I think adding cont_pte support shouldn't be very hard, but that will include making cont_pte idea global just for arm64 and riscv Svnapot. The current plan is I'll add that performance number into my commit message only, as I don't ever expect any real workload will regress with it. Maybe a global cont_pte api will be needed at some point, but perhaps not yet feel strongly for this use case. Please feel free to raise any concerns otherwise. Thanks, -- Peter Xu