Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp774760pxk; Thu, 17 Sep 2020 16:19:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJkjKTixMcNHTIzkJP4tQ0qc1XIpoG6iSJ+e3YTcpol8wRMwmIpWpgs7h0ThymB02rWyL/ X-Received: by 2002:a17:907:213b:: with SMTP id qo27mr32307102ejb.441.1600384759969; Thu, 17 Sep 2020 16:19:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600384759; cv=none; d=google.com; s=arc-20160816; b=0xPq/EWs5OrW1UB5vv2g5ezvb6FqqGjEIIZcYCKd8e4ed/5KCfcM0dUpwLXkKLqOM2 01sDc00IVLD3Xmj9E7l/bnwEqDBe6OdK7L5Frl0WlWEwhOG0S5xg6NiqALn1v43adlqi Ug9a+aOcRSaSrC6+QVMcBSXIgEUsjXf4CW0j8YId638YePrqbThN5CNF4uEUEyiIxQ/Z Kzz2XyfNNt2omy7UJuvFVVVVYFpPXvIW8GrPAb9A3RFpZoFyvfjaXn+kzPBhsAkxhmAp 0J2W3qWQn8qctqsfbePRWlBva+iR3JW43Jo/p8bx6hgGuacvbZlbQzWbrzCIhW2K+taS +Spw== 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=3IZMOFHDfDgqgBMZv+C4q9OSWQXJrKtdRyzz00lZbe4=; b=NZ2w/WWNikIbYcy2/q9Eqc2xCOFEisBaQSgzfl0zoh++JJ8Ykx7o6oat1YmEYr6IWR BebxhtCjSEmlSUYXN1HVQxbjd8BsqyXzawXQzO3DCtAZaOmXZ44D50GxmixUV2vseyRx Mu8wwIJbDiXo5xsfcxcnhOe0cam1+H/hStkexSXzjx67cZi+zW2aBdWTEWEw7DYXELZu D5nkV1sJitO+AfLvwJxk+sRAlo4GmayrB8Be+yIHcXt49Vf9EiUnisQz9DbYQSa/bqY8 4MonlG2rvxZCLpHqrXi2HIaH9WEZdvYYKj4A7U88PMBAGIoiGPTgGTt+HYpvhzOZG8X6 jSpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=GOAffZN7; 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 d23si795504edt.338.2020.09.17.16.18.56; Thu, 17 Sep 2020 16:19:19 -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=GOAffZN7; 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 S1726179AbgIQXPC (ORCPT + 99 others); Thu, 17 Sep 2020 19:15:02 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:48584 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725886AbgIQXPC (ORCPT ); Thu, 17 Sep 2020 19:15:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600384501; 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=3IZMOFHDfDgqgBMZv+C4q9OSWQXJrKtdRyzz00lZbe4=; b=GOAffZN7VCBYzVD3y2M1CyPdKCXDJCZP78Ojg4+AyUTVZgSfyHJfsXDPNj8O1yqLUJAkva xEPRx4SKMLoAEqDXv0JNYYRtnd2pAUOHy+4EhsdGWDPnD3NP+xdijC8XsX0TOuizVEQMbA cJhieyC5slBUY8e7kEXGHiV7AJnjAOM= 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-518-M4VA2YllOCWBMzXqqOnuOQ-1; Thu, 17 Sep 2020 19:13:52 -0400 X-MC-Unique: M4VA2YllOCWBMzXqqOnuOQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3885864085; Thu, 17 Sep 2020 23:13:51 +0000 (UTC) Received: from T590 (ovpn-12-51.pek2.redhat.com [10.72.12.51]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1F0D160BEC; Thu, 17 Sep 2020 23:13:39 +0000 (UTC) Date: Fri, 18 Sep 2020 07:13:35 +0800 From: Ming Lei To: Christoph Hellwig Cc: Brian Foster , "Darrick J. Wong" , Dave Chinner , Ritesh Harjani , Anju T Sudhakar , linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, willy@infradead.org, minlei@redhat.com Subject: Re: [PATCH] iomap: Fix the write_count in iomap_add_to_ioend(). Message-ID: <20200917231335.GB1139137@T590> References: <20200822131312.GA17997@infradead.org> <20200824142823.GA295033@bfoster> <20200824150417.GA12258@infradead.org> <20200824154841.GB295033@bfoster> <20200825004203.GJ12131@dread.disaster.area> <20200825144917.GA321765@bfoster> <20200916001242.GE7955@magnolia> <20200916084510.GA30815@infradead.org> <20200916130714.GA1681377@bfoster> <20200917080455.GY26262@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200917080455.GY26262@infradead.org> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 17, 2020 at 09:04:55AM +0100, Christoph Hellwig wrote: > On Wed, Sep 16, 2020 at 09:07:14AM -0400, Brian Foster wrote: > > Dave described the main purpose earlier in this thread [1]. The initial > > motivation is that we've had downstream reports of soft lockup problems > > in writeback bio completion down in the bio -> bvec loop of > > iomap_finish_ioend() that has to finish writeback on each individual > > page of insanely large bios and/or chains. We've also had an upstream > > reports of a similar problem on linux-xfs [2]. > > > > The magic number itself was just pulled out of a hat. I picked it > > because it seemed conservative enough to still allow large contiguous > > bios (1GB w/ 4k pages) while hopefully preventing I/O completion > > problems, but was hoping for some feedback on that bit if the general > > approach was acceptable. I was also waiting for some feedback on either > > of the two users who reported the problem but I don't think I've heard > > back on that yet... > > I think the saner answer is to always run large completions in the > workqueue, and add a bunch of cond_resched() calls, rather than > arbitrarily breaking up the I/O size. Completion all ioend pages in single bio->end_bio() may pin too many pages unnecessary long, and adding cond_resched() can make the issue worse. thanks, Ming