Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp146793pxb; Thu, 14 Jan 2021 02:09:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJy8zsW0FwX+VzN1u3If2n/TGx5GN4jgosLmpKeODkgDePhDwgnwSmeJqfdL/Qkv/UbhEbWt X-Received: by 2002:a17:906:7948:: with SMTP id l8mr699306ejo.550.1610618979490; Thu, 14 Jan 2021 02:09:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610618979; cv=none; d=google.com; s=arc-20160816; b=CqFKuTu5Mf50H9oVYeE6xgFBxQEyTezRnDMeDGo5kbxlJAEVQ3vAAF23GJM1F7O+vF wGjTnhZRgF4IPV28LXVaHi+KkH0SpnEf+gmbn34IOjSR3h8/FJmbZS8BuZ6EBYAPsGkP lZx/HMBGCo6nsZmi7FwqFIMo6Tj7sgCjbAgoP5nHEqHmh2veswSvMJ1t3CtUf8IUXpn3 GFR+9+Z39hYUltUhGlLWK/SvAIKVp1aXkvNwhoHQZWUB73Je3TRHUuh/RIEhpBz6p9Yv L3JOdNg3t6Gw9+eDnWisltLjSZCB9i6BMjqRZyJzbEShJj7KzDD88nL3FQ8fNzoeMGAY 5FqQ== 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=9TU/IGQfeW7fiyUfxsszQUVu1a1vz8y4A7n/f2Cflqs=; b=cRtLvNwheTP7ELFt4kgAzQkT2U5YSQNuOBvnXq7QnPsB/T/6ByP0Q7FZiS7B4zsbnU HztPdzRDI3MintVziKSr8JYlWWvg601dyFfACSeJzWb5e0VlgQ2NDPuIpts0MkNxUtkI JJfBpDiw4b+25AkdDJAK3yu3vcOIGhAijvyPJgILi1AGT5ZluMMCCBhFbI0Wq0Rt5FAs Bd4GAr0O7KHGonR/pwdIFebxmzf0GxL4mrm+eBPcb8PxHPBlM85+PNPgiBSQIvV41AEe sGeW0GJgRFF6x+9ZwqhDd6/ySQyrKxx7pBmrigd3OdKZYsqgdyLA/uBpZC0k6E9I2zPd ZtSQ== 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 m17si2169018ejc.705.2021.01.14.02.09.12; Thu, 14 Jan 2021 02:09:39 -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 S1727008AbhANKGb (ORCPT + 99 others); Thu, 14 Jan 2021 05:06:31 -0500 Received: from mx2.suse.de ([195.135.220.15]:56462 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726806AbhANKGa (ORCPT ); Thu, 14 Jan 2021 05:06:30 -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 3B286B1C4; Thu, 14 Jan 2021 10:05:47 +0000 (UTC) To: Dongdong Tao Cc: Kent Overstreet , "open list:BCACHE (BLOCK LAYER CACHE)" , open list , Gavin Guo , Gerald Yang , Trent Lloyd , Dominique Poulain , Dongsheng Yang References: <20210105030602.14427-1-tdd21151186@gmail.com> <1a4b2a68-a7b0-8eb0-e60b-c3cf5a5a9e56@suse.de> <084276ab-7c74-31be-b957-3b039d7061a1@suse.de> <299ea3ff-4a9c-734e-0ec1-8b8d7480a019@suse.de> From: Coly Li Subject: Re: [PATCH] bcache: consider the fragmentation when update the writeback rate Message-ID: <392abd73-c58a-0a34-bd21-1e9adfffc870@suse.de> Date: Thu, 14 Jan 2021 18:05:41 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 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 1/14/21 12:45 PM, Dongdong Tao wrote: > Hi Coly, > > I've got the testing data for multiple threads with larger IO depth. > Hi Dongdong, Thanks for the testing number. > *Here is the testing steps: > *1. make-bcache -B <> -C <> --writeback > > 2. Open two tabs, start different fio task in them at the same time. > Tab1 run below fio command: > sudo fio --name=random-writers --filename=/dev/bcache0 --ioengine=libaio > --iodepth=32 --rw=randrw --blocksize=64k,8k  --direct=1 --runtime=24000 > > Tab2 run below fio command: > sudo fio --name=random-writers2 --filename=/dev/bcache0 > --ioengine=libaio --iodepth=8 --rw=randwrite --bs=4k --rate_iops=150 > --direct=1 --write_lat_log=rw --log_avg_msec=20 > Why you limit the iodep to 8 and iops to 150 on cache device? For cache device the limitation is small. Iosp 150 with 4KB block size, it means every hour writing (150*4*60*60=2160000KB=) 2GB data. For 35 hours it is only 70GB. What if the iodeps is 128 or 64, and no iops rate limitation ? > Note > - Tab1 fio will run for 24000 seconds, which is the one to cause the > fragmentation and made the cache_available_percent drops to under 40. > - Tab2 fio is the one that I'm capturing the latency and I have let it > run for about 35 hours, which is long enough to allow the > cache_available_percent drops under 30. > - This testing method utilized fio benchmark with larger read block > size/small write block size to cause the high fragmentation, However in > a real production env, there could be >    various reasons or a combination of various reasons to cause the high > fragmentation,  but I believe it should be ok to use any method to cause > the fragmentation to verify if >    bcache with this patch is responding better than the master in this > situation.  > > *Below is the testing result:* > > The total run time is about 35 hours, the latency points in the charts > for each run are 1.5 million > > Master: > fio-lat-mater.png > > Master + patch: > fio-lat-patch.png > Combine them together: > fio-lat-mix.png > > Now we can see the master is even worse when we increase the iodepth, > which makes sense since the backing HDD is being stressed more hardly. > > *Below are the cache stats changing during the run:* > Master: > bcache-stats-master.png > > Master + the patch: > bcache-stats-patch.png > > That's all the testing done with 400GB NVME with 512B block size. > > Coly, do you want me to continue the same testing on 1TB nvme with > different block size ? > or is it ok to skip the 1TB testing and continue the test with 400GB > NVME but with different block size?  > feel free to let me know any other test scenarios that we should cover > here. Yes please, more testing is desired for performance improvement. So far I don't see performance number for real high work load yet. Thanks. Coly Li