Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp370663pxb; Thu, 21 Jan 2021 09:01:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJxMw+nNseKbUyzloW69xvx4oDEmSgKg6q5SC951dShuYMdZkDLnHOeRSHBqIjB7qm3w0C71 X-Received: by 2002:a17:906:b0d2:: with SMTP id bk18mr267328ejb.508.1611248495400; Thu, 21 Jan 2021 09:01:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611248495; cv=none; d=google.com; s=arc-20160816; b=l+1JmotHlcy0Z951SiOAGi3vAI0+xufr0oMYF7eDmdutwrLIVqqVJaLybqEEkGHsSD IDEO+aOSphsGlyaVwNkAulCDR1OPGhHRZYN/WA1aEgDi08u1sghUgJbGrK2EsJJ9UNMm XUiV2fIS2ku6Hgn6kGF5F5u/rZwFzI10rL1aYZSfsOhQAfA/NA4Ihc46voLhjBlw/mJP 8gWWN6aNmH2KhJ12KB7rq3CtugF3mQd6Su1JTDVBX147gyAHqpLfmD1BCsBswkaAJY1T zixsGJK8WRqV55/tMOe0TCOgptYcsL08FISDLJ/lYV868YmMVREOUI1ELw4bLTv8jmy0 ykIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ZL81M5BEqTudNah5tQWg3R+0k1d+KEs2wiEIXk0AHyU=; b=Z1qVFsZeb/s0rcvHu4J+YKg5TMOhCuHAkfKSyDYsxX2VD77VHgolmZkyKyVQPckEZ6 JCrZS2vwQZlrWFxpRCMegI2FzmiAy5FN1CgCJ0gxaRfo4NJyW/Nh3fgNOYqDLXD6t7wd hDlEdvxfbP5SZuRDFCSo4ZEOLEZA2cX/uPsh2Z1avF6pFKq8anJz/oFFfsx2mUWYoL2X GIFoP8EdWt1+xCbOtcWi2l0UfgCQhNRbvgPPxnBw86QC+/VoUanpLWuWKc0BFC61PuUM nIUNVXqEbdy1D40/f+UXbth4ZHGyVPGUH24TizWOCC8wJqimw5KlGh2Zwq9L7oNP9KCN gdFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=e3+fCJZ4; 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 g21si2376555edp.501.2021.01.21.09.01.10; Thu, 21 Jan 2021 09:01:35 -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; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=e3+fCJZ4; 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 S2388235AbhAUQ7k (ORCPT + 99 others); Thu, 21 Jan 2021 11:59:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41738 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387566AbhAUPts (ORCPT ); Thu, 21 Jan 2021 10:49:48 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BABE8C06174A; Thu, 21 Jan 2021 07:49:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=ZL81M5BEqTudNah5tQWg3R+0k1d+KEs2wiEIXk0AHyU=; b=e3+fCJZ4+c/Bd3YFXUnB7wc2QG zNZApZUXVsJIXgnQ3uDIrk+MdHuBf/EAIQAJSnrt6uQWYQQLnG987ACUBhaoUtT4BMyP/mF3Vnu+o Sn3t0XGgrj/oantRFYObogGn5kFFTLcFx66G5HjEw0Q1G4zvbIqlp5lU8wjt+2Ih1jIWXudnMZVIE EdVihksh4xOV1tWg+RnHNpWlmqeYz41Fcqlop7WHGueLMzdxE08vtnXSgAf24+aIk1aE13JpWuHx0 nQebCiUviossBNnJbDfhqJ/XS9RyRy4zHsANcSszrwiWOxpBQJ//Ou5+u8CsNXSVlCCBxAOkNBPY5 5my++V+w==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1l2cBU-00HDop-6A; Thu, 21 Jan 2021 15:47:51 +0000 Date: Thu, 21 Jan 2021 15:47:44 +0000 From: Matthew Wilcox To: Mikulas Patocka Cc: Jan Kara , Dave Chinner , Zhongwei Cai , Theodore Ts'o , David Laight , Mingkai Dong , Andrew Morton , Steven Whitehouse , Eric Sandeen , Dave Chinner , Wang Jianchao , Rajesh Tadakamadla , linux-kernel , linux-fsdevel , linux-nvdimm Subject: Re: Expense of read_iter Message-ID: <20210121154744.GQ2260413@casper.infradead.org> References: <20210107151125.GB5270@casper.infradead.org> <17045315-CC1F-4165-B8E3-BA55DD16D46B@gmail.com> <2041983017.5681521.1610459100858.JavaMail.zimbra@sjtu.edu.cn> <1224425872.715547.1610703643424.JavaMail.zimbra@sjtu.edu.cn> <20210120044700.GA4626@dread.disaster.area> <20210120141834.GA24063@quack2.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 20, 2021 at 10:12:01AM -0500, Mikulas Patocka wrote: > Do you have some idea how to optimize the generic code that calls > ->read_iter? Yes. > It might be better to maintain an f_iocb_flags in the > struct file and just copy that unconditionally. We'd need to remember > to update it in fcntl(F_SETFL), but I think that's the only place. Want to give that a try?