Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2475357rdb; Sun, 3 Dec 2023 19:45:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IFZr60v+HyfToeaal3o6q9NECkJU7juMy9qnm0KlBNunjPgEM04mpFqLzVZoeG7A2+Ach2j X-Received: by 2002:a05:6a00:8e02:b0:6ce:4e33:bb0 with SMTP id io2-20020a056a008e0200b006ce4e330bb0mr814893pfb.49.1701661523718; Sun, 03 Dec 2023 19:45:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701661523; cv=none; d=google.com; s=arc-20160816; b=d8AavnaJx2UH81xSvTgmXgXDeAEisR+F2//ZhWSidOSOF0CAE5XBWCKS30O3DsXpEP zz743qaA9iRdgc6JewEv7dZvIZUsw+ztwuMCZ5xtAwaEccyq/3fBM7/KL8Y2+t7VPaGs ZC42P6w605n4xZ/DSXRfHrBo2fiwhBwSHUZQq2MbAcdPl0Lp+lyzibjnKqlO+d6ZDt9G rqQ45S0M85JHXK5dHfng/u3SH2vHsPOYsFeG51QTQ54Hm9We572vB+G4Gu17IRgSD8tE 2LjSi7Vt/SslbCppwqph/EdKvjpMv+9CT0c+YPs3DuYXh7IHm+o56TvzeYCR7gWLGC+V 4k/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=U/8NhmEkKsnS3yGp4kPzlQrXQUn9SGOxqKqcsuy2+78=; fh=1LDghv6GIt73tyaB8z523EX0SCW2yus2eDffFhJDmuc=; b=j8LMvLUPjMHU6TiEzqKDtfuwu+wJrfFZThcdeISYpy7x1gbKxMHofJhuCV6F2EkzFX Fjr0DgsfSoyBvJ9spcK4SC2/JpeNBLva4MPNgQAw7p7EbYO3hsli/dEbU1VFxEWQU8TU AyFAG11xYPaEL/Ha/Mnaz4BidPQSnlICggW0hF/cYRKNuJKYA7qWnw5SvU5Dv58jU0tF eo3ma3G8J99Vv9sTxa8QdrGyC0G4Sp8hHMciZZwr3ekeb/TLkvYLIzRDCvryuFK8YmMQ dn7a8dDkNOm6Fh3eutURk6/zdVfa4Y8qP8ZZTO3Q2a+89/Fx9LR90dPaLWkdLydDnswZ EXFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=AqgcSGr6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id p14-20020a056a000a0e00b006cd8754211esi7274588pfh.250.2023.12.03.19.45.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Dec 2023 19:45:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=AqgcSGr6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 5030D8074E08; Sun, 3 Dec 2023 19:45:21 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234378AbjLDDTg (ORCPT + 99 others); Sun, 3 Dec 2023 22:19:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229510AbjLDDTf (ORCPT ); Sun, 3 Dec 2023 22:19:35 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2221F3 for ; Sun, 3 Dec 2023 19:19:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701659981; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=U/8NhmEkKsnS3yGp4kPzlQrXQUn9SGOxqKqcsuy2+78=; b=AqgcSGr6sHpfzLaAlnLM15hKZIC0EPM7yAksr9qqTHmqhfzlqx4igIZrOhAlhEIC2TXCc7 A7u4H2dEW3gjf6lR6l348dalPDJ+e3lZpATOBOsm+zwVNJu5hI3Pdtm2spemTKK0fd/f7Q msIreM5mJmd7AtiwjR6OHXzw1jSSRPE= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-394-GsIBFQb0P16dN48r9X5BBw-1; Sun, 03 Dec 2023 22:19:36 -0500 X-MC-Unique: GsIBFQb0P16dN48r9X5BBw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 24CEC8007B3; Mon, 4 Dec 2023 03:19:35 +0000 (UTC) Received: from fedora (unknown [10.72.120.8]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5A2001C060AE; Mon, 4 Dec 2023 03:19:24 +0000 (UTC) Date: Mon, 4 Dec 2023 11:19:20 +0800 From: Ming Lei To: John Garry Cc: axboe@kernel.dk, kbusch@kernel.org, hch@lst.de, sagi@grimberg.me, jejb@linux.ibm.com, martin.petersen@oracle.com, djwong@kernel.org, viro@zeniv.linux.org.uk, brauner@kernel.org, chandan.babu@oracle.com, dchinner@redhat.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, tytso@mit.edu, jbongio@google.com, linux-api@vger.kernel.org, ming.lei@redhat.com Subject: Re: [PATCH 02/21] block: Limit atomic writes according to bio and queue limits Message-ID: References: <20230929102726.2985188-1-john.g.garry@oracle.com> <20230929102726.2985188-3-john.g.garry@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230929102726.2985188-3-john.g.garry@oracle.com> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Sun, 03 Dec 2023 19:45:21 -0800 (PST) On Fri, Sep 29, 2023 at 10:27:07AM +0000, John Garry wrote: > We rely the block layer always being able to send a bio of size > atomic_write_unit_max without being required to split it due to request > queue or other bio limits. > > A bio may contain min(BIO_MAX_VECS, limits->max_segments) vectors, > and each vector is at worst case the device logical block size from > direct IO alignment requirement. Both unit_max and unit_min are applied to FS bio, which is built over single userspace buffer, so only the 1st and last vector can include partial page, and the other vectors should always cover whole page, then the minimal size could be: (max_segments - 2) * PAGE_SIZE + 2 * queue_logical_block_size(q) Thanks, Ming