Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1228464rwr; Wed, 3 May 2023 11:56:25 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5k8ozvV5BRX9u24IE+CxtmpXLcTt0B2JYMtAmW85EamFdfXESVK8jYimEo39IgcRLaEJHE X-Received: by 2002:a17:902:f687:b0:1a9:40d5:b0ae with SMTP id l7-20020a170902f68700b001a940d5b0aemr1001406plg.12.1683140184888; Wed, 03 May 2023 11:56:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683140184; cv=none; d=google.com; s=arc-20160816; b=IP2JBRjZAksXbjIKzTAkLtEs1tplUr7RdpcZadxulAQ1m/xjdkpqRpKBjK0xlyU1fK B/CGWWvugSSEwt2nsq7uK/a7EiqFyPnrcdheE6qQi9gapKGK3nyGWeE46BurvUrBDfuh DNCaCDBp2eFAVv5UfWhvBpW3g4Whz3NBGiTFxQXOpmu9UjRQQH+QxTp7bmVuNM6hsbQr tgXZuO0oiSSuv1F/H2somqIPif++PHboQGOSdvkRbEUBogqyBss2PgPIV4p7Lv6pt2Ak 89Wntjxt8wCCc4Dh3hO7e/EsybkSlGILA4HEjUxTifQnDfyjTfVs+mhHgEeTg9VtN/LY wV5w== 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=Z+MqBmgFQT9EAg68aVVWwOGnedZXDbTyS48leNsrMz8=; b=y1U+ZX0Pu+xnRD4ql/R6O8CAtCIRLHXzSaZAqODP3s/xWnOipD03ySMXBZOCXeNlnI PGVRw272npH+Ts3klPg36E4Xxh3V4PjrZD1X+ZLoZAIEkdYx8SupVghsNYgUsYZH4JX9 l1GW2EVy6hrhjC3JZ8+8A2Ar3mETocshhOXeR/R8L2aenDvFjkizjvTcUCZ8l80JbaJc 8ronM6qbVlTcjfAxN6UHyMiHYvHMR6mOiqdiZzEVGxFn0m8Ugb5Pk226cQrPXN3yoh6K n9qVVHXQZvoDRUhIuhMSmEb7Og2/w1JlhLqGQVHyMqYeticXd3uxfS6smauZRwqswMsd 8oyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=C1UFMFDL; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h11-20020a170902f54b00b001a6d4eab490si35690645plf.63.2023.05.03.11.56.10; Wed, 03 May 2023 11:56:24 -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.org header.s=k20201202 header.b=C1UFMFDL; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229624AbjECSxw (ORCPT + 99 others); Wed, 3 May 2023 14:53:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229515AbjECSxu (ORCPT ); Wed, 3 May 2023 14:53:50 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B9811BCA; Wed, 3 May 2023 11:53:48 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1A186628FB; Wed, 3 May 2023 18:53:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2D155C433EF; Wed, 3 May 2023 18:53:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1683140027; bh=Tt1IVHowAm04rV7fMokQMuz8wTkl3aCyv7RhwH49rX8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=C1UFMFDLq86Q5Uu322j2TdntYxiPuJOCbpIS7B6ayxvqLNiMGNapad5nAW/v5P5JW cBfTMV+BAg84mI/i2e4OKxY8q8XY3QenwEn/MfMlqjEYL3pLMRsJa8q5Vgi3rSNz2u aAn4CmqwI0ijiIwqpbK1hCzSarSQBXVhC+Bk9ohQ9VpOv53cB6iRHpXQ4+wSwWTjQt clw5Ti3m5jtb197SbHMoi0iJ1Yap1FVnhYGiKXe0mUkwoLq3pHzbeHTlO/B4tWsro0 h1a4Sl2gjYKiqUnjy42PJgBKq7qxp+SEltgCrHCLKZ/q9814CPM7o6fbNEtXkiIwwx 3DyWjGnKXwMiw== Date: Wed, 3 May 2023 12:53:43 -0600 From: Keith Busch To: John Garry Cc: axboe@kernel.dk, hch@lst.de, sagi@grimberg.me, martin.petersen@oracle.com, djwong@kernel.org, viro@zeniv.linux.org.uk, brauner@kernel.org, dchinner@redhat.com, jejb@linux.ibm.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-security-module@vger.kernel.org, paul@paul-moore.com, jmorris@namei.org, serge@hallyn.com Subject: Re: [PATCH RFC 06/16] block: Limit atomic writes according to bio and queue limits Message-ID: References: <20230503183821.1473305-1-john.g.garry@oracle.com> <20230503183821.1473305-7-john.g.garry@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230503183821.1473305-7-john.g.garry@oracle.com> X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 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 On Wed, May 03, 2023 at 06:38:11PM +0000, John Garry wrote: > + unsigned int size = (atomic_write_max_segments - 1) * > + (PAGE_SIZE / SECTOR_SIZE); Maybe use PAGE_SECTORS instead of recalculating it.