Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp1445974pxb; Sun, 11 Apr 2021 20:25:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy3hTjOdvzOJCjcDKq5s7Lqy3zkx6tJNZ/TxwRGJE3jcbg4ILnZorWmELql5bMcSToJAemd X-Received: by 2002:a50:fd16:: with SMTP id i22mr27197134eds.239.1618197952824; Sun, 11 Apr 2021 20:25:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618197952; cv=none; d=google.com; s=arc-20160816; b=S+zyHfmzkk9WtMC4gq+HK8aFrqbgREkQVgWx8abm2u/yaS9ZEwT5juHXGvhr30YTcR jJOZ7Gk5Kz/TonQfExMvbcP7/7Zor4LqFqAnV4/l3xIEhClWSqf9ozPhzCsbAcnFK+Cq T2UrMKaVxk1SbzW/tI2P2+3psW3myO7PmAXntnukU09OjFVwRc+fEmhLi4KZazIyK5PZ HnG4UwXjkufEIqe5DKxuF5L3nqiBn5ZBJ+XmwWpzZVXP8i0nBiuVi/9QFKj+GOlEomwp dbDK+oiS6KHpeJw+y8V9WVxn2wyW2LWJQ8zj+187mwiO+cD4HBlfmvEsngIquBIPoTN+ PfVA== 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=Q+/toeVQ76anYVr5hc380+UCtnXRU8K/Er2NqGMCyn8=; b=lcERj3S9gBN7VqGAFpPziH6p0EusY2J7LiyzbmVeMO0w9TvaedEWTkNyWGhN2FBAYH ioZggpAE/0o8onFQFMjelfgUQA9RMslcCW6c4+lY2ZAk4f4iQA+jHP/hcl2kaM6rpP1O W1aHrI7GtJusrJDeYunfwSYHQBfTJwMDT22VWHFs9kxIR1mlMdsjCP4lvuEdazfm2ukv ZjYwnjLJiELSjhRLGEyW6JEJPiAfJL6JpE0me5bhpvsbqf8g7WPuT/W1vLbQAJ4Y54iL azfnOk8mBJ6cdo3+Rmfl0qNT7usTkRYsMZP+lsMosb+2bxJpMuIduocTX3jRqx1Oqv7e t8zA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QEImEfCx; 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 m19si6996411edc.561.2021.04.11.20.25.30; Sun, 11 Apr 2021 20:25:52 -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=QEImEfCx; 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 S235234AbhDLDYJ (ORCPT + 99 others); Sun, 11 Apr 2021 23:24:09 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:49645 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236411AbhDLDYF (ORCPT ); Sun, 11 Apr 2021 23:24:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1618197828; 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=Q+/toeVQ76anYVr5hc380+UCtnXRU8K/Er2NqGMCyn8=; b=QEImEfCxBbBID0skkt8RpURK+QVR/LoVOwlUgnvbub4jhmPmGu8pvQKmZrF6gSwqKsh9qd jmDr/mJcjkGFk0bAa+irajKUUcxeb25WG3+bOHmOTI1KdlY23242WuagJ33uPvoEkbLB3d AjSPTeQ6gQY8/y+506wm20QkcrSDXSU= 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-478-wbFTiyLaOxq0WlOvUiGhLw-1; Sun, 11 Apr 2021 23:23:46 -0400 X-MC-Unique: wbFTiyLaOxq0WlOvUiGhLw-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 25307107ACCA; Mon, 12 Apr 2021 03:23:44 +0000 (UTC) Received: from T590 (ovpn-12-103.pek2.redhat.com [10.72.12.103]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 83B16610A8; Mon, 12 Apr 2021 03:23:29 +0000 (UTC) Date: Mon, 12 Apr 2021 11:23:25 +0800 From: Ming Lei To: Damien Le Moal Cc: Bart Van Assche , Changheun Lee , "gregkh@linuxfoundation.org" , Johannes Thumshirn , "asml.silence@gmail.com" , "axboe@kernel.dk" , "hch@infradead.org" , "jisoo2146.oh@samsung.com" , "junho89.kim@samsung.com" , "linux-block@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "mj0123.lee@samsung.com" , "osandov@fb.com" , "patchwork-bot@kernel.org" , "seunghwan.hyun@samsung.com" , "sookwan7.kim@samsung.com" , "tj@kernel.org" , "tom.leiming@gmail.com" , "woosung2.lee@samsung.com" , "yt0928.kim@samsung.com" Subject: Re: [RESEND,v5,1/2] bio: limit bio max size Message-ID: References: <20210407092836.13016-1-nanich.lee@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Apr 11, 2021 at 10:13:01PM +0000, Damien Le Moal wrote: > On 2021/04/09 23:47, Bart Van Assche wrote: > > On 4/7/21 3:27 AM, Damien Le Moal wrote: > >> On 2021/04/07 18:46, Changheun Lee wrote: > >>> I'll prepare new patch as you recommand. It will be added setting of > >>> limit_bio_size automatically when queue max sectors is determined. > >> > >> Please do that in the driver for the HW that benefits from it. Do not do this > >> for all block devices. > > > > Hmm ... is it ever useful to build a bio with a size that exceeds > > max_hw_sectors when submitting a bio directly to a block device, or in > > other words, if no stacked block driver sits between the submitter and > > the block device? Am I perhaps missing something? > > Device performance wise, the benefits are certainly not obvious to me either. > But for very fast block devices, I think the CPU overhead of building more > smaller BIOs may be significant compared to splitting a large BIO into multiple > requests. Though it may be good to revisit this with some benchmark numbers. This patch tries to address issue[1] in do_direct_IO() in which Changheun observed that other operations takes time between adding page to bio. However, do_direct_IO() just does following except for adding bio and submitting bio: - retrieves pages at batch(pin 64 pages each time from VM) and - retrieve block mapping(get_more_blocks), which is still done usually very less times for 32MB; for new mapping, clean_bdev_aliases() may take a bit time. If there isn't system memory pressure, pin 64 pages won't be slow, but get_more_blocks() may take a bit time. Changheun, can you check if multiple get_more_blocks() is called for submitting 32MB in your test? In my 32MB sync dio f2fs test on x86_64 VM, one buffer_head mapping can hold 32MB, but it is one freshly new f2fs. I'd suggest to understand the issue completely before figuring out one solution. [1] https://lore.kernel.org/linux-block/20210202041204.28995-1-nanich.lee@samsung.com/ Thanks, Ming