Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3002027pxu; Mon, 14 Dec 2020 17:30:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJwt7x13KrFXNIt3O+dOy+TywsfnQsloT+qifKcFdwFgP5dByQb7qcAZSxM2tJ2NzR/POcTb X-Received: by 2002:a17:906:7a18:: with SMTP id d24mr25074272ejo.324.1607995824462; Mon, 14 Dec 2020 17:30:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607995824; cv=none; d=google.com; s=arc-20160816; b=v0nOr5SIIQuXHm6Mzkh7+13oBWKb0WVFAd2BzNvoqvVIW+Q/lFa+LE7tILQ44dF1MJ cqp7POKxOJP2ns0P4vKPmPgnu1bi+qdgtfFaKUsx3Wm6O/VV/tdrkQ4TivvdigaumbA1 btPZ6BP6aUsuDmwWKBzDOSLhg8GhaePRSQpNZFQptkuk5/b/jsMkfDeQOXiRUviACE6H F75g3DBX9EOhAMlmdeXGgyXKluoRUFVI859R+RywaUzYUfhL0EW8BIKx83v2c8uxF/Fh +kx5fQ8ARFOZbYzikMiUioroetMB2wCKV64czAxzJdUh1/wkreRqNUZVhc/5mO2oDvWM fuGg== 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:from :references:cc:to; bh=t37XNPAOW17Bz/uBnIGPRqgWhbcqQK5/bSAfH/INc4g=; b=xEMH/aT8H9FFmSVoymfFDkceeNeyUS9PHx39IdP3Qt16d9bpguQ9TaJFxAkQuK7ojl 5BisTcMqu8K7IAb9DUsKdgTJvOPvtvInQ4SoDiXyzaoDcBFZ2Lb2BwAGZS/Z6qTa0TXU R/G40e1aQ5gFhNAhCmHJ98NPPQH7z7TOwp/ZIqDOuuWxuTeuStuEr/IUY10Vapf2Z5UI c1mK47XsBegkzbnI1pDKXHEL3MszxT6DqnTAmHBZxhqDqdEDmJJcq1k92VrTjqT4huNj 0QLOZDCk8IahiDuvgM0e0CcSuwM0y9NlcziGXPm6h1Q5Wp5tBIBPPY5MyIyYU8+BbWRs +FEg== 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 s16si134256ejz.97.2020.12.14.17.29.48; Mon, 14 Dec 2020 17:30:24 -0800 (PST) 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 S2502162AbgLNRIf (ORCPT + 99 others); Mon, 14 Dec 2020 12:08:35 -0500 Received: from mx2.suse.de ([195.135.220.15]:53640 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2502107AbgLNRI1 (ORCPT ); Mon, 14 Dec 2020 12:08:27 -0500 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 50FE1ACC6; Mon, 14 Dec 2020 17:07:35 +0000 (UTC) To: Dongdong Tao Cc: Gavin Guo , Gerald Yang , Trent Lloyd , Kent Overstreet , "open list:BCACHE (BLOCK LAYER CACHE)" , open list , Dominique Poulain , Dongsheng Yang References: <20201103124235.14440-1-tdd21151186@gmail.com> <89b83c00-1117-d114-2c23-7b03fc22966e@easystack.cn> From: Coly Li Subject: Re: [PATCH] bcache: consider the fragmentation when update the writeback rate Message-ID: <35a038d8-fe6b-7954-f2d9-be74eb32dcdd@suse.de> Date: Tue, 15 Dec 2020 01:07:31 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:78.0) Gecko/20100101 Thunderbird/78.5.1 MIME-Version: 1.0 In-Reply-To: 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 12/14/20 11:30 PM, Dongdong Tao wrote: > Hi Coly and Dongsheng, > > I've get the testing result and confirmed that this testing result is > reproducible by repeating it many times. > I ran fio to get the write latency log and parsed the log and then > generated below latency graphs with some visualization tool > Hi Dongdong, Thank you so much for the performance number! [snipped] > So, my code will accelerate the writeback process when the dirty buckets > exceeds 50%( can be tuned), as we can see > the cache_available_percent does increase once it hit 50, so we won't > hit writeback cutoff issue. > > Below are the steps that I used to do the experiment: > 1. make-bcache -B -C --writeback -- I prepared the nvme > size to 1G, so it can be reproduced faster > > 2. sudo fio --name=random-writers --filename=/dev/bcache0 > --ioengine=libaio --iodepth=1 --rw=randrw --bs=16k --direct=1 > --rate_iops=90,10 --numjobs=1 --write_lat_log=16k > > 3. For 1 G nvme, running for about 20 minutes is enough get the data. 1GB cache and 20 minutes is quite limited for the performance valuation. Could you please to do similar testing with 1TB SSD and 1 hours for each run of the benchmark ? > > Using randrw with rate_iops=90,10 is just one way to reproduce this > easily, this can be reproduced as long as we can create a fragmented > situation that quite few dirty data consumed a lot dirty buckets thus > killing the write performance. > Yes this is a good method to generate dirty data segments. > This bug nowadays is becoming very critical, as ceph is hitting it, ceph > mostly submitting random small IO. > Please let me know what you need in order to move forward in this > direction, I'm sure this patch can be improved also. The performance number is quite convinced and the idea in your patch is promising. I will provide my comments on your patch after we see the performance number for larger cache device and longer run time. Thanks again for the detailed performance number, which is really desired for performance optimization changes :-) Coly Li