Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4648839pxj; Tue, 22 Jun 2021 05:09:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxH9Y9fmn+3mclbNrdiYaP7ZdxmL6fjMvLu9gTAw0yfrKlMbN8Uu0sN8AB1sHSJ2w8qj87z X-Received: by 2002:a7b:c117:: with SMTP id w23mr4203011wmi.102.1624363787660; Tue, 22 Jun 2021 05:09:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624363787; cv=none; d=google.com; s=arc-20160816; b=duZo7W38iIWTsCvuNaHNhdMwy0Dds11iznDzpH3FpUe5ckyyPnFeI2WJXUyQL4+1so SLkovypM1yQnQtvnVKsJ/fWoZqR7NqO+eBlN2Eb9yVp60kd9cY5o4S04Sgx4vzo7FWB8 DJStKp2TbQcbyn2LlvYzqdrKv9CTvoB5/R2JRbVyFdNJXwQayawnqhlgaY1KfH4NYO9V Tuw+3kYymBtNPZenHjjMqPwrRoMO+JW9mR1vSU66IHZhPkCxA50/NKiO3hIU2CYPf1J2 SsmhPHZSRKOwnRSAeDkwm1ob7aXGXMNuP0ewSXGEMVmvaRfavb9LdUGiuz6tQB0sDjjy cIQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :to:subject:dkim-signature; bh=Y5Xd78GOu9lf6VGo75b/TA4qnuHXHBd8W++bq5LOH+4=; b=UsZJzXyQCoGMb29h9sB/XUNQOtCqOujuSuHPL4gjdNJdzYTQR9j0U0EdzwzHZ1cEoT vuepYZzeYXhB42vioo+H9mBWk56d8XWnqv9cZa7WCuSZSGilW2Hc/558jdBfOAhFVR10 EGUKu/BoWnocTgNZTeP5HRbAM8tOKDpaE5UmJhf4NDwgQX187qBqUQXoQ+0juz2s4rGP UupNl00yCGM2otzWyjspjkC0mLvw9E3uyibQZvarM5QGs2ySJbFqg4giOXS+Jauy6vNb C34igQVOLDa0oVhzrnuyMFi4hzJ5i6z5w3Xzp/eAoVeaF/kRSZfhLSxkCkxqjg5Ypy/q 8Y5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NL1K7FSe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id my8si12892976ejc.602.2021.06.22.05.09.24; Tue, 22 Jun 2021 05:09:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NL1K7FSe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231357AbhFVMHs (ORCPT + 99 others); Tue, 22 Jun 2021 08:07:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231276AbhFVMHq (ORCPT ); Tue, 22 Jun 2021 08:07:46 -0400 Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 361D2C061574 for ; Tue, 22 Jun 2021 05:05:31 -0700 (PDT) Received: by mail-pf1-x42a.google.com with SMTP id g192so8562574pfb.6 for ; Tue, 22 Jun 2021 05:05:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=Y5Xd78GOu9lf6VGo75b/TA4qnuHXHBd8W++bq5LOH+4=; b=NL1K7FSeYlvZGEB8KXoGhN+/g5qyYPDTIiWCjGX5UcORupJdb/yXhs7Z5GwVqaX8oY oho4+RSnvmXCojlsxXcfaeS+oC4Hq/t1ehzUg/nQqDX9TWksefnRNlNnSej24o1H09gI AfKJXYQX/y+MtrmADeEe1OuecTCzOffJsLGxMYDiS8PxjF8e3cK6VFct1RMI5HUrmaz9 nIzl8Bh4Xe+zJGev9J5Uy/zvW91o0q3ugJqfmsYM7S4hcMdN2Gavowv9KmTkmTaWL1j3 oWlbzbyTOlRfXYnefMMCM0EOKKT6s9IbVBzcfkQBlxWE7blqdEMi6zgwBkj8jsALWAF9 n/jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Y5Xd78GOu9lf6VGo75b/TA4qnuHXHBd8W++bq5LOH+4=; b=FA3c+Yqw2NWNxhhzBRKSdm1A018e4ddjRmaIDD8xsV5+52+dE+BkCEjckRQ8E2wSmA uJrk4inRuYhdvGgh3AGAs5bC09P5+i+EG620DcIwkD4uvOkJ2KCoAd13ONtGr8Ixfg4P 79UvpO530U94eLGv7YkYItMrjz2+lMJCdGQtNN10AGfgUPICA2QBFBFSFVK90v94nj2k Zmp2Mr2f6tp7JJAIvGm5MCMiZqiSe0mh2aonJ4E2uWUY4GXCiBggtB4Hr7VSzlKUpPF5 drXkcIhCwsysSBmiLqk69aMqq+1Xvv6ucSRhSGAAXXGKt3VYbqOno+pxNxpHs0yskehU vWaQ== X-Gm-Message-State: AOAM53354jU63Z7fJa0LvklKNJ3JyqzI8ELrNzhBigzc6XhrtiCe4AAI uih61dqpYeZlD91Y8mfnY8M= X-Received: by 2002:a65:5c4a:: with SMTP id v10mr3456442pgr.142.1624363530586; Tue, 22 Jun 2021 05:05:30 -0700 (PDT) Received: from [192.168.1.153] (163.128.178.217.shared.user.transix.jp. [217.178.128.163]) by smtp.gmail.com with ESMTPSA id c68sm5923987pfc.75.2021.06.22.05.05.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 22 Jun 2021 05:05:29 -0700 (PDT) Subject: Re: [PATCH v2 0/5] riscv: improving uaccess with logs from network bench To: Ben Dooks , Paul Walmsley , Palmer Dabbelt , Albert Ou , linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org References: <5a5c07ac-8c11-79d3-46a3-a255d4148f76@gmail.com> From: Akira Tsukamoto Message-ID: Date: Tue, 22 Jun 2021 21:05:27 +0900 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/22/2021 5:30 PM, Ben Dooks wrote: > On 19/06/2021 12:21, Akira Tsukamoto wrote: >> Optimizing copy_to_user and copy_from_user. >> >> I rewrote the functions in v2, heavily influenced by Garry's memcpy >> function [1]. >> The functions must be written in assembler to handle page faults manually >> inside the function. >> >> With the changes, improves in the percentage usage and some performance >> of network speed in UDP packets. >> Only patching copy_user. Using the original memcpy. >> >> All results are from the same base kernel, same rootfs and same >> BeagleV beta board. >> >> Comparison by "perf top -Ue task-clock" while running iperf3. > > I did a quick test on a SiFive Unmatched with IO to an NVME. > > before: cached-reads=172.47MB/sec, buffered-reads=135.8MB/sec > with-patch: cached-read=s177.54Mb/sec, buffered-reads=137.79MB/sec > > That was just one test run, so there was a small improvement. I am > sort of surprised we didn't get more of a win from this. > > perf record on hdparm shows that it spends approx 15% cpu time in > asm_copy_to_user. Does anyone have a benchmark for this which just > looks at copy/to user? if not should we create one? Thanks for the result on the Unmatched with hdparm. Have you tried iperf3? The 15% is high, is it before or with-patch? Akira