Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2183734pxa; Mon, 24 Aug 2020 07:30:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzVYpcS8pOTlY/41SLYZR3MuvY+7SKbEScxAUWTI7jH6DK5SsPQYong/UujF9o3FptlYRg2 X-Received: by 2002:a17:906:2cc2:: with SMTP id r2mr5740636ejr.482.1598279429854; Mon, 24 Aug 2020 07:30:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598279429; cv=none; d=google.com; s=arc-20160816; b=IPkavisT4dxC2RW80K2H2fK0F+1FV9p2nEw1sPBFcjn16OARZ4Bi7/qlqpmMgSHb7U 8/o6o7ct9l0Ao+EYWo1JXAe9WfbZ9sellpw5epWBQVR6vEmz7g914cC9mDEFWzMXbnA0 Y0nK6rk47rr85lztmGufq3H9sy3ATLiocNMhIVn6hyxfVa48NzPoFGuoR+7LVTfTAM6T TZMFg89bSPVCHCLkqVFUl5IDx9pI8RVaQkmObRQW5pB4esljtHD127mXfXDyadaMejsN s3uEZeI9Wc/E5Ht0tOPibXw+lqZ3S9Xtmz9YzRdGVFwMdHsVMiIzS3XSGYtxtFD9o2Z+ sERQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=fI05Fs4HjD1Fspp+mWg44gsKdGpjEIRqNmomRhV5I5A=; b=AbNLu5U8V1NGvl1aCxquDU0I+d4yBP82vdecEY2WWgGPIY68tBi5CJDCKFlos3FhsD ZWc3iQ2WwMCLklivtKbWq7vn2R7qCZ8kkG0XySQnL1dShhTSp6rmzC5km6IENzcLe4hB 0gbMpoBnTT6toBLCagQ6kQU4frd2QKwV3TRyqb8njBCpbaNIMXE7cgCkO1RedOF3uZOy lOGVbO4YWNOw/AEq703IHX6Iy+Kwh5XqSBHDeaYfALXYGMXKfmtlSpChrmD8tINV9C14 leAeVyRINJWycTh3eshwpLyGDYmYa5GY6hICiDFHeVTrqC9rTIILh4UFy7d5OTXZR9Xo c/Ow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=gvn438qF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a20si6354505ejf.632.2020.08.24.07.30.05; Mon, 24 Aug 2020 07:30:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=gvn438qF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725968AbgHXO2i (ORCPT + 99 others); Mon, 24 Aug 2020 10:28:38 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:58584 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725973AbgHXO2b (ORCPT ); Mon, 24 Aug 2020 10:28:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598279309; 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=fI05Fs4HjD1Fspp+mWg44gsKdGpjEIRqNmomRhV5I5A=; b=gvn438qFxjroBE6OVNCIbn4wnC2wqqSPdVim0bLRHF+cyTj7my4Ktn0Jz3yXZwLzFAdQNp si1wVy0PzlYRD2JZMdoMJtsMyw6iOFTEtsbYdYqOuLDijJnN738pCSAiDKKEUyCO2lx2wg e2MMAIdtZFDab+/6btblVeK65gGJDnQ= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-560-XFK-FZUrPsutsyHWEvahyw-1; Mon, 24 Aug 2020 10:28:27 -0400 X-MC-Unique: XFK-FZUrPsutsyHWEvahyw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5FB7F81F018; Mon, 24 Aug 2020 14:28:26 +0000 (UTC) Received: from bfoster (ovpn-112-11.rdu2.redhat.com [10.10.112.11]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7B1F727CD4; Mon, 24 Aug 2020 14:28:25 +0000 (UTC) Date: Mon, 24 Aug 2020 10:28:23 -0400 From: Brian Foster To: Christoph Hellwig Cc: Dave Chinner , Ritesh Harjani , Anju T Sudhakar , darrick.wong@oracle.com, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, willy@infradead.org Subject: Re: [PATCH] iomap: Fix the write_count in iomap_add_to_ioend(). Message-ID: <20200824142823.GA295033@bfoster> References: <20200819102841.481461-1-anju@linux.vnet.ibm.com> <20200820231140.GE7941@dread.disaster.area> <20200821044533.BBFD1A405F@d06av23.portsmouth.uk.ibm.com> <20200821215358.GG7941@dread.disaster.area> <20200822131312.GA17997@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200822131312.GA17997@infradead.org> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Aug 22, 2020 at 02:13:12PM +0100, Christoph Hellwig wrote: > On Sat, Aug 22, 2020 at 07:53:58AM +1000, Dave Chinner wrote: > > but iomap only allows BIO_MAX_PAGES when creating the bio. And: > > > > #define BIO_MAX_PAGES 256 > > > > So even on a 64k page machine, we should not be building a bio with > > more than 16MB of data in it. So how are we getting 4GB of data into > > it? > > BIO_MAX_PAGES is the number of bio_vecs in the bio, it has no > direct implication on the size, as each entry can fit up to UINT_MAX > bytes. > Do I understand the current code (__bio_try_merge_page() -> page_is_mergeable()) correctly in that we're checking for physical page contiguity and not necessarily requiring a new bio_vec per physical page? With regard to Dave's earlier point around seeing excessively sized bio chains.. If I set up a large memory box with high dirty mem ratios and do contiguous buffered overwrites over a 32GB range followed by fsync, I can see upwards of 1GB per bio and thus chains on the order of 32+ bios for the entire write. If I play games with how the buffered overwrite is submitted (i.e., in reverse) however, then I can occasionally reproduce a ~32GB chain of ~32k bios, which I think is what leads to problems in I/O completion on some systems. Granted, I don't reproduce soft lockup issues on my system with that behavior, so perhaps there's more to that particular issue. Regardless, it seems reasonable to me to at least have a conservative limit on the length of an ioend bio chain. Would anybody object to iomap_ioend growing a chain counter and perhaps forcing into a new ioend if we chain something like more than 1k bios at once? Brian