Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp335358pxb; Thu, 21 Jan 2021 08:13:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJypOPBxU6JkH9vGva1QQPmS/NF50G8+Ieg9bBZ0BeOGRZbHQiY7OAsm/THwJtB3iNK+ZNfL X-Received: by 2002:a17:906:c793:: with SMTP id cw19mr152503ejb.246.1611245637901; Thu, 21 Jan 2021 08:13:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611245637; cv=none; d=google.com; s=arc-20160816; b=b9ETRclMUT6EPanEZNV3sTpaN53yc6hiGlTn9gaux1PIyQKtVdD816ewQkalCbe1ta CHIGj48XMpy6kP4hhj/PRKY+rw2sKDPpWY8RD0srGmeZ7JU/u0ky/Pt7RbuwUWgOtLqQ 7NulO8FBUt4BZPnqxlaKWVVCQM+oUww75A6pI/gm/K16FU1+gt0nn7muAyW+y5T1dA6L FfAuKzgGAZWnVuyRUPY/Fark5zHkiyEyKeuUhxEW4YKo88ygaH/rZGElr/fWzcyOZtzD y8PQ+6L8iwSDMynu6aTFQBE1p7SNo5JFbcydkbCgSDHKqSdiS86qwjHW7iLJrqVG/bNb Q2vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date:dkim-signature; bh=ghSQldHnSV4jEn/ZPu5R3O+xcFRIxfAiUKuyClRAeXw=; b=xR+faV4KrjtmLF7iHSVpQZrZuQIUK20o946ea5wYikyuzMZgnH6JoliWv13Xxa18uN veVRaqmBsk4W2s9C8o6JRDjnDYmbY416zCJ/ACH5PLuf9N6VJOvbB9kCnnDEwbbOPXct UGhHxYe3JXVP5XOVYjn/W2cUnMmTojux5Muut/klopuc7iTRTe/5T7MkOia2Fxt5AGt9 sTScDqbHZnMW44HyfpmIuty0AgXpHjwouN5Xfa5ETdds7xc08CSdIoGSwX6JLvvUb5l9 gqV/QeUwGflvict/KGUoYRCfNonp02l88OlhTYYc1tWzpDAq7HTeW9qJ9CO+Z8/7Smac JUBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="RNb/J0gh"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id va10si1975567ejb.247.2021.01.21.08.13.33; Thu, 21 Jan 2021 08:13:57 -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=@redhat.com header.s=mimecast20190719 header.b="RNb/J0gh"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730948AbhAUQK6 (ORCPT + 99 others); Thu, 21 Jan 2021 11:10:58 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:50923 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732391AbhAUQH4 (ORCPT ); Thu, 21 Jan 2021 11:07:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611245190; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ghSQldHnSV4jEn/ZPu5R3O+xcFRIxfAiUKuyClRAeXw=; b=RNb/J0gh9x3WtGsuAUFFkjxbjD4drFAF0oEyZF10JhIQS0nzjgVcvDKP8V7MEzd8NXLblF x+J0GDHA2WxFwJAwUxha9ZqEmADEVl8Wn1XZKfsudgaI0Ayz7mI6Xg6ONHNmE5x/DZqTV1 S+KbZvHc41orUcJ18x1hh4CYt10rPY4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-65-1PsCEpKXOM6q52LxuR5Vpg-1; Thu, 21 Jan 2021 11:06:23 -0500 X-MC-Unique: 1PsCEpKXOM6q52LxuR5Vpg-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 747841005513; Thu, 21 Jan 2021 16:06:12 +0000 (UTC) Received: from file01.intranet.prod.int.rdu2.redhat.com (file01.intranet.prod.int.rdu2.redhat.com [10.11.5.7]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AE6D861F55; Thu, 21 Jan 2021 16:06:11 +0000 (UTC) Received: from file01.intranet.prod.int.rdu2.redhat.com (localhost [127.0.0.1]) by file01.intranet.prod.int.rdu2.redhat.com (8.14.4/8.14.4) with ESMTP id 10LG6Bio019315; Thu, 21 Jan 2021 11:06:11 -0500 Received: from localhost (mpatocka@localhost) by file01.intranet.prod.int.rdu2.redhat.com (8.14.4/8.14.4/Submit) with ESMTP id 10LG6A87019311; Thu, 21 Jan 2021 11:06:10 -0500 X-Authentication-Warning: file01.intranet.prod.int.rdu2.redhat.com: mpatocka owned process doing -bs Date: Thu, 21 Jan 2021 11:06:10 -0500 (EST) From: Mikulas Patocka X-X-Sender: mpatocka@file01.intranet.prod.int.rdu2.redhat.com To: Matthew Wilcox 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 In-Reply-To: <20210121154744.GQ2260413@casper.infradead.org> Message-ID: 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> <20210121154744.GQ2260413@casper.infradead.org> User-Agent: Alpine 2.02 (LRH 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 21 Jan 2021, Matthew Wilcox wrote: > 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? Yes - send me the patch and I'll benchmark it. Mikulas