Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp1090151pxb; Thu, 9 Sep 2021 20:24:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyg7A4WAAMplwY5KYRInVOz3fDHx5fVswcDYVYX0D0tW6SVl8cHsurzniAE2Qtf1TZkcQBr X-Received: by 2002:a05:6402:1775:: with SMTP id da21mr6763947edb.49.1631244255856; Thu, 09 Sep 2021 20:24:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631244255; cv=none; d=google.com; s=arc-20160816; b=mRp7qtCydS5FwGXBHkD1JXNbyyFT5ljlsspl6tKaYWf6bLyivMarxD46kJRYmYJ09X 6HtDwLcMec1l8glApu+gMoiXcF6abDGsJPVRZBkMpkuqTFRcSx35FUFblra1MkSDVd15 +NrulIWOeukzpX79fDgI53f8D7VQfH9Z+iGVIQoa9GTO+cC/fQwJBw79FYAL8c9qdQyN 7+vmtK6JJhzysAlo8fFAt1noVcxfxnjqlOwowcqPbhFyynDtG8wwob3/gZ9HzUc58iar Tk3hCprZGWTkp8wKJ4nHZmNOJsSm8ZvYYqrjWQAt9RATjDj4Yal28Kh8XFvxj9kdTLIW tJlQ== 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:from:references :cc:to:subject:dkim-signature; bh=EvIKhcEAdqIX2oPTeV2qcqjuPBERBJ9PR89hwHrrM/g=; b=n43gYM0lxOs6r6agmLUj865DktxwYchPnRW+kwcfdqM35UHvgP3rx1hIs8KZWvztII wHm0c1hBeosdnIRu7P/hSNi02qGZ1X9vQkVljbPGpA+icfO4HD/sRmNbAZZ8eFJAcXrm faLB33cD3N2wyli375V0T7FcbRXxwFIemLu34kbqqyjXRmx6xK/JwLjuGPdMawkeeSQn EOXM2BE2UkS0WMiAdtCmrs81H1AXNuU1LKfrJOOJHLOrkII++/2/+IktL5esRbNITQiC Xu0ZcFTiE4jf7pXsPo2TFhEBiLVZXN2WzDZyo7LyqroscwtWkWW2cpNx1L+9GHafjSFB 8UVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=zo7SZOF+; 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 d26si3709070edx.559.2021.09.09.20.23.51; Thu, 09 Sep 2021 20:24:15 -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-dk.20150623.gappssmtp.com header.s=20150623 header.b=zo7SZOF+; 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 S229981AbhIJDXn (ORCPT + 99 others); Thu, 9 Sep 2021 23:23:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229461AbhIJDXm (ORCPT ); Thu, 9 Sep 2021 23:23:42 -0400 Received: from mail-il1-x12b.google.com (mail-il1-x12b.google.com [IPv6:2607:f8b0:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9BEE1C061574 for ; Thu, 9 Sep 2021 20:22:32 -0700 (PDT) Received: by mail-il1-x12b.google.com with SMTP id b4so603204ilr.11 for ; Thu, 09 Sep 2021 20:22:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=EvIKhcEAdqIX2oPTeV2qcqjuPBERBJ9PR89hwHrrM/g=; b=zo7SZOF+zEI1ym97HonQU2W1Yus3eovW6l82Jvq6a0nxgBIH9mrs8aus1GjvBiXqEj fmjTSd9kNsEzETkPJW90TgsV4yjffghQHrgWH3+5lN4b0liLQvP8+OjSPmsKhdO/pOle 57HRdc9jqClJVs8LsmUB5rMq1e6NNItgKEeVfAR9ekzN6ZJnObKuDesZnhiA/9JLHPO+ f5O44vMJtLZalIE7eQq/TuLp7+sTyKFbD1ZGXGX8qPNpPEywVqJ1gC5Yy2ORXfM8aht6 INEYNHI7LpUo+J0BxONN636yJuBRO07yCwYb4SaXLoE5P3V/jk3nmdhhM7k25T8674Al qy7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=EvIKhcEAdqIX2oPTeV2qcqjuPBERBJ9PR89hwHrrM/g=; b=CiSzddD2BlRRPQXHLLDTkO8f4Cb3bh2pl8lHiJkfxdXbh3IL03mPpJUfRHU+bbSkC6 wy5qG2DtRy0Oi1h3EDcL5+NKACkbjFml4UTEkmRW5RivV180WH11GjKiWxcgjYD+nqM4 EsyNqls3FcAts+HlIPbjgWCBRXJGVnwCIjnUHPqRN6v7qYfqsRwZrmeAXe7zmeE7Gwhk n8c0ZLK/TLvjw5XsXI6geF3SKj6EAniXkw9gxe+d6z+ZmxEu9czFz3JuVIT0ejmk4r/9 tvURnLwQG4mzYlekWnHbswUjLHN4Hrf5I7rkG4+llCf3f8o80s+ZAGr9l8f1DeduQYoW m0AQ== X-Gm-Message-State: AOAM532oQvbOw1TsBamKN+J+H2yWjqGrGhf1s9cdYyMp4o4iQg9qIOra gcUD7QLhB79ifQp2tQVxHtTzkQ== X-Received: by 2002:a05:6e02:1074:: with SMTP id q20mr4867076ilj.204.1631244151770; Thu, 09 Sep 2021 20:22:31 -0700 (PDT) Received: from [192.168.1.116] ([66.219.217.159]) by smtp.gmail.com with ESMTPSA id t14sm1858429ilu.67.2021.09.09.20.22.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 09 Sep 2021 20:22:31 -0700 (PDT) Subject: Re: [git pull] iov_iter fixes To: Al Viro Cc: Linus Torvalds , Pavel Begunkov , Linux Kernel Mailing List , linux-fsdevel References: <5971af96-78b7-8304-3e25-00dc2da3c538@kernel.dk> From: Jens Axboe Message-ID: <9ae5f07f-f4c5-69eb-bcb1-8bcbc15cbd09@kernel.dk> Date: Thu, 9 Sep 2021 21:22:30 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/9/21 9:11 PM, Al Viro wrote: > On Thu, Sep 09, 2021 at 09:05:13PM -0600, Jens Axboe wrote: >> On 9/9/21 8:57 PM, Al Viro wrote: >>> On Thu, Sep 09, 2021 at 03:19:56PM -0600, Jens Axboe wrote: >>> >>>> Not sure how we'd do that, outside of stupid tricks like copy the >>>> iov_iter before we pass it down. But that's obviously not going to be >>>> very efficient. Hence we're left with having some way to reset/reexpand, >>>> even in the presence of someone having done truncate on it. >>> >>> "Obviously" why, exactly? It's not that large a structure; it's not >>> the optimal variant, but I'd like to see profiling data before assuming >>> that it'll cause noticable slowdowns. >> >> It's 48 bytes, and we have to do it upfront. That means we'd be doing it >> for _all_ requests, not just when we need to retry. As an example, current >> benchmarks are at ~4M read requests per core. That'd add ~200MB/sec of >> memory traffic just doing this copy. > > Umm... How much of that will be handled by cache? Depends? And what if the iovec itself has been modified in the middle? We'd need to copy that whole thing too. It's just not workable as a solution. >> Besides, I think that's moot as there's a better way. > > I hope so, but I'm afraid that "let's reload from userland on e.g. short > reads" is not better - there's a plenty of interesting corner cases you > need to handle with that. As long as we're still in the context of the submission, it is tractable provided we import it like we did originally. -- Jens Axboe