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=-2.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 0C029C433E0 for ; Wed, 10 Feb 2021 08:07:52 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8F60164DF5 for ; Wed, 10 Feb 2021 08:07:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8F60164DF5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 024E66B0070; Wed, 10 Feb 2021 03:07:51 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id F17686B0071; Wed, 10 Feb 2021 03:07:50 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DDF0F6B0072; Wed, 10 Feb 2021 03:07:50 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0144.hostedemail.com [216.40.44.144]) by kanga.kvack.org (Postfix) with ESMTP id C53136B0070 for ; Wed, 10 Feb 2021 03:07:50 -0500 (EST) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 8CF071854ADC0 for ; Wed, 10 Feb 2021 08:07:50 +0000 (UTC) X-FDA: 77801629500.23.dog31_0d0c16c2760e Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin23.hostedemail.com (Postfix) with ESMTP id 57B0E37608 for ; Wed, 10 Feb 2021 08:07:50 +0000 (UTC) X-HE-Tag: dog31_0d0c16c2760e X-Filterd-Recvd-Size: 4445 Received: from mail-io1-f52.google.com (mail-io1-f52.google.com [209.85.166.52]) by imf39.hostedemail.com (Postfix) with ESMTP for ; Wed, 10 Feb 2021 08:07:49 +0000 (UTC) Received: by mail-io1-f52.google.com with SMTP id n2so988580iom.7 for ; Wed, 10 Feb 2021 00:07:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:reply-to:from:date:message-id :subject:to:cc; bh=98mx76uaPdJqL0VhtaVU92mMJ6dVgmBYgimqJ+8i0UI=; b=O4WEm0xyaRW+E3d88T5ocr3SaTP/FpZmyScK7tiawMOmO7k/DmdjpLZc7VFNtgGEs8 vhJgV1K5OHZg44KvjQy7jvBEoqb54obKeIfTh0fAhOzjQ+zI4Xpbql6PIL91+oPJfJvW cGyl9M1MVB2gN3BxvHdeXtlEEuYtdqdJDbf/Vh0p8WHux07THNA0E/9fCq8xO5SHizhM kThMz2X5iR3Dr7eRdXGTuoZcBkv3eQ8QREs+0VTmMlbeqMw6YB7scmyQ9Zr6OuQmk8Qb UiN0Z7y7gKpiQLSu8YlBxhN3ZfRsjGs4IA+dkwi5cs3F86WcbMZmpV2XNJnjzIhdVJx8 zlUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=98mx76uaPdJqL0VhtaVU92mMJ6dVgmBYgimqJ+8i0UI=; b=WnW6XyETOToJaA0UdWHW9bMlePnsq1A076lq8TkPF2pV9Imxvd8CiMnso6z8SMqgeD xm5TzdaV8ejJOKap9Vo290kodpXBhF3s9ih9D0RJ1eO+oOp8ILTnS6HgB/Ukra7ouFei WfVWt0JI+2rRRJA4pcepsZgQzI5TXDj4p5EE17xocAU26mqJEqs26X6tQVGMYtCKAxJF pFWA/NY9/NxsSNs9egaE1FpcZfKdqnqJ6iPi5dcRU667gNs5tG9sgr0gUCDet9NnYeyu ZTyNOhmSVNxlTxxI0wMQo38KoWb+pBdx0Px5ZhC0vo1478x3u1f22cAnYJl6uIeQ3lz/ xxqA== X-Gm-Message-State: AOAM532sNyLyUXm/TRjgBhlb333N4UL0z9Pd4eKoyrC9dds1uhyoIE7z Rl3jMJg3P42OZep9fIj02k77qm6w+S/hbEba2no= X-Google-Smtp-Source: ABdhPJwNf7tFtRDQsW/ENn0nmrH2qUgHVU/kFEvAXxZxABDlzboo4kjWk/ogZAteD2hJUCqUjPudp/VXN4u3w3arT/U= X-Received: by 2002:a05:6638:2694:: with SMTP id o20mr2074509jat.132.1612944469295; Wed, 10 Feb 2021 00:07:49 -0800 (PST) MIME-Version: 1.0 References: <20210209023008.76263-1-axboe@kernel.dk> <20210209115542.3e407e306a4f1af29257c8f6@linux-foundation.org> <32dba5cc-7878-3b7b-45e4-84690a45a998@kernel.dk> In-Reply-To: <32dba5cc-7878-3b7b-45e4-84690a45a998@kernel.dk> Reply-To: sedat.dilek@gmail.com From: Sedat Dilek Date: Wed, 10 Feb 2021 09:07:44 +0100 Message-ID: Subject: Re: [PATCHSET v2 0/3] Improve IOCB_NOWAIT O_DIRECT reads To: Jens Axboe Cc: Andrew Morton , linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, hch@infradead.org Content-Type: text/plain; charset="UTF-8" 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 Tue, Feb 9, 2021 at 10:25 PM Jens Axboe wrote: > > 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, do you have some numbers before and after your patchset is applied? And kindly a test "profile" for FIO :-)? Thanks. - Sedat -