Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3221058pxk; Mon, 21 Sep 2020 08:11:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwOy+eE/GJN+GwzwNvnExplfv/mKWd2th9UU0rnrLPknH93FMr2i7ADb9z7AtMv5Y9sof5f X-Received: by 2002:a17:906:f11:: with SMTP id z17mr51950494eji.88.1600701088761; Mon, 21 Sep 2020 08:11:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600701088; cv=none; d=google.com; s=arc-20160816; b=Y/AIAFAljeu0Hy90KJMIIwekW7eRPnD0wL1v3BqE1ViLa1MzdAGSBY6jTiHWeAe0nW oWacoLvrkmOwQ4r+YiBW+SWrv73IIzzHnPEityHKZk7mljAWd8DN9XAFNngW+q28fI85 y2hZOlp1Y22kt/sWgv2ApSAD5E0VdJAgRdZfbXk5CS6yf+k3Kd5vfWPNAzFKDWbk4v9s 7276p+3tC7e83YWKt3+n6v5tiTRkz0+LynQMYiXqVJX83I8LfA9wxWtCZ09xf29znt1K 0yaCHe3MfwkhCCtRNnmX2CUksEiYMEuD3i05HwGhGgT6y3tNrDXttGN6x2mihq5nQgig aQ1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:subject :autocrypt:from:references:cc:to; bh=8uObNwA78ggf6Hsumy/3o5WMSaSBCboLoD//rA83AD4=; b=X9pJae7G120XP0kQfocqxkO/taZHh+ty1urDrsQKiGgTTrge6dzxJlhBc/VV2TAIIm njCWfHA1V1/KNDP9G+T3guYp8X+QSMMB2pQ/6dXef9Ak6vwgWjg/5YNWpKiHlenUITRv V6C+t11ln/z7AP09VrhQqEjeHuAxfFznpN3ecrzOelZS9AT7clkuDmTGJz53PQpn4Hy/ NRPCz0ilo2MqdJ63HzprOPldd4bPmuBCE/yxj9jXi0C2M6LH1qFQEJ3LdQ2y05UtFD4k bVuEwD1cipbg80T71AwG/Sg4k8Es0t6TfgGxn0MJ76NMD95CXF97HNaYlIoBNxjr5S9o jKsg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r21si6545185eda.589.2020.09.21.08.11.03; Mon, 21 Sep 2020 08:11:28 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727557AbgIUPKB (ORCPT + 99 others); Mon, 21 Sep 2020 11:10:01 -0400 Received: from mx2.suse.de ([195.135.220.15]:46852 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726688AbgIUPKA (ORCPT ); Mon, 21 Sep 2020 11:10:00 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 427FAB31C; Mon, 21 Sep 2020 15:10:34 +0000 (UTC) To: Christoph Hellwig Cc: Jens Axboe , Song Liu , Hans de Goede , Richard Weinberger , Minchan Kim , Johannes Thumshirn , Justin Sanders , linux-mtd@lists.infradead.org, dm-devel@redhat.com, linux-block@vger.kernel.org, linux-bcache@vger.kernel.org, linux-kernel@vger.kernel.org, drbd-dev@lists.linbit.com, linux-raid@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, cgroups@vger.kernel.org References: <20200921080734.452759-1-hch@lst.de> <20200921080734.452759-4-hch@lst.de> <20200921140010.GA14672@lst.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cSZX2x/5+KkQx9wHwackw5gDCvAdZ+Q81nm6tRxEYBBiVDQZYqO73stgT ZyrkxykUbQIy8PI+g7XMDCMnPiDncQqgf96KR3cvw4wN8QrgA6xRo8xOc2C3X7jTMQUytCz9 0MyV1QARAQABiQI8BBgBCAAmAhsMFiEE6j5FL/T5SGCN6PrQxzkHk2t9+PwFAlxHziAFCRj7 5/EACgkQxzkHk2t9+PxgfA//cH5R1DvpJPwraTAl24SUcG9EWe+NXyqveApe05nk15zEuxxd e4zFEjo+xYZilSveLqYHrm/amvQhsQ6JLU+8N60DZHVcXbw1Eb8CEjM5oXdbcJpXh1/1BEwl 4phsQMkxOTns51bGDhTQkv4lsZKvNByB9NiiMkT43EOx14rjkhHw3rnqoI7ogu8OO7XWfKcL CbchjJ8t3c2XK1MUe056yPpNAT2XPNF2EEBPG2Y2F4vLgEbPv1EtpGUS1+JvmK3APxjXUl5z 6xrxCQDWM5AAtGfM/IswVjbZYSJYyH4BQKrShzMb0rWUjkpXvvjsjt8rEXpZEYJgX9jvCoxt oqjCKiVLpwje9WkEe9O9VxljmPvxAhVqJjX62S+TGp93iD+mvpCoHo3+CcvyRcilz+Ko8lfO hS9tYT0HDUiDLvpUyH1AR2xW9RGDevGfwGTpF0K6cLouqyZNdhlmNciX48tFUGjakRFsxRmX K0Jx4CEZubakJe+894sX6pvNFiI7qUUdB882i5GR3v9ijVPhaMr8oGuJ3kvwBIA8lvRBGVGn 9xvzkQ8Prpbqh30I4NMp8MjFdkwCN6znBKPHdjNTwE5PRZH0S9J0o67IEIvHfH0eAWAsgpTz +jwc7VKH7vkvgscUhq/v1/PEWCAqh9UHy7R/jiUxwzw/288OpgO+i+2l11Y= Subject: Re: [PATCH 03/13] bcache: inherit the optimal I/O size Message-ID: <5bcc52dc-ca8f-bbdd-69ef-4b6312e7994a@suse.de> Date: Mon, 21 Sep 2020 23:09:48 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20200921140010.GA14672@lst.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/9/21 22:00, Christoph Hellwig wrote: > On Mon, Sep 21, 2020 at 05:54:59PM +0800, Coly Li wrote: >> I am not sure whether virtual bcache device's optimal request size can >> be simply set like this. >> >> Most of time inherit backing device's optimal request size is fine, but >> there are two exceptions, >> - Read request hits on cache device >> - User sets sequential_cuttoff as 0, all writing may go into cache >> device firstly. >> For the above two conditions, all I/Os goes into cache device, using >> optimal request size of backing device might be improper. >> >> Just a guess, is it OK to set the optimal request size of the virtual >> bcache device as the least common multiple of cache device's and backing >> device's optimal request sizes ? > > Well, if the optimal I/O size is wrong, the read ahead size also is > wrong. Can we just drop the setting? > I feel this is something should be fixed. Indeed I overlooked it until you point out the issue now. The optimal request size and read ahead pages hint are necessary, but current initialization is simple. A better way might be dynamically setting them depends on the cache mode and some special configuration. By your inspiration, I want to ACK your original patch although it doesn't work fine for all condition. Then we may know these two settings (ra_pages and queue_io_opt) should be improved for more situations. At lease for most part of the situations they provide proper hints. How do you think of the above idea ? Coly Li