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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1C737C433F5 for ; Thu, 28 Oct 2021 15:00:40 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7C99461040 for ; Thu, 28 Oct 2021 15:00:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 7C99461040 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.dk Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id CD7056B006C; Thu, 28 Oct 2021 11:00:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C85CE6B0071; Thu, 28 Oct 2021 11:00:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B4C846B0073; Thu, 28 Oct 2021 11:00:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0095.hostedemail.com [216.40.44.95]) by kanga.kvack.org (Postfix) with ESMTP id 8BB0B6B006C for ; Thu, 28 Oct 2021 11:00:38 -0400 (EDT) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id E7D4D2C6BB for ; Thu, 28 Oct 2021 15:00:37 +0000 (UTC) X-FDA: 78746157714.08.BE9B5AE Received: from mail-io1-f43.google.com (mail-io1-f43.google.com [209.85.166.43]) by imf30.hostedemail.com (Postfix) with ESMTP id 2C62FE00210D for ; Thu, 28 Oct 2021 15:00:26 +0000 (UTC) Received: by mail-io1-f43.google.com with SMTP id f9so8375093ioo.11 for ; Thu, 28 Oct 2021 08:00:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20210112.gappssmtp.com; s=20210112; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=OvysEMLpCWgv7nMDrXo9isdyt1MuhyUfY0l+6gwvOII=; b=1hyPM7a1nffa0V/4nJ7UZKypI9Q+LD282OvBS/Ci5fBw7QB9eOsuvGYxmkG7Vv+w2X 9UTmlxRi+JxjrAWKuUASOIgMzo2iHpJA+o71gy96KVSFOVlvDQlk1jVceNvO+2h9IeaA jLmjVKCO5d6bib5KqqNHcYvVtiK1V1BIbQVIZcH3t8/MuNs4U+NbRq3AIr0Inkoc3gRc dW9W0tQpcL0g94QtTTZfrfmhZ8mdPIvDEh9CqFRmrQyfQ/IaD6Qk7OHZhpEnVhcTwjxF HtxZDoKoZOB5A1FuVjbuyOVtQcac0+e7AIW8YwaGL/Z8+TLgeiiaUip/z5JQTTQy+HJX 2pbA== 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=OvysEMLpCWgv7nMDrXo9isdyt1MuhyUfY0l+6gwvOII=; b=ZO7Ahfki5J1vdDUR5lzBOXYSk2cLMhGYeW+JeFEV1WXdM/tdvNyG4utVez2c9Nmm92 4dMDpoN0B8XYUA3iLn5FjkXo+/rTL7LCtbiBI/NHf5vr74eAIDF0X1Ww2lr64ik3FnD0 l/61iFPJaxqznk9qTzLkyB2GCsXRsQoktoOXAn6KnsnSq8w/Ta8pHQFszWwpbQhMDIo7 5f4fxuCfSL5XXfoKhpBxXdhygNCjixwYYQYCl4pHon6vjHsjbq6Bsu+yvwHoLKEl0Jp+ sWvatPWUEQfY/9iv0jRgsKhqqHZCtSjmgMVWvxhk2CPvFk2iPqISpQvMiOhHP7cFuFSM FF8A== X-Gm-Message-State: AOAM532DJlhGQlhNaxq4f1kkaTAxWt41MDeP2X32wGNot8IpBpFb2f/v ctKEjIvd9gyE6+AiH55G55N+dw== X-Google-Smtp-Source: ABdhPJyGyQFJfrbjCwShQcQGgYq3VDwz5I/myxpK3tu5MmJm0lqGmO7XNRsNaQKLwj1wSfd3bQ9Aww== X-Received: by 2002:a6b:f816:: with SMTP id o22mr3605990ioh.106.1635433236229; Thu, 28 Oct 2021 08:00:36 -0700 (PDT) Received: from [192.168.1.30] ([207.135.234.126]) by smtp.gmail.com with ESMTPSA id x9sm1806103ill.83.2021.10.28.08.00.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 28 Oct 2021 08:00:34 -0700 (PDT) Subject: Re: mm: don't read i_size of inode unless we need it To: Christoph Hellwig Cc: Andrew Morton , Dave Chinner , "linux-fsdevel@vger.kernel.org" , Linux Memory Management List , Chris Mason , Pavel Begunkov References: <6b67981f-57d4-c80e-bc07-6020aa601381@kernel.dk> From: Jens Axboe Message-ID: Date: Thu, 28 Oct 2021 09:00:32 -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 X-Rspamd-Queue-Id: 2C62FE00210D Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=kernel-dk.20210112.gappssmtp.com header.s=20210112 header.b=1hyPM7a1; spf=pass (imf30.hostedemail.com: domain of axboe@kernel.dk designates 209.85.166.43 as permitted sender) smtp.mailfrom=axboe@kernel.dk; dmarc=none X-Stat-Signature: 5oi6q9ufiqhy8tch4ikb69zebp69n1ew X-Rspamd-Server: rspam06 X-HE-Tag: 1635433226-122748 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 10/28/21 8:19 AM, Christoph Hellwig wrote: > Btw, given that you're micro-optimizing in this area: > > block devices still use ->direct_IO in the I/O path. It might make > sense to switch to the model of the file systems that use iomap where > we avoid that indirect call and can optimize the code for the direct > I/O fast path. With that you woudn't even end up using this i_size_read > at all It's not a bad idea, we do kind of jump through some hoops here by calling generic_file_iter_read(), we should just check for dio upfront and handle that, falling back to filemap_read() if needed. -- Jens Axboe