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=-5.5 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 C35F9C433E0 for ; Tue, 9 Feb 2021 20:11:58 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A4D1F64ECB for ; Tue, 9 Feb 2021 20:11:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A4D1F64ECB Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.dk Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 24FE66B006C; Tue, 9 Feb 2021 15:11:57 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1AF4A6B006E; Tue, 9 Feb 2021 15:11:57 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 029A86B0070; Tue, 9 Feb 2021 15:11:56 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0055.hostedemail.com [216.40.44.55]) by kanga.kvack.org (Postfix) with ESMTP id D75716B006C for ; Tue, 9 Feb 2021 15:11:56 -0500 (EST) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 96893180445E2 for ; Tue, 9 Feb 2021 20:11:56 +0000 (UTC) X-FDA: 77799825432.29.cart76_0304a402760a Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin29.hostedemail.com (Postfix) with ESMTP id 6A1B918020C37 for ; Tue, 9 Feb 2021 20:11:56 +0000 (UTC) X-HE-Tag: cart76_0304a402760a X-Filterd-Recvd-Size: 4588 Received: from mail-io1-f51.google.com (mail-io1-f51.google.com [209.85.166.51]) by imf26.hostedemail.com (Postfix) with ESMTP for ; Tue, 9 Feb 2021 20:11:55 +0000 (UTC) Received: by mail-io1-f51.google.com with SMTP id f20so6609048ioo.10 for ; Tue, 09 Feb 2021 12:11:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=l6WEwLkb2xy2/U0iy3Xy7JNwk+HVvUNszayLkKhjccg=; b=Z5YpwGg4VqyRP4sS3NjVEYzyqvsMqoVzKJFdJRvgySsfLXuj+4g51FQv7laeuDjbK/ WkjVW3P7YRJm5dan4lwtyid+A3NtH26DAW5gQAyF91b3n5U7G543cmlPFfhm87HH78qf eXfYxkSfc7/7UCHC5xB+MPOLyEiijUfJTWxmmhTzSh6RdH+kuefG1Egkm6z6a3+AsEfk mB+56F7MwSeTs5xWDqX+pm5nbvPWLasnto16x8rJmZ5ArdC3mnt3czSVZUFRpmEAyNjl YBDri2oTR1TCRJ4X+eoZnpQfFKzEGY01/Do2JFg4Qfz3/Bs9B3qn/lFG034GQ6b3sUx2 tnSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; 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=l6WEwLkb2xy2/U0iy3Xy7JNwk+HVvUNszayLkKhjccg=; b=s7iWo8cqhGejS75b33x2+3WukLgiBPPBe4LcQalqzAG4hizn/dWq6Tbp97RmS3ZyE4 v6JBIrDJyx5vZukJBuOee77Ko5MY7BVu7kOYQ9qvIXN/QZUHF5v4G42ZbOqaNBqyVMo+ MpXlK7MoVjgeObBJYvetYf7uOLRz+E4lYIxQc0ZzIqZt9dU8QnCV3nxvtw6tZY8n5Uwu gK5On6qEphAeAOdKTnU1h0KfLbsaEPGoXj9rgncAf8k7j5z2untprUfgC2O1cisVO8c8 mz3nAqvzVaR2ZzZQZ4vq2Gm8UbTF+dC4hNTjJw5LeUi7mPei3ltlfoCe5GJzOS/q/nkM i1xg== X-Gm-Message-State: AOAM532gOLaKGAqXabBCShn0uPhrwO6JirFGGSv+7HpUtph2/iw4eZpo ut0PgKfbzo0IkCyAjnCZK2cICA== X-Google-Smtp-Source: ABdhPJxBV4JmG8c9o+4rIIGWzH552WvaEd8txOY2QEoNd9EsHL9oGHmfTXY3FSoFra7b774RnO+qjg== X-Received: by 2002:a6b:680e:: with SMTP id d14mr20634422ioc.74.1612901515134; Tue, 09 Feb 2021 12:11:55 -0800 (PST) Received: from [192.168.1.30] ([65.144.74.34]) by smtp.gmail.com with ESMTPSA id b1sm4393212iob.42.2021.02.09.12.11.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 09 Feb 2021 12:11:54 -0800 (PST) Subject: Re: [PATCHSET v2 0/3] Improve IOCB_NOWAIT O_DIRECT reads To: Andrew Morton Cc: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, hch@infradead.org References: <20210209023008.76263-1-axboe@kernel.dk> <20210209115542.3e407e306a4f1af29257c8f6@linux-foundation.org> From: Jens Axboe Message-ID: <32dba5cc-7878-3b7b-45e4-84690a45a998@kernel.dk> Date: Tue, 9 Feb 2021 13:11:52 -0700 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: <20210209115542.3e407e306a4f1af29257c8f6@linux-foundation.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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 2/9/21 12:55 PM, Andrew Morton wrote: > On Mon, 8 Feb 2021 19:30:05 -0700 Jens Axboe wrote: > >> Hi, >> >> For v1, see: >> >> https://lore.kernel.org/linux-fsdevel/20210208221829.17247-1-axboe@kernel.dk/ >> >> tldr; don't -EAGAIN IOCB_NOWAIT dio reads just because we have page cache >> entries for the given range. This causes unnecessary work from the callers >> side, when the IO could have been issued totally fine without blocking on >> writeback when there is none. >> > > Seems a good idea. Obviously we'll do more work in the case where some > writeback needs doing, but we'll be doing synchronous writeout in that > case anyway so who cares. Right, I think that'll be a round two on top of this, so we can make the write side happier too. That's a bit more involved... > Please remind me what prevents pages from becoming dirty during or > immediately after the filemap_range_needs_writeback() check? Perhaps > filemap_range_needs_writeback() could have a comment explaining what it > is that keeps its return value true after it has returned it! It's inherently racy, just like it is now. There's really no difference there, and I don't think there's a way to close that. Even if you modified filemap_write_and_wait_range() to be non-block friendly, there's nothing stopping anyone from adding dirty page cache right after that call. -- Jens Axboe