From patchwork Tue Feb 9 02:30:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Axboe X-Patchwork-Id: 12077049 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=-11.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham 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 49AF0C433E0 for ; Tue, 9 Feb 2021 02:30:18 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7EE2164E82 for ; Tue, 9 Feb 2021 02:30:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7EE2164E82 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 E1B0C6B0005; Mon, 8 Feb 2021 21:30:16 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DA4B46B006C; Mon, 8 Feb 2021 21:30:16 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C6BA86B006E; Mon, 8 Feb 2021 21:30:16 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0005.hostedemail.com [216.40.44.5]) by kanga.kvack.org (Postfix) with ESMTP id AC9756B0005 for ; Mon, 8 Feb 2021 21:30:16 -0500 (EST) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 7868818134590 for ; Tue, 9 Feb 2021 02:30:16 +0000 (UTC) X-FDA: 77797150032.19.coat35_2e1526a27603 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin19.hostedemail.com (Postfix) with ESMTP id 594B81ACC3C for ; Tue, 9 Feb 2021 02:30:16 +0000 (UTC) X-HE-Tag: coat35_2e1526a27603 X-Filterd-Recvd-Size: 3419 Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) by imf46.hostedemail.com (Postfix) with ESMTP for ; Tue, 9 Feb 2021 02:30:15 +0000 (UTC) Received: by mail-pj1-f42.google.com with SMTP id l18so763407pji.3 for ; Mon, 08 Feb 2021 18:30:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=p8FMeR2iDUb+pnY3zeA5vegBZlcCW1eYs5QHWNmSbac=; b=Hfhf1Sl+ENVsH5K6DuM84ZIkF4FEGvtPE9VDNp0asrxHHYP1sh2dwmWlDqfON5u+VS NoQKeoIHNim9RguIN37CysLwS1IthE+b/2LnS3fRw4PjrALIVdSggcI2rzlKTgYVggvZ JBcO5Weqzg4ONY0qI14MQxbGKMtOfZWvfitphu7twWtH6VDIiKiz2ovuowv8PV3/6yQ1 6j8NHMyzCCwjwmBVawLPQttBLmcQAYDYQGUaCesw3o6jqzKzSz91qoUT5p3HySkQZthI JokqkCuwnPaHh7zKAXnOx8fPlFz/sx4JqSa9+wUfftj5mJFFnXZ66rbAfs1bvbwXwPT6 0g+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=p8FMeR2iDUb+pnY3zeA5vegBZlcCW1eYs5QHWNmSbac=; b=U/TpEDYRYEOHdSSE4HSgj4DuP3eE/k2lxFxmIr01WlXXZYGDhIcqlEYEanG748tfCg Ytbh7Eh8RgYcjhvw+eizB9NVBPZ2fhKFnBqO4gPEnv8Ntsmtkwa/JO64/FtRcT+tlhf7 d/B8NGIYi8GM5FaVozOxvrt/MovFCZdH8GRR/t1cli6awrhCZ3IPGcB9gGpIwcIJl5i6 nHv3ScZNpU2Yg/6jL2ZfIywphosBGHnX2dqoHyBndnNlRNKc7PmG0udAbi4O/eyLp2yL utm8LC2vKJQ9KIWhjbfbA8piaQ1CjziEQiR/ecXCH2ivaUCPUDoiYtQDQ6ys4Gd+3XZD fvVQ== X-Gm-Message-State: AOAM530+NZCR046duawBNpLuoN3Ah5+JT89NCK6DRQlibv4gWjUB4FG5 kHWV5RoglorY4K+XrL7ajOvZNA== X-Google-Smtp-Source: ABdhPJxCzFHzGm1phewsToczBmz1RG+OQ7sLKoAaPECWZXB937/8j5V39NCV++/Umg/mdS9vZIrzoA== X-Received: by 2002:a17:90a:c702:: with SMTP id o2mr1717835pjt.7.1612837814624; Mon, 08 Feb 2021 18:30:14 -0800 (PST) Received: from localhost.localdomain ([66.219.217.173]) by smtp.gmail.com with ESMTPSA id y2sm19070597pfe.118.2021.02.08.18.30.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Feb 2021 18:30:14 -0800 (PST) From: Jens Axboe To: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Cc: hch@infradead.org, akpm@linux-foundation.org Subject: [PATCHSET v2 0/3] Improve IOCB_NOWAIT O_DIRECT reads Date: Mon, 8 Feb 2021 19:30:05 -0700 Message-Id: <20210209023008.76263-1-axboe@kernel.dk> X-Mailer: git-send-email 2.30.0 MIME-Version: 1.0 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: 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. fs/iomap/direct-io.c | 23 ++++++++++++++-------- include/linux/fs.h | 2 ++ mm/filemap.c | 47 ++++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 62 insertions(+), 10 deletions(-) Since v1: - Simplify the filemap_range_needs_writeback() loop (Willy) - Drop the write side (Chinner)