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.2 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 50454C43460 for ; Fri, 21 May 2021 07:35:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2F8516135B for ; Fri, 21 May 2021 07:35:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236133AbhEUHhM (ORCPT ); Fri, 21 May 2021 03:37:12 -0400 Received: from verein.lst.de ([213.95.11.211]:46821 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230050AbhEUHhM (ORCPT ); Fri, 21 May 2021 03:37:12 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 17A246736F; Fri, 21 May 2021 09:35:47 +0200 (CEST) Date: Fri, 21 May 2021 09:35:47 +0200 From: Christoph Hellwig To: Ming Lei Cc: Christoph Hellwig , Brian Foster , "Darrick J. Wong" , Dave Chinner , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: iomap: writeback ioend/bio allocation deadlock risk Message-ID: <20210521073547.GA11955@lst.de> References: <20210521071727.GA11473@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org On Fri, May 21, 2021 at 03:31:05PM +0800, Ming Lei wrote: > > iomap_ioend_bioset is sized to make sure we can always complete up > > to 4 pages, and the list is only used inside a page, so we're fine. > > The number itself does not matter, because there isn't any limit on how > many ioends can be allocated before submitting, for example, it can be > observed that 64 ioends is allocated before submitting when writing > 5GB file to ext4. So far the reserved pool size is 32. How do you manage to allocate iomap ioends when writing to ext4? ext4 doesn't use iomap for buffered I/O. > > fs_bio_set always has two entries to allow exactly for the common > > chain and submit pattern. > > It is easy to trigger dozens of chained bios in one ioend when writing > big file to XFS. Yes, we can still have one chained bio per ioend, so we need a bioset with the same size as iomap_ioend_bioset. That still should not be dozends for a common setup, though.