Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp712832pxt; Fri, 6 Aug 2021 11:50:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJybBk3ciPBU0q9agx7FAtsjFbIfKhrrWNSotE7wehvlKLFoXuOnNAEDNUuaGyiw3yuk0hyT X-Received: by 2002:a92:c266:: with SMTP id h6mr620742ild.273.1628275849360; Fri, 06 Aug 2021 11:50:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628275849; cv=none; d=google.com; s=arc-20160816; b=YU5NmW/oTF47JsV/J1kbJ8yyGfwv6/q5Tm3z8nHWMNTl/ROyN+tE+KelGE6frDM6Q7 hlu64THk4+b+5anlxo0DVttultClhKnxcnMRsB7bYVEo6FACLfVSSBsyKj8bC64uo1Y/ a23ocIGX1E5QmS0BlEzGf2/BDHyp6EeLa6OiP5p/lmnDELSqTBRyTm8jckaaz57me/1+ nkisRA6YvTCQI73ekJvA75ogVy40cbUz21mVFMA7gbbghdwaEK237liUKxX1Pv2oA62F /thoPcTKFLgfIxDsbA3s7tWwkYKwbTvbYfLkBGK9GYUmcxIhecstzCUKbr6rcm1FJoj6 8i3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=e6/PVaASlTUvfcVRchsMpB/XKyD9UT46qutBY+fZwlg=; b=EBku5GqAO85lGsqqYPVfuGfVvM4IvldhGcf1wVLEKA2G5KA62zUEZ0FyzgJr1ycVku fd4A09K48VPooU5U8dH3Wu2RXgiJchguocEwZjl2drDH2ueywwrYIOdpZKi5xotONZaN O6Q1Fq9oGuZ32UizZcT2supEXse44MpDoWivsb0mytamRX3xAaizQ6GhUM0zg2aTzv6s HFKXD6JWjxGazZ1tALHjbjiTaiJtoUbjD8dqdTr3TZT10rqcfKl4CLjJCG09zng42mPw 7/evQonCCYslPHB9viPMs+wVC6f6U1J+mrsf0z4/nYRfXjGhcNyzeYz7yBwbONod8csU NsrQ== ARC-Authentication-Results: i=1; mx.google.com; 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 h15si9400435ile.62.2021.08.06.11.50.37; Fri, 06 Aug 2021 11:50:49 -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; 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 S231163AbhHFNtC (ORCPT + 99 others); Fri, 6 Aug 2021 09:49:02 -0400 Received: from zeniv-ca.linux.org.uk ([142.44.231.140]:40706 "EHLO zeniv-ca.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229581AbhHFNs6 (ORCPT ); Fri, 6 Aug 2021 09:48:58 -0400 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> Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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?