Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp5404869rdb; Sat, 30 Dec 2023 22:37:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IG34Yal1yD4ETmI3X5hvIjIEGzNha3fCgu4UOYRjYYA0ngShCoNAnjDB12PjvnLiK5G4IiP X-Received: by 2002:ac8:5903:0:b0:428:c2d:cf56 with SMTP id 3-20020ac85903000000b004280c2dcf56mr4092248qty.96.1704004666673; Sat, 30 Dec 2023 22:37:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704004666; cv=none; d=google.com; s=arc-20160816; b=BwUbZhDm2j5MbdM3TOFMu3g4lhL0u4hHRDem+5gw/dARWUshWhj3+NPLHCTggEld2q 8q5v9YYb8HjF0zOFbjkf7TSZAeJB3w8BhD6RQqRC72NCHJ4IGOFYv0Y1QOQm0n6lJMZi ppOr8MVDOpOnbF7LS5AD1NarZtBmLoCvU/p4fOBaeFafGNIF7SpmAHx8hxkL8mgCnhlG vYKPVcaDhzzv7Rt4PCChYD4VHHn/LTPPMvj2GFZIJDxX35+rB4jMQLAVPWiCdzCkk3HH THQ1GyhYhjxIcehLUxyLUn8hgVPIrpE4sfL+cfhvMrfPojGBOxM/d0bB4OZz2Tv1obFr XmxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=nKjfT989uQpgr6oSWS8y8C9HzzS1ysePYmsw5yKS0vg=; fh=DrC11EGBAUqo91sbESjPcJV1gpWnPt8reyQoR9d6Q9Q=; b=iZbGY89wXYUb1Z593D46L0I+TgFASIFntJ7XWSbn434FsjF6rvCW9sZbBn6fF6aeUH n9+nR1NtUA2Ik53zzGVIspdkC1Aab3QsqSzYoWQrNbKLKZWNbePop7OYQuv2Ra6mGsQd jtroCPxaPUUMBZZLagN5nkeqIxasIcTvw3DJzWlvjvPgg9xDya8o1OnFrYpUl/WPTG7i SEFvAvMI0hE+Q5vnZiEDr4p+Igb3qKV+cqZ+snLqUJWKAxACqaYV3wS+jwg7c+EX1/C7 kwReT0map1pIne/pXT6gTS+dLa+HnJeNZxmgNgdnM/ihNUzwoTs+l+x9SnGQKxrvydJp SIDQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-13645-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-13645-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id j15-20020ac85f8f000000b00423a58fab57si23030207qta.209.2023.12.30.22.37.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Dec 2023 22:37:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-13645-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-13645-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-13645-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 6C0011C218C8 for ; Sun, 31 Dec 2023 06:37:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 814EB3C0A; Sun, 31 Dec 2023 06:37:39 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0A98F33CE; Sun, 31 Dec 2023 06:37:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ghiti.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ghiti.fr Received: by mail.gandi.net (Postfix) with ESMTPSA id CBA7F1C0003; Sun, 31 Dec 2023 06:37:33 +0000 (UTC) Message-ID: <3d36ca3c-9a91-41a7-9e68-288982c2c8a8@ghiti.fr> Date: Sun, 31 Dec 2023 07:37:33 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 4/4] riscv: enable HAVE_FAST_GUP if MMU Content-Language: en-US To: Jisheng Zhang , Paul Walmsley , Palmer Dabbelt , Albert Ou , Will Deacon , "Aneesh Kumar K . V" , Andrew Morton , Nick Piggin , Peter Zijlstra Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org References: <20231219175046.2496-1-jszhang@kernel.org> <20231219175046.2496-5-jszhang@kernel.org> From: Alexandre Ghiti In-Reply-To: <20231219175046.2496-5-jszhang@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-GND-Sasl: alex@ghiti.fr On 19/12/2023 18:50, Jisheng Zhang wrote: > Activate the fast gup for riscv mmu platforms. Here are some > GUP_FAST_BENCHMARK performance numbers: > > Before the patch: > GUP_FAST_BENCHMARK: Time: get:53203 put:5085 us > > After the patch: > GUP_FAST_BENCHMARK: Time: get:17711 put:5060 us On which platform did you run this benchmark? > > The get time is reduced by 66.7%! IOW, 3x get speed! Well done! Thanks, Alex > > Signed-off-by: Jisheng Zhang > --- > arch/riscv/Kconfig | 1 + > arch/riscv/include/asm/pgtable.h | 6 ++++++ > 2 files changed, 7 insertions(+) > > diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig > index d3555173d9f4..04df9920282d 100644 > --- a/arch/riscv/Kconfig > +++ b/arch/riscv/Kconfig > @@ -119,6 +119,7 @@ config RISCV > select HAVE_FUNCTION_GRAPH_RETVAL if HAVE_FUNCTION_GRAPH_TRACER > select HAVE_FUNCTION_TRACER if !XIP_KERNEL && !PREEMPTION > select HAVE_EBPF_JIT if MMU > + select HAVE_FAST_GUP if MMU > select HAVE_FUNCTION_ARG_ACCESS_API > select HAVE_FUNCTION_ERROR_INJECTION > select HAVE_GCC_PLUGINS > diff --git a/arch/riscv/include/asm/pgtable.h b/arch/riscv/include/asm/pgtable.h > index ab00235b018f..c6eb214139e6 100644 > --- a/arch/riscv/include/asm/pgtable.h > +++ b/arch/riscv/include/asm/pgtable.h > @@ -673,6 +673,12 @@ static inline int pmd_write(pmd_t pmd) > return pte_write(pmd_pte(pmd)); > } > > +#define pud_write pud_write > +static inline int pud_write(pud_t pud) > +{ > + return pte_write(pud_pte(pud)); > +} > + > static inline int pmd_dirty(pmd_t pmd) > { > return pte_dirty(pmd_pte(pmd));