Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp761977yba; Fri, 5 Apr 2019 17:17:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqz9nl6A6vqoGdsYaFDtB6+VTXUaccMWhbYQQG0llWaKy7ShoqxBezzMxGzmwzjrJ5JQ36PV X-Received: by 2002:a62:2046:: with SMTP id g67mr15493036pfg.121.1554509878116; Fri, 05 Apr 2019 17:17:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554509878; cv=none; d=google.com; s=arc-20160816; b=wybLB7tyJvU3nUcDMZ9n/YPBjbgWyEcK9h083xGPYJEhP7XMFsIKSU2mfLoXZ9bhbc pBqjYKZIIagqyTMAtLEJEztXbD1XsgZ6OzJcCFKJaFtem34qJhryFpuuLnIQMm8nH1NR 1/KAOaKUlWWeSo36/udGwz1WrqbdAux55PHIF1b3upWhJUDVWgJ3dNHpBUxgZ4iHEJtm kncpT3PyzPzV2Ugl7cPwDgGeJLe+rHygm7IYVaKSmc7v/dihWdsl4cYJyGk6ogZTh4uU mphmubB2q9AQ0qpDZJtVx3VXYQ7MxL2kTWCvZP8cgBNOVQGV+YJW3M0k9PHlnDDaaPmI PxSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=oTvqG1A7UmJ9C5QqjN7pX2dKaXGpVTVNmhV8EW6ojE4=; b=JtuICEho/wAPnxlNS9WYuGTCJYafuOVGiPWSM+ceAL+nrcGLnZUWca7XjFzLuY6OGs dCAoQ28+EKtdE7zFTJ7bV25U9NpWCRmZV67Xig3wuyrVcnasj+f9u70iR2iA7Y00DnMz xq61FXzfobjmKSIFKBTTb8to2OM0H0nYOQl5pRvcjqXv8Z0eK3T1tiBsyjGRyDrP54Qc 0jSU76yzLXNDroIHbDC1DtHcms9XZps+ysmZeK0fbqIKPI8ELYzdf3rfKJMSsyYIGL5U EvRlmLZVyBZaSDk862J5bI9GGD2tnSDF31fVkhXeI77AUrcKl6NWT8hOqytDdKAy1CcA 6y2Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c15si19898757pga.465.2019.04.05.17.17.40; Fri, 05 Apr 2019 17:17:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726397AbfDFARF (ORCPT + 99 others); Fri, 5 Apr 2019 20:17:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42958 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725973AbfDFARE (ORCPT ); Fri, 5 Apr 2019 20:17:04 -0400 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 mx1.redhat.com (Postfix) with ESMTPS id 1479E3082231; Sat, 6 Apr 2019 00:17:04 +0000 (UTC) Received: from ming.t460p (ovpn-8-16.pek2.redhat.com [10.72.8.16]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 74FA919C56; Sat, 6 Apr 2019 00:16:58 +0000 (UTC) Date: Sat, 6 Apr 2019 08:16:54 +0800 From: Ming Lei To: Nikolay Borisov Cc: Jens Axboe , Omar Sandoval , linux-block@vger.kernel.org, LKML , linux-btrfs Subject: Re: Possible bio merging breakage in mp bio rework Message-ID: <20190406001653.GA4805@ming.t460p> References: <59c19acf-999f-1911-b0b8-1a5cec8116c5@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <59c19acf-999f-1911-b0b8-1a5cec8116c5@suse.com> User-Agent: Mutt/1.9.1 (2017-09-22) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Sat, 06 Apr 2019 00:17:04 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Nikolay, On Fri, Apr 05, 2019 at 07:04:18PM +0300, Nikolay Borisov wrote: > Hello Ming, > > Following the mp biovec rework what is the maximum > data that a bio could contain? Should it be PAGE_SIZE * bio_vec There isn't any maximum data limit on the bio submitted from fs, and block layer will make the final bio sent to driver correct by applying all kinds of queue limit, such as max segment size, max segment number, max sectors, ... > or something else? Currently I can see bios as large as 127 megs > on sequential workloads, I got prompted to this since btrfs has a > memory allocation that is dependent on the data in the bio and this > particular memory allocation started failing with order 6 allocs. Could you share us the code? I don't see why order 6 allocs is a must. > Further debugging showed that with the following xfs_io command line: > > > xfs_io -f -c "pwrite -S 0x61 -b 4m 0 10g" /media/scratch/file1 > > I can easily see very large bios: > > [ 188.366540] kworker/-7 3.... 34847519us : btrfs_submit_bio_hook: bio: ffff8dffe9940bb0 bi_iter.bi_size = 134184960 bi_vcn: 28 bi_vcnt_max: 256 > [ 188.367129] kworker/-658 2.... 34946536us : btrfs_submit_bio_hook: bio: ffff8dffe9940370 bi_iter.bi_size = 134246400 bi_vcn: 28 bi_vcnt_max: 256 > [ 188.367714] kworker/-7 3.... 35107967us : btrfs_submit_bio_hook: bio: ffff8dffe9940bb0 bi_iter.bi_size = 134184960 bi_vcn: 30 bi_vcnt_max: 256 > [ 188.368319] kworker/-658 2.... 35229894us : btrfs_submit_bio_hook: bio: ffff8dffe9940370 bi_iter.bi_size = 134246400 bi_vcn: 32 bi_vcnt_max: 256 > [ 188.368909] kworker/-7 3.... 35374809us : btrfs_submit_bio_hook: bio: ffff8dffe9940bb0 bi_iter.bi_size = 134184960 bi_vcn: 25 bi_vcnt_max: 256 > [ 188.369498] kworker/-658 2.... 35516194us : btrfs_submit_bio_hook: bio: ffff8dffe9940370 bi_iter.bi_size = 134246400 bi_vcn: 31 bi_vcnt_max: 256 > [ 188.370086] kworker/-7 3.... 35663669us : btrfs_submit_bio_hook: bio: ffff8dffe9940bb0 bi_iter.bi_size = 134184960 bi_vcn: 32 bi_vcnt_max: 256 > [ 188.370696] kworker/-658 2.... 35791006us : btrfs_submit_bio_hook: bio: ffff8dffe9940370 bi_iter.bi_size = 100655104 bi_vcn: 24 bi_vcnt_max: 256 > [ 188.371335] kworker/-658 2.... 35816114us : btrfs_submit_bio_hook: bio: ffff8dffe99434f0 bi_iter.bi_size = 33591296 bi_vcn: 5 bi_vcnt_max: 256 > > > So that's 127 megs in a single bio? This stems from the new merging logic. > 07173c3ec276 ("block: enable multipage bvecs") made it so that physically > contiguous pages added to the bio would just modify bi_iter.bi_size and the > initial page's bio_vec's bv_len. There's no longer the > page == bv->bv_page portion of the check. bio_add_page() tries best to put physically contiguous pages into one bvec, and I don't see anything is wrong in the log. Could you show us what the real problem is? Thanks, Ming