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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id EB3BCC48BC4 for ; Sat, 17 Feb 2024 09:31:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 18C628D0003; Sat, 17 Feb 2024 04:31:37 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 13BEA8D0002; Sat, 17 Feb 2024 04:31:37 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 02A228D0003; Sat, 17 Feb 2024 04:31:36 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id E8F7E8D0002 for ; Sat, 17 Feb 2024 04:31:36 -0500 (EST) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 8CB2BA009E for ; Sat, 17 Feb 2024 09:31:36 +0000 (UTC) X-FDA: 81800778192.06.21F5606 Received: from dggsgout11.his.huawei.com (dggsgout11.his.huawei.com [45.249.212.51]) by imf30.hostedemail.com (Postfix) with ESMTP id 875E680003 for ; Sat, 17 Feb 2024 09:31:32 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf30.hostedemail.com: domain of yi.zhang@huaweicloud.com designates 45.249.212.51 as permitted sender) smtp.mailfrom=yi.zhang@huaweicloud.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1708162294; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KpLE2rGbJ6sbiJOIldiJ9Eopu+RVpOiHYwltSHIT8lM=; b=VzeyINakSjMnPFnkZVVfOG1BZR2mx9jikx5D4Z0nP9Zgb3RQ53Q5diwng9NhcCui2xbzMJ fHLIvQdyYF3t9pzaIsB9q1MeWeC4sDMC5JATxnHgDZeZFd2H713bUW0D7WoOOmtaTNVFzj x5YcCbGaKHGVU/BuUsidzOPGO3ezq1E= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf30.hostedemail.com: domain of yi.zhang@huaweicloud.com designates 45.249.212.51 as permitted sender) smtp.mailfrom=yi.zhang@huaweicloud.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1708162294; a=rsa-sha256; cv=none; b=Tf3BXZvVzkGLbAZs0pGCuI7kkoLIn3LhehJ1P5dw1/pFZaAmCjXCq+IeZoDrNlzs3t3EM/ JR/MLp8gH9LyaZRbQLLZsGj6TKPbi7fgbR6IHGW9XSjJ3I8gkTKMk+wJDGyTZ5KfbTDs5h 8LRuM3+dRhngXbKxAc2dRm4JhMGUROA= Received: from mail.maildlp.com (unknown [172.19.163.235]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4TcNpb4vj5z4f3m72 for ; Sat, 17 Feb 2024 17:31:19 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.112]) by mail.maildlp.com (Postfix) with ESMTP id A9E891A0232 for ; Sat, 17 Feb 2024 17:31:26 +0800 (CST) Received: from [10.174.176.34] (unknown [10.174.176.34]) by APP1 (Coremail) with SMTP id cCh0CgAn9g7nfNBlPbkfEQ--.27281S3; Sat, 17 Feb 2024 17:31:20 +0800 (CST) Subject: Re: [RFC PATCH v3 00/26] ext4: use iomap for regular file's buffered IO path and enable large foilo To: "Darrick J. Wong" Cc: linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, tytso@mit.edu, adilger.kernel@dilger.ca, jack@suse.cz, ritesh.list@gmail.com, hch@infradead.org, willy@infradead.org, zokeefe@google.com, yi.zhang@huawei.com, chengzhihao1@huawei.com, yukuai3@huawei.com, wangkefeng.wang@huawei.com References: <20240127015825.1608160-1-yi.zhang@huaweicloud.com> <20240212061842.GB6180@frogsfrogsfrogs> From: Zhang Yi Message-ID: Date: Sat, 17 Feb 2024 17:31:18 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <20240212061842.GB6180@frogsfrogsfrogs> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-CM-TRANSID:cCh0CgAn9g7nfNBlPbkfEQ--.27281S3 X-Coremail-Antispam: 1UD129KBjvJXoWxZFyDXw4rCF1xAryDXrWkWFg_yoW5trW8pF Z09Fy3Krs5Kry8Wa92vw4Utr4j9w4rGr47JFy3Wry7ZF4DCF1SgFn7KF1Yva98Ar4fG340 vF4UA34xuan0yrJanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUvIb4IE77IF4wAFF20E14v26ryj6rWUM7CY07I20VC2zVCF04k2 6cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4 vEj48ve4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Ar0_tr1l84ACjcxK6xIIjxv20xvEc7Cj xVAFwI0_Cr0_Gr1UM28EF7xvwVC2z280aVAFwI0_GcCE3s1l84ACjcxK6I8E87Iv6xkF7I 0E14v26rxl6s0DM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40E x7xfMcIj6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x 0Yz7v_Jr0_Gr1lF7xvr2IY64vIr41lFIxGxcIEc7CjxVA2Y2ka0xkIwI1lc7I2V7IY0VAS 07AlzVAYIcxG8wCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c 02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_GFv_ WrylIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7 CjxVAFwI0_Gr0_Cr1lIxAIcVCF04k26cxKx2IYs7xG6rWUJVWrZr1UMIIF0xvEx4A2jsIE 14v26r1j6r4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf 9x07UZ18PUUUUU= X-CM-SenderInfo: d1lo6xhdqjqx5xdzvxpfor3voofrz/ X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 875E680003 X-Stat-Signature: 6xqf5y6zmrm4qu7ssg8i16ion51hz5c4 X-Rspam-User: X-HE-Tag: 1708162292-538832 X-HE-Meta: U2FsdGVkX1/aeWncK0XOHr5NJ0S/IVDnKokIQVrBBew1vNUDgbme00C4pDDcLAxkPi97ll37kcNab0opB5/owqBZQxBh69wkefB4mbgjcnCvuo8U7jajLNQouz75yaZzIjiOrGL34bbEJbk/mGNak6w4DL+WQ79rHWCCJX077R3I2vYDIppzJpIgk4kT/PPU8Md26Xp8iCZs7KJhBD/3QA2nX+InBqTnzPhNjmLlEQF7vAr9xN6L1FhQ0w7vBu9cHsFxZtEqnkK3xjHDqrlhrFaaT2v+QOUU0dpbfs/SzgkGBJQaD6/Xrc3FxGN8ZBkkf6mneOISdJuVDghlnIcEE0ek6gk08cI41wFDKDEBCvCqX5bD3VjxEmVVFsLR5vri37R6ocWog8aRPInA65ZPxLOWNoZVm5ic9LxDpnqQ/ujoD1SdN54wX6d3lGYCW4nNv+edEdWsAGgMern3Z42fF+DQQiFP/oxFUDggsSvjNZ4xdEotxnVM9PeisRbOTWpjUhKUVUzz/9pp27495YVIqCbWm0Yhh9jXA08ATBLxMzY6FUCURFFLJD6+yEBrgBT0AUGeAIjenBriby5N8D0aJ+vEtrx5oXmRVRNzWpTWqPiUMzDUSBCEzLSj5hcAbDpE1mMmTZb33RrWG8/bv+pvdgeKKQI8jd++f1wTUBUDX1NDXXg/7g4jpEfjqyhAJvcrzro1u8yCEzUsQd1ofsAysSzyR+vhXYbgrOor4dQRcQCnmWCtgLca+cv9AMZwKPslrijkD0SSpdKXhxaRGG4BIqvctmt4hG8E+J34Rlisr5mTWUgUd9gl2b9dw+rkz8UeK+02htsyI5r6KIuywe0OHSeiWA/Uf+6C9XDlWUIslLAY20deYOIj33kIE0sCP7D274RoD6BwmTyyB9t4OWjC+wbK2eX2fBqAWW4NHdy3zRPNoZzHdTEjsl8MV2yGSECnVR+KgP5sfCu0vZai6Js hMj1NOv3 7vyXEIKEr1dkEBBhuzSv+2PK7hwl1XSHEYukFO1dfxNKT+q4+V+dkn8OkUdtHQZO2YUll4UsS8kfbj8mbYXI2W1lhTffRBW4lMK/MdpV7tYOaiIfdlRPmFZW7oboqwMaVAktVJK2OfvlEpgDHlyWSUiPiEy/SjFSnnXv/f/i5ggpwtewv8sUNtzUGrmOwD++fSrX+XdRhFPDGTPK4v6CQ6gKg/A== 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: List-Subscribe: List-Unsubscribe: On 2024/2/12 14:18, Darrick J. Wong wrote: > On Sat, Jan 27, 2024 at 09:57:59AM +0800, Zhang Yi wrote: >> From: Zhang Yi >> >> Hello, >> >> This is the third version of RFC patch series that convert ext4 regular >> file's buffered IO path to iomap and enable large folio. It's rebased on >> 6.7 and Christoph's "map multiple blocks per ->map_blocks in iomap >> writeback" series [1]. I've fixed all issues found in the last about 3 >> weeks of stress tests and fault injection tests in v2. I hope I've >> covered most of the corner cases, and any comments are welcome. :) >> >> Changes since v2: >> - Update patch 1-6 to v3 [2]. >> - iomap_zero and iomap_unshare don't need to update i_size and call >> iomap_write_failed(), introduce a new helper iomap_write_end_simple() >> to avoid doing that. >> - Factor out ext4_[ext|ind]_map_blocks() parts from ext4_map_blocks(), >> introduce a new helper ext4_iomap_map_one_extent() to allocate >> delalloc blocks in writeback, which is always under i_data_sem in >> write mode. This is done to prevent the writing back delalloc >> extents become stale if it raced by truncate. >> - Add a lock detection in mapping_clear_large_folios(). >> Changes since v1: >> - Introduce seq count for iomap buffered write and writeback to protect >> races from extents changes, e.g. truncate, mwrite. >> - Always allocate unwritten extents for new blocks, drop dioread_lock >> mode, and make no distinctions between dioread_lock and >> dioread_nolock. >> - Don't add ditry data range to jinode, drop data=ordered mode, and >> make no distinctions between data=ordered and data=writeback mode. >> - Postpone updating i_disksize to endio. >> - Allow splitting extents and use reserved space in endio. >> - Instead of reimplement a new delayed mapping helper >> ext4_iomap_da_map_blocks() for buffer write, try to reuse >> ext4_da_map_blocks(). >> - Add support for disabling large folio on active inodes. >> - Support online defragmentation, make file fall back to buffer_head >> and disable large folio in ext4_move_extents(). >> - Move ext4_nonda_switch() in advance to prevent deadlock in mwrite. >> - Add dirty_len and pos trace info to trace_iomap_writepage_map(). >> - Update patch 1-6 to v2. >> >> This series only support ext4 with the default features and mount >> options, doesn't support inline_data, bigalloc, dax, fs_verity, fs_crypt >> and data=journal mode, ext4 would fall back to buffer_head path > > Do you plan to add bigalloc or !extents support as a part 2 patchset? Hello, Sorry for the late reply since I was on the vacation of Chinese New Year. I've been working on bigalloc support recently and it's going relatively well, but have no plans to support !extents yet, I would start looking into it after I finish rebasing my another patch set "ext4: more accurate metadata reservaion for delalloc mount option" mentioned in my TODO list. > > An ext2 port to iomap has been (vaguely) in the works for a while, > though iirc willy never got the performance to match because iomap > didn't have a mechanism for the caller to tell it "run the IO now even > though you don't have a complete page, because the indirect block is the > next block after the 11th block". > Thanks for pointing this out and the explanation given by Matthew. IIUC, this problem also affects ext4 in !extents mode, but not affects bigalloc, right? Thanks, Yi.