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=-8.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 B62AEC388F7 for ; Tue, 3 Nov 2020 15:55:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6880020786 for ; Tue, 3 Nov 2020 15:55:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=toxicpanda-com.20150623.gappssmtp.com header.i=@toxicpanda-com.20150623.gappssmtp.com header.b="iheDPy/1" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728038AbgKCPza (ORCPT ); Tue, 3 Nov 2020 10:55:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727385AbgKCPza (ORCPT ); Tue, 3 Nov 2020 10:55:30 -0500 Received: from mail-qv1-xf42.google.com (mail-qv1-xf42.google.com [IPv6:2607:f8b0:4864:20::f42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DAFA8C0617A6 for ; Tue, 3 Nov 2020 07:55:28 -0800 (PST) Received: by mail-qv1-xf42.google.com with SMTP id w5so7936123qvn.12 for ; Tue, 03 Nov 2020 07:55:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toxicpanda-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=xntI1Eh9eVZ6JRxBdXbXC8WJsIu2fowBRTDPt6GSCek=; b=iheDPy/1LDw3gOT5myZy8oQu83yskwZbKNqX8AM+j4cQ+K7LpyUFnWoEI3J+UTKULD clwl2CafijxvWOTnBR+3WmDooQbIuGbuPWk3+BUP3bNZs5FE7mQ/RFG1hbLE4s5YpdoB hiuTNfrPgWHYwvYl89C6l3X43K/SH6g1P0erj6oi3khX+QtkzWd1MSy2thjzoUmGr3kv TYMqIDa26o3MJB1ZiU+MSN/tnyurGKGXIRkos5K4y0ha2waGCV2yRZbWTGFOqiif0rWY 36xkeRY/HtOwEj9Iwel3boqWQkfjeyEIoCVA0kA05EENw0yBzR8YQr10Xi8IL4b7TfOz iiYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=xntI1Eh9eVZ6JRxBdXbXC8WJsIu2fowBRTDPt6GSCek=; b=JoW5C/Y3nwtlvcpyu9wunhdd3/EN9xj5LcRgsrTRkAWm5UufXdfVk772+a87PBj757 R3Vaed02hym/kpwgMAKYB+5Xpi8CNiBgEHAuUomMT5zlkMf+Y2TYk2H8tc5YwweJbIgv suwA2bKDe3ROVxdRV7OCNhjImCg/os/+xl+FaH2mr2xvpqLdmeqMi3fWQxd42x0pGXui 8UPqUZm5bMl4nSpQQxQRkjFOV0gMWn2FCJlCg1xBD9IqukPOXzzD1HiciFFv2PiUbD+y CDIb0w3Ex77/+ANPHbUkDAzIbIlupQm3iLsdz6MdGGfKRO7vkedtoJQwCyAu+0Hggnbc sUQw== X-Gm-Message-State: AOAM532Roq3wYaTJD7ez+RaTZbbQOg1Guu/vd81hi5R1Xiy0fT1BhjA/ 0wg8wR7sU18427n7PRFl//F0tA== X-Google-Smtp-Source: ABdhPJyJe7L2bBqeKx348QnpfIwy4XjQ9JkwLVS8hE4oJ3f3VKgn3OLBALKOZ5rx0RJ6IChiyFaPyQ== X-Received: by 2002:ad4:4e34:: with SMTP id dm20mr20662286qvb.40.1604418927964; Tue, 03 Nov 2020 07:55:27 -0800 (PST) Received: from [192.168.1.45] (cpe-174-109-172-136.nc.res.rr.com. [174.109.172.136]) by smtp.gmail.com with ESMTPSA id q70sm10384537qka.87.2020.11.03.07.55.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 03 Nov 2020 07:55:27 -0800 (PST) Subject: Re: [PATCH v9 25/41] btrfs: use ZONE_APPEND write for ZONED btrfs To: Naohiro Aota , linux-btrfs@vger.kernel.org, dsterba@suse.com Cc: hare@suse.com, linux-fsdevel@vger.kernel.org, Johannes Thumshirn References: <51cdc96d68f84eb93a310a96b6b7ad6e070dd1ac.1604065695.git.naohiro.aota@wdc.com> From: Josef Bacik Message-ID: <85ca7f8a-5d7c-d00c-2f34-4d5966b332f8@toxicpanda.com> Date: Tue, 3 Nov 2020 10:55:26 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: <51cdc96d68f84eb93a310a96b6b7ad6e070dd1ac.1604065695.git.naohiro.aota@wdc.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org On 10/30/20 9:51 AM, Naohiro Aota wrote: > This commit enables zone append writing for zoned btrfs. When using zone > append, a bio is issued to the start of a target zone and the device > decides to place it inside the zone. Upon completion the device reports > the actual written position back to the host. > > Three parts are necessary to enable zone append in btrfs. First, modify > the bio to use REQ_OP_ZONE_APPEND in btrfs_submit_bio_hook() and adjust > the bi_sector to point the beginning of the zone. > > Secondly, records the returned physical address (and disk/partno) to the > ordered extent in end_bio_extent_writepage() after the bio has been > completed. We cannot resolve the physical address to the logical address > because we can neither take locks nor allocate a buffer in this end_bio > context. So, we need to record the physical address to resolve it later in > btrfs_finish_ordered_io(). > > And finally, rewrites the logical addresses of the extent mapping and > checksum data according to the physical address (using __btrfs_rmap_block). > If the returned address matches the originally allocated address, we can > skip this rewriting process. > > Signed-off-by: Johannes Thumshirn > Signed-off-by: Naohiro Aota I hate this, but I suppose its better than forcing us to wait for ordered extents in order of submission, and I can't really think of anything better, Reviewed-by: Josef Bacik Thanks, Josef