Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp1898699pxb; Sun, 10 Jan 2021 15:43:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJzvtkw8/mDmLKAHYZuSgbSc/Zp41wQiPMsxxEttrSLL5LFYw3Afb8d9SCRsimRRm4dFse+1 X-Received: by 2002:aa7:c813:: with SMTP id a19mr11804654edt.192.1610322195281; Sun, 10 Jan 2021 15:43:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610322195; cv=none; d=google.com; s=arc-20160816; b=omgjye6bgIZP2bjaDFdy4UkkGlArDPpzBL/p+zdFRkF3sTAmtcPkqSVOJLuerR3sju CvUFxY02SukyuBw1UhCqfYQmglMwVv/lihL/CRKB5RaSpbMF3vndP4AojwkAdk1NmCAB jPJn8cg3+efUHqFrSGdHBTKf9CXjmJxjM1vH59MpU2AsRFwTn6to9SMZI5wFyXK9Ohyq QX5Ww6eKcJLXEOeOdkjILiHWdFn8mb/wq+jHpZe2wm09gq4vA4vUJvDwOeHVIj0R3eO1 7KPqtc0h8l76+F9gPn6u7fLafwerEKs8htgsKVo3pguNuwIEW6sE1bty9bqEkyNpe0Hj HuGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=J2W226//sKXkR53W1A095if39NAPIw1uvYYX3PyT01c=; b=a9a/1VmRYZjvc1zJuV88V7VRWdk2Tdxp7fo03/y90yW547o0ksgQ4AXC8niN5eTctd Mxs2riaeGi9ZitkxoVIVoJVCRW8NaXBfKWLpJzeNPwsM28Uf17yAcWO68QqGTXunaomT Psbu0YF0xMdru6cgyPc1fpcBJaixVa6dfVRd/y3mVPt38gxreqFvW57Ud0JBT3iwa9ya Hn/GpGP75cx4N+9JtdLumHxMHx7s7LEoAxeULxHjJLus4MJsTSt/ofHQ7Ds4GeD+iAcA LymMtya9ogPAh8NHkwe+N/sqtEjmDNf0/nvKxAmSNOU+rNOjoKYiZNa5EQyYSmz7HB7s c01A== ARC-Authentication-Results: i=1; mx.google.com; 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 u26si6238396eda.115.2021.01.10.15.42.50; Sun, 10 Jan 2021 15:43:15 -0800 (PST) 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; 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 S1726908AbhAJXl7 (ORCPT + 99 others); Sun, 10 Jan 2021 18:41:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726110AbhAJXl7 (ORCPT ); Sun, 10 Jan 2021 18:41:59 -0500 Received: from ZenIV.linux.org.uk (zeniv.linux.org.uk [IPv6:2002:c35c:fd02::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4BAFFC061786; Sun, 10 Jan 2021 15:41:19 -0800 (PST) Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kykKA-0094e9-Rx; Sun, 10 Jan 2021 23:40:42 +0000 Date: Sun, 10 Jan 2021 23:40:42 +0000 From: Al Viro To: Mikulas Patocka Cc: Andrew Morton , Dan Williams , Vishal Verma , Dave Jiang , Ira Weiny , Matthew Wilcox , Jan Kara , Steven Whitehouse , Eric Sandeen , Dave Chinner , Theodore Ts'o , Wang Jianchao , "Kani, Toshi" , "Norton, Scott J" , "Tadakamadla, Rajesh" , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-nvdimm@lists.01.org Subject: Re: [RFC v2] nvfs: a filesystem for persistent memory Message-ID: <20210110234042.GX3579531@ZenIV.linux.org.uk> References: <20210110162008.GV3579531@ZenIV.linux.org.uk> 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-kernel@vger.kernel.org On Sun, Jan 10, 2021 at 04:14:55PM -0500, Mikulas Patocka wrote: > That's a good point. I split nvfs_rw_iter to separate functions > nvfs_read_iter and nvfs_write_iter - and inlined nvfs_rw_iter_locked into > both of them. It improved performance by 1.3%. > > > Not that it had been more useful on the write side, really, > > but that's another story (nvfs_write_pages() handling of > > copyin is... interesting). Let's figure out what's going > > on with the read overhead first... > > > > lib/iov_iter.c primitives certainly could use massage for > > better code generation, but let's find out how much of the > > PITA is due to those and how much comes from you fighing > > the damn thing instead of using it sanely... > > The results are: > > read: 6.744s > read_iter: 7.417s > read_iter - separate read and write path: 7.321s > Al's read_iter: 7.182s > Al's read_iter with _copy_to_iter: 7.181s So * overhead of hardening stuff is noise here * switching to more straightforward ->read_iter() cuts the overhead by about 1/3. Interesting... I wonder how much of that is spent in iterate_and_advance() glue inside copy_to_iter() here. There's certainly quite a bit of optimizations possible in those primitives and your usecase makes a decent test for that... Could you profile that and see where is it spending the time, on instruction level?