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=-3.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS 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 14E4EC43461 for ; Sat, 12 Sep 2020 05:46:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 62697207EA for ; Sat, 12 Sep 2020 05:46:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="d8pFiNp1" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725833AbgILFbF (ORCPT ); Sat, 12 Sep 2020 01:31:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725801AbgILFbD (ORCPT ); Sat, 12 Sep 2020 01:31:03 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 69286C061573; Fri, 11 Sep 2020 22:31:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=0x/t0oX5H4dK+bk/bCWfoS6UtexU6TQHHM8GfgvOht0=; b=d8pFiNp1WzQ40/xFXvBgeTi0ZX vaf1GWLLPeagUSZkHgR6eIzz9keki3nMdCDdhwRfuLybtW06MZvfYRBGWnbrJMkG10Stq0GDAJ+hW kL8LDXC+AIUPRqneVdpf4Q4r3rQCbK9+1HFzR7zM3nFgj24b1FpugJwYsBZTo8kW5ap7Ecyu0+g8/ njsAjePLqTckEUfY8WgGJ+S7RAxPabejhJ8IEucxdgXd9tUAIziu4+Yi9MT5Mtgxl0rCsgyGqmQa5 BXzTyL8y3W+KqIaF+R6U5q/STbp8fobS9yA7qAtocYLTI9O2J8DXafbyUyt8WyLDoCMY6g/4HEZqP cSBZcB+A==; Received: from hch by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kGy7k-0004CY-PY; Sat, 12 Sep 2020 05:30:56 +0000 Date: Sat, 12 Sep 2020 06:30:56 +0100 From: Christoph Hellwig To: Naohiro Aota Cc: Christoph Hellwig , linux-btrfs@vger.kernel.org, David Sterba , Chris Mason , Josef Bacik , Hannes Reinecke , linux-fsdevel@vger.kernel.org Subject: Re: [PATCH v7 19/39] btrfs: limit bio size under max_zone_append_size Message-ID: <20200912053056.GA15640@infradead.org> References: <20200911123259.3782926-1-naohiro.aota@wdc.com> <20200911123259.3782926-20-naohiro.aota@wdc.com> <20200911141719.GA15317@infradead.org> <20200912041424.w4jhmsvrgtrcie2n@naota.dhcp.fujisawa.hgst.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200912041424.w4jhmsvrgtrcie2n@naota.dhcp.fujisawa.hgst.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org On Sat, Sep 12, 2020 at 01:14:24PM +0900, Naohiro Aota wrote: > > For zoned devices you need to use bio_add_hw_page instead of so that all > > the hardware restrictions are applied. bio_add_hw_page asso gets the > > lenght limited passed as the last parameter so we won't need a separate > > check. > > I think we can't use it here. This bio is built for btrfs's logical space, > so the corresponding request queue is not available here. > > Technically, we can use fs_devices->lateste_bdev. But considering this bio > can map to multiple bios to multiple devices, limiting the size of this bio > under the minimum queue_max_zone_appends_sectors() among devices is > feasible. Well, how do you then ensure the bio actually fits all the other device limits as well? e.g. max segment size, no SG gaps policy, etc?