Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3705187pxv; Mon, 19 Jul 2021 06:54:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwfArQ53LG5xIJVJJIQlosDOvH1ds6Vwox5GiOr/NkQEGV9xzLGt09LvPJVW7I2jnoPqrzr X-Received: by 2002:a05:6638:192:: with SMTP id a18mr21935703jaq.47.1626702865198; Mon, 19 Jul 2021 06:54:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626702865; cv=none; d=google.com; s=arc-20160816; b=Wb5oC6YNvfDNhdzGesYc2ezWu5ACyne/Lm6xLipVdOfXm9CZXzwW2TWn7XWPIetSDA L+KmLyiIT6xgk0XNJ5Bm4RfmqqCIcVuDWpaknx4t8JFkogPv7ag4z4mi2mv52DBtHb3r cQN4RSE7b/J2wblzTrdkSnQqJc1nVy+iTMErxx7xHLQ+KGYEtDVrPDtPSqqgCTsR19IO 1rAZOtzZo3kIhtFer2PT/SQ3KuTtLZwzdo4ouyZZCgsEC/dmae8ysNDFIkNjfd+aY95c 67BO0OKdJ4eFmEhP8luUig/hWh6bSOF+XlvVnZxVKqfd5SBszbXNZ4NVXgxp+8M/JrfD wxqQ== 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:subject:from :references:to:sender:dkim-signature; bh=G6MwYyfQ7hWYMM8FEazyj6+PGlDAQxVO02bzWLIZ5AY=; b=ZNkZDr9caCc52a53C3TmBKKQw0KfJarlFyzzaZ9PK4r5+TYdNisysn73dJhlBLfh26 0GKPTxtgXaTwaNKTYjVWFUDfgOEaYL18ptbNpBI6OMFX7GKBqZ5Q7V9R+3LX/duW1THI Qt9z/aW8aIxU2q/A/g3b44EtONMyvn2C/jEbl6rkumvhM6D6zABrlL7EWX7XoFx2fZAz TqCxQ56M/p4VmPPDfa102j+ENWTSBdoyyTsEhF7QnF/VAWkB3Wd0FXJw8XnoUbQd4DrW a3gVoVnC1UdaFeK1KSI0I8grsr5s3gSoZSf7GAFe/VmXWk3Wo78JubAsxvoifQc3yc4B tnkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hj0dhjZ5; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f20si20277336iol.42.2021.07.19.06.54.11; Mon, 19 Jul 2021 06:54:25 -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=hj0dhjZ5; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240672AbhGSNMx (ORCPT + 99 others); Mon, 19 Jul 2021 09:12:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240704AbhGSNK6 (ORCPT ); Mon, 19 Jul 2021 09:10:58 -0400 Received: from mail-ot1-x334.google.com (mail-ot1-x334.google.com [IPv6:2607:f8b0:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F626C061766 for ; Mon, 19 Jul 2021 06:14:22 -0700 (PDT) Received: by mail-ot1-x334.google.com with SMTP id a17-20020a9d3e110000b02904ce97efee36so6458322otd.7 for ; Mon, 19 Jul 2021 06:51:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:to:references:from:subject:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=G6MwYyfQ7hWYMM8FEazyj6+PGlDAQxVO02bzWLIZ5AY=; b=hj0dhjZ5Jnrq0wnLeD39kxY2zFJbc0JkNv00IalygYNJ3E8rmuvZfs7ojbG1hVnYE7 +6X5m1aumTOtEOShM59Q74bb27lD0B5YUrn7cW8tI8gWo60MYcv6St38IHpf94mrclno ir243xYtz3IYzxqyVMp4K8X4fuSAy/6DbyUnXmjA4flnGWrBvwq+ufE11Hjg+djxtQhl eZchId3HUUvJfiR2/2s8/H/6suP7uaoD94cpvxvf2YLf/EGBcU+mf7mfiB/omSsATC2n 6GXAtMGCF4KNHYFEfYYsja61Zrb0KByPZm8d1BrvAY6e5cBFdjVhUA55IjneEV8+L0EY VpZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:to:references:from:subject:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=G6MwYyfQ7hWYMM8FEazyj6+PGlDAQxVO02bzWLIZ5AY=; b=QqV62pvkpjuWjRN+MMOaSMwqfagNn8gXag48MfyUM8iG/w7uSfDyyUqXVX/V1H2H2P bUk6u99zV1I/ySCQqtlUoLr5NMuIWhqP/4Ttl7dkumVXoDW8IzRv3y2kl1793pHkh1Jw yD+XjZ3TDgIQFeqi4lJZxAock///qjRACuVNEP6v5BD8RnD5OjjKBtI3vdST+SJx6AIY KyNvZKUszrB1GhFLx2WJMoy1r6z3y2wCnc2lp1a4BKLvCoRy5+siYRSfb9k8ffB7xajY dob4OCEhkYhH0UAt2Iu+Eg13SVyFy/n16KHuAzUY4+5eZD4mADwbsggJDSIGdESCr2m8 fToA== X-Gm-Message-State: AOAM530Mu9sBpHNsEfGMzoqfqYTA1Y/zZq3OalWrqlFDW6/rD5dDPUIc 1zA0NAkSH69JMgk484gEUEPZ3J0D1FY= X-Received: by 2002:a9d:3a49:: with SMTP id j67mr19812527otc.114.1626702669812; Mon, 19 Jul 2021 06:51:09 -0700 (PDT) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id x129sm3734177oia.26.2021.07.19.06.51.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 19 Jul 2021 06:51:09 -0700 (PDT) Sender: Guenter Roeck To: Akira Tsukamoto , Palmer Dabbelt , Geert Uytterhoeven , Qiu Wenbo , Paul Walmsley , Albert Ou , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org References: <5e1b5d90-5a1e-5e9f-7b92-6c53b8589c2a@gmail.com> From: Guenter Roeck Subject: Re: [PATCH v4 1/1] riscv: __asm_copy_to-from_user: Optimize unaligned memory access and pipeline stall Message-ID: Date: Mon, 19 Jul 2021 06:51:07 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <5e1b5d90-5a1e-5e9f-7b92-6c53b8589c2a@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 7/19/21 5:53 AM, Akira Tsukamoto wrote: > > This patch will reduce cpu usage dramatically in kernel space especially > for application which use sys-call with large buffer size, such as > network applications. The main reason behind this is that every > unaligned memory access will raise exceptions and switch between s-mode > and m-mode causing large overhead. > I had to revert the original patch from the mainline kernel prior to applying this patch. Obviously that means that there may be other changes affecting the outcome. riscv64 images work, but riscv32 images still fail with this patch applied. The error is a bit different than before, though. ... [ 11.899979] Run /sbin/init as init process [ 12.152666] random: fast init done moun: applet not found "�����V�t: applet not found /bi�����V�F-: applet not found moun: applet not found swaon: applet not found hostname-F: applet not found After this, the image hangs. For comparison, the mainline kernel (v5.14-rc2) fails as follows. [ 10.788105] Run /sbin/init as init process Starting syslogd: OK Starting klogd: OK /etc/init.d/S02sysctl: line 68: syntax error: EOF in backquote substitution /etc/init.d/S20urandom: line 1: syntax error: unterminated quoted string Starting network: /bin/sh: syntax error: unterminated quoted string sed: unmatched '/' /bin/sh: syntax error: unterminated quoted string FAIL /etc/init.d/S55runtest: line 48: syntax error: EOF in backquote substitution I'll be happy to provide information on how to reproduce the problem if needed. Please let me know. Thanks, Guenter