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 2ED8AC4338F for ; Fri, 6 Aug 2021 13:48:44 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9908361186 for ; Fri, 6 Aug 2021 13:48:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 9908361186 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=zeniv.linux.org.uk Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 14A578D0001; Fri, 6 Aug 2021 09:48:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0FA316B0071; Fri, 6 Aug 2021 09:48:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 00FC88D0001; Fri, 6 Aug 2021 09:48:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0020.hostedemail.com [216.40.44.20]) by kanga.kvack.org (Postfix) with ESMTP id D7FD46B006C for ; Fri, 6 Aug 2021 09:48:42 -0400 (EDT) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 8BE5418505 for ; Fri, 6 Aug 2021 13:48:42 +0000 (UTC) X-FDA: 78444786084.29.7E975AA Received: from zeniv-ca.linux.org.uk (zeniv-ca.linux.org.uk [142.44.231.140]) by imf03.hostedemail.com (Postfix) with ESMTP id EBC6330025E7 for ; Fri, 6 Aug 2021 13:48:41 +0000 (UTC) Received: from viro by zeniv-ca.linux.org.uk with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mC0DG-007dY8-OT; Fri, 06 Aug 2021 13:48:38 +0000 Date: Fri, 6 Aug 2021 13:48:38 +0000 From: Al Viro To: Pavel Begunkov Cc: Andrew Morton , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, Jens Axboe , linux-kernel@vger.kernel.org Subject: Re: [RFC] mm: optimise generic_file_read_iter Message-ID: References: <07bd408d6cad95166b776911823b40044160b434.1628248975.git.asml.silence@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <07bd408d6cad95166b776911823b40044160b434.1628248975.git.asml.silence@gmail.com> X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: EBC6330025E7 Authentication-Results: imf03.hostedemail.com; dkim=none; dmarc=none; spf=none (imf03.hostedemail.com: domain of viro@ftp.linux.org.uk has no SPF policy when checking 142.44.231.140) smtp.mailfrom=viro@ftp.linux.org.uk X-Stat-Signature: waj99wphnmexuy76epbutzqkwz7uhxye X-HE-Tag: 1628257721-986136 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000001, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, Aug 06, 2021 at 12:42:43PM +0100, Pavel Begunkov wrote: > Unless direct I/O path of generic_file_read_iter() ended up with an > error or a short read, it doesn't use inode. So, load inode and size > later, only when they're needed. This cuts two memory reads and also > imrpoves code generation, e.g. loads from stack. ... and the same question here. > NOTE: as a side effect, it reads inode->i_size after ->direct_IO(), and > I'm not sure whether that's valid, so would be great to get feedback > from someone who knows better. Ought to be safe, I think, but again, how much effect have you observed from the patch?