Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp1474411imn; Sun, 31 Jul 2022 08:21:55 -0700 (PDT) X-Google-Smtp-Source: AA6agR48tYHPX0JlT25SBHrYMAIK0/soPvjQdTiq4JDpnebhDlTXlNJtiZBMhPQGrJ05tbMD8+Nc X-Received: by 2002:a17:90b:1c85:b0:1f1:d78a:512b with SMTP id oo5-20020a17090b1c8500b001f1d78a512bmr15181947pjb.92.1659280914834; Sun, 31 Jul 2022 08:21:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659280914; cv=none; d=google.com; s=arc-20160816; b=EejCQNjhq55oP1RFmKoUWO8/AJClRvwocfLitpg2Fs+Pwo+82tmg+Mp0cUFz2Ykp1M V/iavhGapnsApYaHHDPmHvt5vf6M/BbbTKAcSufc+B12372pDIO+kG09PS4bJJvhOK7b 2bVqCbkpSAEsFPFpL4Z9wx3crXN7gdkPZPpxOnl0orrDIolEjuUulXFVuxkqE4Y4Z4NA WRBAnlseKMHHRXQFBVOnO2sZsAkSTZdupj3uDCvOBicStaXd4wS99IwjGFI7DRpeYAUs /g+/1UqVnLodXj6mJt+NACw3uYM2H5YoQFiwjBx4cGUdC2ORiGYuRXzwmQPAEzqWkwPG Cfyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language:cc:to :subject:from:user-agent:mime-version:date:message-id:dkim-signature; bh=CqarRD0qBma+nkDvEq8uD5MNW2b7at7eSJRZBX+iSRg=; b=nu0zFgpZ9CAg2Mx11UzZsBVPOTxJupsuxHrxjHoHQYqDvnw3qpmGIkUIU/ws0mNWz1 1eRBuvaVwaqp+4Kzlv1iDQipIBx5OdKo4DLBJ20v73Gfw1q+cjha5nRw/Zw1ZOwJtaZV Dalnr2B7eCsyU3hMcNAcBACLRyPCSHmjTCPb3f/iblce7nbUoZHrFzOi4apA0R6r9Pov /USie25MFx+lN1KboyO5hYFPNtiF8QNYNVaoiL1vN+6lzpF0vb6lOuz0YahDQuujx5e8 QIKUM0jO8UPfP6Abe0OI1SOsuquOpgwT9xRq5vcEIpjdIU5ZA1R8xkKj0YApdCalYsM+ I2xQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20210112.gappssmtp.com header.s=20210112 header.b=c+Lg4tTv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g9-20020a056a000b8900b0052b1cddb14asi10472977pfj.326.2022.07.31.08.21.40; Sun, 31 Jul 2022 08:21:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel-dk.20210112.gappssmtp.com header.s=20210112 header.b=c+Lg4tTv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233471AbiGaPDg (ORCPT + 99 others); Sun, 31 Jul 2022 11:03:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237068AbiGaPDe (ORCPT ); Sun, 31 Jul 2022 11:03:34 -0400 Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C960DEE4 for ; Sun, 31 Jul 2022 08:03:33 -0700 (PDT) Received: by mail-pf1-x435.google.com with SMTP id x4so1906052pfr.8 for ; Sun, 31 Jul 2022 08:03:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20210112.gappssmtp.com; s=20210112; h=message-id:date:mime-version:user-agent:from:subject:to:cc :content-language:content-transfer-encoding; bh=CqarRD0qBma+nkDvEq8uD5MNW2b7at7eSJRZBX+iSRg=; b=c+Lg4tTvxwhoOwnitw/8esS0JfRoc7588NH7ZMpcW3trPL7rLOUSI9E/7Fn9wyoTXR iqvu1jS9uH0faNEStn9gcKsXTyKXNAgsmqpYhSSGq9GPLziCD8YhniqMqEL1C6pEj1Pc x9DXY+9k/GIkN2xA3bfpjoUIqEL1v+nOIPfPx9A9YlQ8ZOTf+/wTMeWJr3nIvhmK/fud w0zhCeQpGtOBIYB1QuxuCw0VwqqN8reqSThtHucdOm3MJ+N4+sE+KafHGvTugfal/DqZ x1kOttY8idYKSHL64B/VsfAAZl6tTrvgoFWOsuvLGlEz36VhHp0nZOeUxRm7XFFOTKE3 96PQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:from :subject:to:cc:content-language:content-transfer-encoding; bh=CqarRD0qBma+nkDvEq8uD5MNW2b7at7eSJRZBX+iSRg=; b=o/9qDTygV6Ze6LGdJdmyiPMHc2PQAh/Irvq8OPLxNDecPFgOq7wVlJSj9GDnzP3fYw We/FdOkXHesn8J+cpfD+fmEJ4H3PsQNzyyiV3KmsoXL05ttrinbMK9j/w9IvW/TPFdfd tegqY3TSKJpapxs3/IMDrPiMBSgdhdtQ6kbORlMS2SDdx9G/G8MLpE5Kfeoeyixd+ekO PIHclr+ygKeYY0RboX0G9X5ejQLCuZnS2maZPXYAoFgHfNnipBGrTlBIqV46TOPTehnR lbK/j05o1lCDo1yTW7Rhpn1x5nzff8wPLsv86ZagOo9p+jiIVaXd++Pph4SOY5E+b9mm Zd5g== X-Gm-Message-State: AJIora/BEIibanNF+/o6FfeyJoWKGVNgveuWnffNWiPql0gZex0vv0dy h7GKL0pymTtrBnBPEwxRAzWe8lhdBd/oMw== X-Received: by 2002:a63:eb0d:0:b0:41b:7a15:1fbb with SMTP id t13-20020a63eb0d000000b0041b7a151fbbmr10085682pgh.511.1659279812442; Sun, 31 Jul 2022 08:03:32 -0700 (PDT) Received: from [192.168.1.100] ([198.8.77.157]) by smtp.gmail.com with ESMTPSA id u17-20020a170903125100b0016d33b8a231sm7582928plh.270.2022.07.31.08.03.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 31 Jul 2022 08:03:32 -0700 (PDT) Message-ID: Date: Sun, 31 Jul 2022 09:03:30 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 From: Jens Axboe Subject: [GIT PULL] io_uring support for buffered writes To: Linus Torvalds Cc: io-uring , linux-xfs@vger.kernel.org, LKML Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=1.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Linus, On top of the core io_uring changes for 5.20, this pull request contains support for buffered writes, specifically for XFS. btrfs is in progress, will be coming in the next release. io_uring does support buffered writes on any file type, but since the buffered write path just always -EAGAIN (or -EOPNOTSUPP) any attempt to do so if IOCB_NOWAIT is set, any buffered write will effectively be handled by io-wq offload. This isn't very efficient, and we even have specific code in io-wq to serialize buffered writes to the same inode to avoid further inefficiencies with thread offload. This is particularly sad since most buffered writes don't block, they simply copy data to a page and dirty it. With this pull request, we can handle buffered writes a lot more effiently. If balance_dirty_pages() needs to block, we back off on writes as indicated. This improves buffered write support by 2-3x. Jan Kara helped with the mm bits for this, and Stefan handled the fs/iomap/xfs/io_uring parts of it. Please pull! The following changes since commit f6b543fd03d347e8bf245cee4f2d54eb6ffd8fcb: io_uring: ensure REQ_F_ISREG is set async offload (2022-07-24 18:39:18 -0600) are available in the Git repository at: git://git.kernel.dk/linux-block.git tags/for-5.20/io_uring-buffered-writes-2022-07-29 for you to fetch changes up to 0dd316ba8692c2374fbb82cce57c0b23144f2977: mm: honor FGP_NOWAIT for page cache page allocation (2022-07-24 18:39:32 -0600) ---------------------------------------------------------------- for-5.20/io_uring-buffered-writes-2022-07-29 ---------------------------------------------------------------- Jan Kara (3): mm: Move starting of background writeback into the main balancing loop mm: Move updates of dirty_exceeded into one place mm: Add balance_dirty_pages_ratelimited_flags() function Jens Axboe (2): io_uring: fix issue with io_write() not always undoing sb_start_write() mm: honor FGP_NOWAIT for page cache page allocation Stefan Roesch (11): iomap: Add flags parameter to iomap_page_create() iomap: Add async buffered write support iomap: Return -EAGAIN from iomap_write_iter() fs: add a FMODE_BUF_WASYNC flags for f_mode fs: add __remove_file_privs() with flags parameter fs: Split off inode_needs_update_time and __file_update_time fs: Add async write file modification handling. io_uring: Add support for async buffered writes io_uring: Add tracepoint for short writes xfs: Specify lockmode when calling xfs_ilock_for_iomap() xfs: Add async buffered write support fs/inode.c | 168 +++++++++++++++++++++++++++++----------- fs/iomap/buffered-io.c | 67 ++++++++++++---- fs/read_write.c | 4 +- fs/xfs/xfs_file.c | 11 ++- fs/xfs/xfs_iomap.c | 11 ++- include/linux/fs.h | 4 + include/linux/writeback.h | 7 ++ include/trace/events/io_uring.h | 25 ++++++ io_uring/rw.c | 41 ++++++++-- mm/filemap.c | 4 + mm/page-writeback.c | 89 +++++++++++++-------- 11 files changed, 323 insertions(+), 108 deletions(-) -- Jens Axboe