Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756064AbcK2SbL (ORCPT ); Tue, 29 Nov 2016 13:31:11 -0500 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:45876 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755911AbcK2Sa4 (ORCPT ); Tue, 29 Nov 2016 13:30:56 -0500 Date: Tue, 29 Nov 2016 10:30:44 -0800 From: Shaohua Li To: Tejun Heo CC: , , , , Subject: Re: [PATCH V4 13/15] blk-throttle: add a mechanism to estimate IO latency Message-ID: <20161129183044.GB36738@shli-mbp.local> References: <9c75c9852b08404b90fbbdb143e81a8ef3b36abf.1479161136.git.shli@fb.com> <20161129172435.GA22330@htj.duckdns.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20161129172435.GA22330@htj.duckdns.org> User-Agent: Mutt/1.6.1 (2016-04-27) X-Originating-IP: [2620:10d:c090:200::2:6f5c] X-ClientProxiedBy: MWHPR14CA0033.namprd14.prod.outlook.com (10.171.142.147) To DM5PR15MB1644.namprd15.prod.outlook.com (10.175.106.151) X-MS-Office365-Filtering-Correlation-Id: a376bd62-1af5-4c57-6aae-08d41885d851 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:DM5PR15MB1644; X-Microsoft-Exchange-Diagnostics: 1;DM5PR15MB1644;3:VYna+fi9osGd9OMB+mB44WpHbMxjDCIkmagaciCGkkFF/4IYklt1pcVOvCc5aFezeezLim4JMcSCOVNdsYzOLfn0ftBC3Hhuc/qVQe6+xa8qxUfjzf5xb0cozWlmHrF3OHNO+xLZNvu9SZ1w8jcGEtQV/oQCOqJTEMHKdaykXvVy7qNy284KPWBik/fr8KTMzlYT4tDyap2Je8Uy2tfQLCrfR74c3cuwbdpeScJ7rLjTKlIVYPoYwSN6J3DGhrXpiMP1zxnz57po996dKUUosg==;25:IY/5oE89LN2w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an:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040361)(6045199)(6060326)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6041248)(6061324)(20161123555025)(20161123560025)(20161123562025)(20161123564025);SRVR:DM5PR15MB1644;BCL:0;PCL:0;RULEID:;SRVR:DM5PR15MB1644; X-Microsoft-Exchange-Diagnostics: 1;DM5PR15MB1644;4:PuaV0HWK1GdSTzc0+4NT8OsY3gPOajSRHi/F+nPxZEz7RybfuX+51blY9JH8m7Kd+gaFbHr3kzI46eUY7p+IGwbNs1ZvAAjcny6acHMPt4uQSmWnLkW/JSYslcDeORzc6ZAQddyqocu60s1gKDZDahOFVoQVwAz6M5/W9P+5gk1PPceJCWs7ob3O/Fl+wXzATjjUInfx/HNcRa2wbmPcBxbTXfJ1vF1gXU6Pqb5TQK9eBmAHyqcC7o/jpyUOSJFdVFeC0EQYYzrrP7qrptwOluWjbudZvH1VgN7MdlD1VPH0GkexdOEOarWo3z2Dbzl5c3+PfOkAkEPejxO1OpyR6Dfy/WVK/xwwQYhHoCl7UU5MQM9eIYWfaTjcBw9BmETTk0IXn1pd0Vi6bGPMUx3UogWcAHsWJfp+Z/XmrkijHvVC84ZyEs7fvHPdlejFwMyu+ubS97nbdVbiRK3fSLo8pzyLJB5CxvUAUc4d6zsyegsiRT4/1G3W8K+8G+j0UAeEhc1LqUl+D3mFFwumo2Mc4PDLRDqdRwXVtUCGr3JMTtK6IZH5zNQ2j6aTIUDLJHufaDeLuR2jLLjKTtzwMrQDOUNYWsWngvP8wzw8YlNlBdA= X-Forefront-PRVS: 01415BB535 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(6009001)(7916002)(199003)(189002)(24454002)(39400400001)(39450400002)(305945005)(39410400001)(39380400001)(106356001)(733004)(105586002)(5660300001)(229853002)(110136003)(42186005)(6666003)(38730400001)(6916009)(83506001)(7736002)(47776003)(97756001)(7846002)(33656002)(4001350100001)(97736004)(1076002)(92566002)(23726003)(2950100002)(46406003)(189998001)(2906002)(98436002)(6116002)(101416001)(68736007)(86362001)(9686002)(4326007)(50466002)(8676002)(54356999)(76176999)(81166006)(81156014)(50986999)(18370500001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR15MB1644;H:shli-mbp.local;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;DM5PR15MB1644;23:ENUywIx7M8FKrdHMKtI09zlBBz2dDIrGmYTikUmof?= =?us-ascii?Q?wPZUnLjIWLY39rXKY61tnfTf8xaq8ryADuvficVWYm7S4OtHQCrNGYMvWz4k?= =?us-ascii?Q?OVlECGa7YXCdWx1Hr1LMHRyCmyVaw8uHoQxIK5mlpfCZrepfOZAyJ/BDpsLN?= =?us-ascii?Q?zCcN3dV2undhdZU/umLXfqLwZp+0V/bpG/d4nRp7hX5KcB/wD2DhFP0WeEY3?= =?us-ascii?Q?VpGAex++cXaaHR4WXuiGgxZ/DJ1cZAL7TwP2+yAQpuxtsUtHQ+8m2ahfj48q?= =?us-ascii?Q?4uNxqwu7s8lu0BQ41x1K2kgOhdWMUlIVyQMIUSedzKBv80Y3+OZJW6KQlR+z?= =?us-ascii?Q?zrzZfrxRRE2TRbuiVM5r0YwKKJm3WV/oVfqwvrBhWhxsyErBMdECpREynbC0?= =?us-ascii?Q?FUol9lkyGhEZmpocX4ESPOJM/t2gzcLRKkZ2E91WzxX/1uIxNtAWf6f+PKn8?= =?us-ascii?Q?HGt8I+Guhdjt2T2Mmtw/W6/GRa+K8VIRfYZC3Mxk7CQRhYnL3xQeqiwZmA7j?= =?us-ascii?Q?mnrmzkELZxE7mtd/bwsjaUpL0crK3dcLuM10CoY7q0rr49CdMf6eUfib9D9C?= =?us-ascii?Q?e7oMZwV4WsiLVbg/KiLfrtms+mBJLwwMV4/i9vzinj3BItAewalNe0LVeL86?= =?us-ascii?Q?aFnQEuW1RwlXIcrA6rZH2Hkti7j1BMB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aHS1qFb6W9azLEe1s12hAlbvuKJQL60EQ3mWUJ9NcSQHdoYYQz0fqG7gwZYvDpBgBI1fHK+NVceV7C8xFmN+SUTTZnrI= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Nov 2016 18:30:49.5796 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR15MB1644 X-OriginatorOrg: fb.com X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-11-29_05:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1502 Lines: 32 On Tue, Nov 29, 2016 at 12:24:35PM -0500, Tejun Heo wrote: > Hello, Shaohua. > > On Mon, Nov 14, 2016 at 02:22:20PM -0800, Shaohua Li wrote: > > To do this, we sample some data, eg, average latency for request size > > 4k, 8k, 16k, 32k, 64k. We then use an equation f(x) = a * x + b to fit > > the data (x is request size in KB, f(x) is the latency). Then we can use > > the equation to estimate IO target latency for any request. > > As discussed separately, it might make more sense to just use the avg > of the closest bucket instead of trying to line-fit the buckets, but > it's an implementation detail and whatever which works is fine. that is still like a line fit. Don't think there is big difference. > > Hard disk is completely different. Latency depends on spindle seek > > instead of request size. So this latency target feature is for SSD only. > > I'm not sure about this. While a disk's latency profile is way higher > and more erratic than SSDs, that doesn't make latency target useless. > Sure, it'll be more crude but there's a significant difference between > a cgroup having <= 20ms overall latency and experiencing multi-sec > latency. Sure, latency target is useful for hardisk too. But we need a different stragety. For hard disk, the latency highly depends on seek. Probably we can make the latency target the same for all request size. Not sure if average latency makes sense. Need more tests with hard disk. I'd like to forcus on SSD in current stage. Thanks, Shaohua