From patchwork Wed Feb 24 16:44:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Axboe X-Patchwork-Id: 12102145 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 42A50C433E0 for ; Wed, 24 Feb 2021 16:45:11 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C295C64F07 for ; Wed, 24 Feb 2021 16:45:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C295C64F07 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 7C64E6B0070; Wed, 24 Feb 2021 11:45:09 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 717466B0072; Wed, 24 Feb 2021 11:45:09 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5C7648D0001; Wed, 24 Feb 2021 11:45:09 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0047.hostedemail.com [216.40.44.47]) by kanga.kvack.org (Postfix) with ESMTP id 3D26A6B0005 for ; Wed, 24 Feb 2021 11:45:09 -0500 (EST) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id ED1256130 for ; Wed, 24 Feb 2021 16:45:08 +0000 (UTC) X-FDA: 77853736296.26.487D018 Received: from mail-io1-f49.google.com (mail-io1-f49.google.com [209.85.166.49]) by imf18.hostedemail.com (Postfix) with ESMTP id 3EF3020003A7 for ; Wed, 24 Feb 2021 16:45:01 +0000 (UTC) Received: by mail-io1-f49.google.com with SMTP id f6so2641335iop.11 for ; Wed, 24 Feb 2021 08:44:59 -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=SMzB5LYCHoM595ZIb+y1ol2dkADnSvukLtKLVnTqze0=; b=AVQCxkz5J4nfCA0mAe3Mnbrck5888vMIEE8QcIC4O2wdwMyeRam9GbdoiXPuRB32aG w260s+ZSC6tLi4JlZgTQFprJtoPfSWY+ZPxT/UlkqMZ++65Ct0+SPhgLQvQi7LTdLO/q t7jPsMB/zIKeK8GBpcQ0dFAMvC3bNQPesJps96nImAUF8zxBncnSJdxUgUbbF4SGYIkY aomSzUO8Jx93QibP4GYnRN/5L6fzRKZeQoUcprc6QiUs96MpB2fvlMrPhfyrOl/Lj7sE truEaH6BJmnYYuGQKKEW5G26mtBaDTZYhXoX27LE8dZJBgZGykSvLQ9VIzUlMCmTto/E k7aw== 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=SMzB5LYCHoM595ZIb+y1ol2dkADnSvukLtKLVnTqze0=; b=iDoFxD77MuDxTCmJUpTX1ORmCkJ0G24UzY40EZEbnKZl3We3Y8b8SiwxuPmww3qpHy IOmkT3jxKP8Xg11ljnLT8thBW2wVZFLNhT5VYVelrnyAgB6EUUt/S4JVsyFGfFRgO5V5 L8zAJjL78dOWAcXqPoPPaf00XadtVyVFdmYCbUTslYdJn9P7R9HM1oyzqRqBmQKHfd1o dxnVSyNz7AFjhJVVUWZXOphbrVOS6vsIxsUEYmQixq+TfIJU4pGfUMdBSMKM4o/G2kYv vekCHhW2n35WExuSKlHY4huDAnZcuEk8fdPNiWdEHneKhblGzN00GHbiw2ZvamBA44Z5 T43A== X-Gm-Message-State: AOAM531g2TxMXKEBlfHGS60SygN2YXXGaKOnAvVkiVMA4JIBogpHsM3i ngZzUDQ0fXS4LxZCRw16RY6PsA== X-Google-Smtp-Source: ABdhPJy+7CORlpmRxO8v25KgBy7jYkJ9ubA/L4EAP4TUDCUTmCXjqmxrfuHJc8Z4nT/tLMCnzan+pw== X-Received: by 2002:a5d:8f9a:: with SMTP id l26mr21653310iol.106.1614185098674; Wed, 24 Feb 2021 08:44:58 -0800 (PST) Received: from p1.localdomain ([65.144.74.34]) by smtp.gmail.com with ESMTPSA id f1sm2273652iov.3.2021.02.24.08.44.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Feb 2021 08:44:57 -0800 (PST) From: Jens Axboe To: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Cc: akpm@linux-foundation.org Subject: [PATCHSET v3 0/3] Improve IOCB_NOWAIT O_DIRECT reads Date: Wed, 24 Feb 2021 09:44:52 -0700 Message-Id: <20210224164455.1096727-1-axboe@kernel.dk> X-Mailer: git-send-email 2.30.0 MIME-Version: 1.0 X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 3EF3020003A7 X-Stat-Signature: gi3mh77ruf3joum8duyye5et1q1ghumq Received-SPF: none (kernel.dk>: No applicable sender policy available) receiver=imf18; identity=mailfrom; envelope-from=""; helo=mail-io1-f49.google.com; client-ip=209.85.166.49 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1614185101-234134 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 | 24 ++++++++++++++-------- include/linux/fs.h | 2 ++ mm/filemap.c | 47 ++++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 63 insertions(+), 10 deletions(-) Andrew, any chance you can pick this up for 5.12? Since v2: - Drop overly long line (hch) - Rebase to master, iomap changed flags to iomap_flags