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=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 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 EA498C433E0 for ; Tue, 5 Jan 2021 18:40:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B69D522D5B for ; Tue, 5 Jan 2021 18:40:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727375AbhAESkW (ORCPT ); Tue, 5 Jan 2021 13:40:22 -0500 Received: from verein.lst.de ([213.95.11.211]:34117 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726653AbhAESkW (ORCPT ); Tue, 5 Jan 2021 13:40:22 -0500 Received: by verein.lst.de (Postfix, from userid 2407) id 21ADC67373; Tue, 5 Jan 2021 19:39:39 +0100 (CET) Date: Tue, 5 Jan 2021 19:39:38 +0100 From: Christoph Hellwig To: Ming Lei Cc: Jens Axboe , linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, Christoph Hellwig , Alexander Viro , "Darrick J . Wong" , linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [RFC PATCH] fs: block_dev: compute nr_vecs hint for improving writeback bvecs allocation Message-ID: <20210105183938.GA3878@lst.de> References: <20210105132647.3818503-1-ming.lei@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210105132647.3818503-1-ming.lei@redhat.com> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org At least for iomap I think this is the wrong approach. Between the iomap and writeback_control we know the maximum size of the writeback request and can just use that. Take a look at what iomap_readpage_actor does on the read size, something similar taking the wbc into account can be done on the writeback side.