Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4258887pxf; Tue, 23 Mar 2021 06:45:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwgqWmTHhCezTfmDS1rHrkLgGF0NJkW6XbRsteKVzfjLQSM4fLIHxWgHru/JMRSrJPdqARP X-Received: by 2002:a05:6402:22b5:: with SMTP id cx21mr4737741edb.27.1616507126659; Tue, 23 Mar 2021 06:45:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616507126; cv=none; d=google.com; s=arc-20160816; b=HmvhXdL6HZPaM0VMfD1uPQX5QqrLaW8xBOqpF5+e3iFmuwv+4UqkQmZ/uBlTkR7PaO Q6NZWYf52IMDpNgVEck/8emy5rNH1aMmTrflH+CZAYdUi4t7NodNZ4VZwCF9R2DZUShw z94BxWD4KrBtkjSlVu68kcflJz1u8/n2JkhFkNIC6pIKFYB8fikHqUQ63N7yAheg1/Wt +1yM82Tsbu1Sv25WBC6UKd52yRv44BN7EVS00mumMo+MF+fttqRSluv1mOZurv+1bLYQ 0oPx/k6EAd3htg9i+TV1ldewGdpXlpTzmvxfUoH+zW3nUrlIhd650Atcq5Ekpbe/pWsI o1HA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=5H1dlo3juiRBKI9LRLZ49st02n1S6HLBbRAnI1fVd+A=; b=PgggI/E9kD8Ad0+DJ3apJW3+ILHDyRLsirEC83IlQTOxR3h/K58VViFFa9ksQDDuEY gH4CfDw4fujZ9fNLl7b7T4TcAuKl+eJnOmEdk7p9FDI8k5M9jjftbGLtBR5PqUGaaJVk V3ZC0XpbZFCIje0XnGyEHsH3KuBkUzt2TJiuv2ofri29YZXuSwAVt76RWmIktPUcrb4K +/t+oRXtkBGKjLDTtHnCDNGcQl2BE1GrBVmLFYdd4VQFs7J1eqzPV+h/zzO3RFHSWzkF o2Pz0RAKzNzh3TYZ3pEsVn74RbGVyjFJEfVd4EAu+uWirxIakd88kum6pmaH6URAYXlE qPJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="HOABxc/6"; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id de22si13432362edb.314.2021.03.23.06.45.03; Tue, 23 Mar 2021 06:45:26 -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=@kernel.org header.s=k20201202 header.b="HOABxc/6"; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231408AbhCWNcp (ORCPT + 99 others); Tue, 23 Mar 2021 09:32:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:49526 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231484AbhCWNcX (ORCPT ); Tue, 23 Mar 2021 09:32:23 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A08D461934; Tue, 23 Mar 2021 13:32:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1616506342; bh=W0tIxwsotien8iin7AWdN0XUIhP3YiP+OBSWyGyUIPQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HOABxc/6xUlMWP+sNnK6mvSUvWnA+V+tVoKF0Ph/6Bsi3Lcuqibn37ordn3DpRauj zTJlpy2gDkuLmH2/V2CpmVW55M+a3ptLj4vaNwLfuFm0DmZ0MzvoiAzwZnWo+0nH/j mrT6ATUAndAmfalBbnfdKLPtOOBfHMGO+7W2aflUoE3TTFgGXVLVap4+NO3TADIL52 YNU7xXY1LQgfItyW3VilJv409kOWTe7ThSN76qFDc77ClH/YaXOkwQnZ3mLzCEQiie nn7lu7TbfMNxMR+NtU60Mpj/dfc4FRCJdWKCkoORFXUhDTXpI3zsKQ/Cs3/5RvHJ5s LVcbPIUVxcL7g== Date: Tue, 23 Mar 2021 13:32:18 +0000 From: Will Deacon To: Robin Murphy Cc: Yang Yingliang , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, catalin.marinas@arm.com, guohanjun@huawei.com Subject: Re: [PATCH 2/3] arm64: lib: improve copy performance when size is ge 128 bytes Message-ID: <20210323133217.GA11802@willie-the-truck> References: <20210323073432.3422227-1-yangyingliang@huawei.com> <20210323073432.3422227-3-yangyingliang@huawei.com> <03ac41af-c433-cd66-8195-afbf9c49554c@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <03ac41af-c433-cd66-8195-afbf9c49554c@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 23, 2021 at 12:08:56PM +0000, Robin Murphy wrote: > On 2021-03-23 07:34, Yang Yingliang wrote: > > When copy over 128 bytes, src/dst is added after > > each ldp/stp instruction, it will cost more time. > > To improve this, we only add src/dst after load > > or store 64 bytes. > > This breaks the required behaviour for copy_*_user(), since the fault > handler expects the base address to be up-to-date at all times. Say you're > copying 128 bytes and fault on the 4th store, it should return 80 bytes not > copied; the code below would return 128 bytes not copied, even though 48 > bytes have actually been written to the destination. > > We've had a couple of tries at updating this code (because the whole > template is frankly a bit terrible, and a long way from the well-optimised > code it was derived from), but getting the fault-handling behaviour right > without making the handler itself ludicrously complex has proven tricky. And > then it got bumped down the priority list while the uaccess behaviour in > general was in flux - now that the dust has largely settled on that I should > probably try to find time to pick this up again... I think the v5 from Oli was pretty close, but it didn't get any review: https://lore.kernel.org/r/20200914151800.2270-1-oli.swede@arm.com he also included tests: https://lore.kernel.org/r/20200916104636.19172-1-oli.swede@arm.com It would be great if you or somebody else has time to revive those! Will