Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 88CEDC433EF for ; Thu, 9 Jun 2022 19:45:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234872AbiFITpQ (ORCPT ); Thu, 9 Jun 2022 15:45:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229969AbiFITpP (ORCPT ); Thu, 9 Jun 2022 15:45:15 -0400 Received: from zeniv-ca.linux.org.uk (zeniv-ca.linux.org.uk [IPv6:2607:5300:60:148a::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20581258720 for ; Thu, 9 Jun 2022 12:45:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=X4Y858EGq63eoeluNm6a0wwORAZoEK4lu6mc5VqMk/o=; b=ef5EY5gKdGb9uf7Iq6breT44Kp ZEQuy/2Ou7MyNYabWZReqiz1a5srWAGN9JFC2nWnGLYg+N7qdV9VaoMxNO9rYybPhmeQ0NqYo05Wh Fceju/ctXgxzzrF88zsMobsogP82s9C7Qv13jekH0ffFHgBIRBzaNv4sikKO7w6rjM/Gp2qarjrUw vyd1R+7mzg2ASxYnrpOi6BjjOwUnzDtaqxJCZjxbyqV2yuvqtovPJW371zb4Sj5zoxwOAAqi9AB0D HwWYa2OAwX+wx5Qpb7ANlJzNTabaQEF0jLGdKcyIYxAYwpexMzPiJvejOfxHWd3vMT5Dksi46ciNo C7fryUYg==; Received: from viro by zeniv-ca.linux.org.uk with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nzO5g-005YTg-8F; Thu, 09 Jun 2022 19:45:12 +0000 Date: Thu, 9 Jun 2022 19:45:12 +0000 From: Al Viro To: Sedat Dilek Cc: linux-fsdevel@vger.kernel.org, Jens Axboe , Christoph Hellwig , Matthew Wilcox Subject: Re: [RFC][PATCHES] iov_iter stuff Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Thu, Jun 09, 2022 at 09:10:04PM +0200, Sedat Dilek wrote: > > So Mel gave me the idea to simply measure how fast the function becomes. > > ... > > My SandyBridge-CPU has no FSRM feature, so I'm unsure if I really > benefit from your changes. What does it have to do with FSRM? > My test-cases: > > 1. LC_ALL=C dd if=/dev/zero of=/dev/null bs=1M count=1M status=progress > > 2. perf bench mem memcpy (with Debian's perf v5.18 and a selfmade v5.19-rc1) > > First test-case shows no measurable/noticable differences. No surprise - you hit read() once and write() once per 1Mb worth of clear_user(). If overhead in new_sync_{read,write}() had been _that_ large, the things would've really sucked. > The 2nd one I ran for the first time with your changes and did not > compare with a kernel without them. ???? How could _any_ changes in that series have any impact whatsoever on memcpy() performance? Hell, just look at diffstat - nothing in there goes anywhere near the stuff involved in that test. Nothing whatsoever in arch/x86; no changes in lib/ outside of lib/iov_iter.c, etc. What it does deal with is the overhead of the glue that leads to ->read_iter() and ->write_iter(), as well as overhead of copy_to_iter()/copy_from_iter() that becomes noticable on fairly short reads and writes. It doesn't (and cannot) do anything for the stuff dominated by the time spent in raw_copy_to_user() or raw_copy_from_user() - the code responsible for actual copying data between the kernel and userland memory is completely unaffected by any of that.