From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E4656C433F5 for ; Fri, 10 Sep 2021 14:46:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AC36461041 for ; Fri, 10 Sep 2021 14:46:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233539AbhIJOsF (ORCPT ); Fri, 10 Sep 2021 10:48:05 -0400 Received: from zeniv-ca.linux.org.uk ([142.44.231.140]:39848 "EHLO zeniv-ca.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229749AbhIJOsE (ORCPT ); Fri, 10 Sep 2021 10:48:04 -0400 Received: from viro by zeniv-ca.linux.org.uk with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mOhjZ-002vI7-Qg; Fri, 10 Sep 2021 14:42:29 +0000 Date: Fri, 10 Sep 2021 14:42:29 +0000 From: Al Viro To: Jens Axboe Cc: Linus Torvalds , Pavel Begunkov , Linux Kernel Mailing List , linux-fsdevel Subject: Re: [git pull] iov_iter fixes Message-ID: References: <5971af96-78b7-8304-3e25-00dc2da3c538@kernel.dk> <9ae5f07f-f4c5-69eb-bcb1-8bcbc15cbd09@kernel.dk> <9855f69b-e67e-f7d9-88b8-8941666ab02f@kernel.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9855f69b-e67e-f7d9-88b8-8941666ab02f@kernel.dk> Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Fri, Sep 10, 2021 at 07:57:49AM -0600, Jens Axboe wrote: > It was just a quick hack, might very well be too eager to go through > those motions. But pondering this instead of sleeping, we don't need to > copy all of iov_iter in order to restore the state, and we can use the > same advance after restoring. So something like this may be more > palatable. Caveat - again untested, and I haven't tested the performance > impact of this at all. You actually can cut it down even more - nr_segs + iov remains constant all along, so you could get away with just 3 words here... I would be surprised if extra memory traffic had shown up - it's well within the noise from register spills, (un)inlining, etc. We are talking about 3 (or 4, with your variant) extra words on one stack frame (and that'd be further offset by removal of ->truncated); I'd still like to see the profiling data, but concerns about extra memory traffic due to that are, IMO, misplaced.