Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753668AbcKXBzI (ORCPT ); Wed, 23 Nov 2016 20:55:08 -0500 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:34317 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751287AbcKXBzF (ORCPT ); Wed, 23 Nov 2016 20:55:05 -0500 Date: Wed, 23 Nov 2016 17:15:18 -0800 From: Shaohua Li To: Tejun Heo CC: , , , , Subject: Re: [PATCH V4 10/15] blk-throttle: add a simple idle detection Message-ID: <20161124011517.GC4724@ksenks-mbp.dhcp.thefacebook.com> References: <20161123214619.GE11306@mtj.duckdns.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20161123214619.GE11306@mtj.duckdns.org> User-Agent: Mutt/1.6.1 (2016-04-27) X-Originating-IP: [2620:10d:c090:180::2e85] X-ClientProxiedBy: DM5PR12CA0005.namprd12.prod.outlook.com (10.172.32.143) To BN6PR15MB1635.namprd15.prod.outlook.com (10.175.131.9) X-Microsoft-Exchange-Diagnostics: 1;BN6PR15MB1635;2:beerV+PZOXj5cXoLV9X3KOZvXkdJ1D8SgDg/6k+IeKy1Q2wgv39L2gZJEDTwYPpW22K/DBwHMxT80V++yZgf44sh2habCclb8XHlz44Hz7OsEKX3yxSmRzwEAgLfX7xdoVsPt4CXhU+ucwIf7XEmR145cpiW7pQIwph9oqFJi0Y=;3:dOm1fBMBQJZOPi1qCfCcas/ATz9RHgUVGZQ2w6I90+ux5L45B+xUmH75FTchsd2qFmhmf/Mc5O3EARQa3/g0Y/Qqwx+4qxJEtfUztqlVBnvWnM4Iy+lAz8pBdXRw+m/6JrYdQjhcHYP+im7HvcUqhUnrTVFOnrlC89STnfxnl9E= X-MS-Office365-Filtering-Correlation-Id: 5f20fb34-5d11-45fb-e75a-08d414075e5b X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22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sRLWzpmioTGgc8BozU9Cm+AHmdG/eGLWQ4rNnaZdNrONyYuaxra0fPsL0Opucitzpmc4Kl5OIIrFieuMyxJ;20:W0J0T9iUVmcE5PNq9yhvmQ3tZ2m1lSCr4ovkVx/e2BkZbgu0dmT309fraa/1VzBrgf6kmFNBZ05v7IZO0aL+BX3DB47ySbNyyKsYvx9ENY9rsVW/9wOkRhVMHvoShrdoErKt1k6OO9gi6t8qo/QH9tSJqZVmuu43nRy5xnN0G2yZ77vstFuPo/GFWkepzDRqIxIVQd1Scc2VgBIueUDQnV6EmrsMDUAwltPFMdGTGkGxGxw6uZVoAbLWySiYB9KZ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040307)(6060326)(6045199)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6041248)(6061324)(6072148);SRVR:BN6PR15MB1635;BCL:0;PCL:0;RULEID:;SRVR:BN6PR15MB1635; X-Microsoft-Exchange-Diagnostics: 1;BN6PR15MB1635;4:oDp6pbV+gBQaPOZGCMj/EqHkKRyBuEE1jmurbJs1sQWkY/haOVK8kyUKzEMyaHowyaIlcEXp0BrHJ/sb6WMdGenV7Bf+ZyWEswgMl/mnoB9YLOgfJaKcbd3tmkGWmo6QMCYkOgzEtb1ckkvkBl3Udf6YXfl6gl3/pGnwufLgLEOLcmMn/q2xdllGUbOB9zzl37enl6H7BnBuqIQkIqjh9LueQN09lHRGggfTuKfMvWZON8mXhSEmUgeZdVYOI0pYhwoH/P4IXfQp0mvIFtDeuQblr4rooU8P4J74eH2Y9pDd5qxYF5RP06wB+n8tJZSelvVbnyY6ogW0MrxyXq85VGAwMzGjOhqRWICiPhKV9HksswLZqgz1sP1+3pJ/NlSC7+jAGVlCVGDnSI7/X5bZR/kKzB2mgK0bh9qLEt7I38M7W+3Q3+8xxr2dcvY5n1vFBDH99M/2K4R0pz4GqLIOswzuO4qhRsABcYVn4m+pxKM5tRvwWz+BsN9+OtJjJWbL X-Forefront-PRVS: 0136C1DDA4 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(6009001)(7916002)(24454002)(189002)(199003)(2950100002)(4326007)(6916009)(47776003)(6666003)(110136003)(50466002)(92566002)(81166006)(8676002)(83506001)(81156014)(23726003)(105586002)(106356001)(38730400001)(2906002)(86362001)(42186005)(229853002)(68736007)(4001350100001)(6116002)(189998001)(50986999)(101416001)(7736002)(9686002)(305945005)(5660300001)(77096005)(97756001)(46406003)(76176999)(1076002)(33656002)(97736004)(54356999)(7846002)(18370500001);DIR:OUT;SFP:1102;SCL:1;SRVR:BN6PR15MB1635;H:ksenks-mbp.dhcp.thefacebook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BN6PR15MB1635;23:gPLMzP9l9xqDd+YoG4RGnAmC9q2eR+aAqkkxP2q1D?= =?us-ascii?Q?tPcmjcBYxiCYPiuZwFelPaKVYqVpEeC9tA1/K9gN2pOornYt6HTP0x9dLU8o?= =?us-ascii?Q?+S6l+McUpR66b16IKLo5u3lCQiBiMygrFwnT26Bu7gpwZ7bk9BjfQUpFLbh9?= =?us-ascii?Q?K7h8xdtn7CsiK7a8klFumMuIxY6WPeQupHO/pMrdPxOoaNMTyiEpAlUaObZD?= =?us-ascii?Q?S+WYJfPcPP92/K1e/n4td/sFsaXWyMhET+cdT5gu+/hdV749z+BtEdxxU1XX?= =?us-ascii?Q?Fnf84S6AiYNqEquthqCrQs3VlWIoUzVO64G90NRzQGuO5ShUGX8oTqsaTPG8?= =?us-ascii?Q?OlxMq4su2biDpohaB64rmeqVzGOJxT+1Z0SFAOJub66TRxIqTiHczTUQIw+Y?= =?us-ascii?Q?VmFVqMJKNIS53M4GWkBZyiU79rGa1x95T4ZbafHja71J6N1ZW4mz+IieKGMS?= =?us-ascii?Q?hd6ucwwo+zLNs+lXCrRbzWHDCE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RnFLQ= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Nov 2016 01:15:23.4810 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR15MB1635 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-23_07:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2005 Lines: 38 On Wed, Nov 23, 2016 at 04:46:19PM -0500, Tejun Heo wrote: > Hello, Shaohua. > > On Mon, Nov 14, 2016 at 02:22:17PM -0800, Shaohua Li wrote: > > Unfortunately it's very hard to determine if a cgroup is real idle. This > > patch uses the 'think time check' idea from CFQ for the purpose. Please > > note, the idea doesn't work for all workloads. For example, a workload > > with io depth 8 has disk utilization 100%, hence think time is 0, eg, > > not idle. But the workload can run higher bandwidth with io depth 16. > > Compared to io depth 16, the io depth 8 workload is idle. We use the > > idea to roughly determine if a cgroup is idle. > > Hmm... I'm not sure thinktime is the best measure here. Think time is > used by cfq mainly to tell the likely future behavior of a workload so > that cfq can take speculative actions on the prediction. However, > given that the implemented high limit behavior tries to provide a > certain level of latency target, using the predictive thinktime to > regulate behavior might lead to too unpredictable behaviors. Latency just reflects one side of the IO. Latency and think time haven't any relationship. For example, a cgroup dispatching 1 IO per second can still have high latency. If we only take latency account, we will think the cgroup is busy, which is not justified. > Moreover, I don't see why we need to bother with predictions anyway. > cfq needed it but I don't think that's the case for blk-throtl. It > can just provide idle threshold where a cgroup which hasn't issued an > IO over that threshold is considered idle. That'd be a lot easier to > understand and configure from userland while providing a good enough > mechanism to prevent idle cgroups from clamping down utilization for > too long. We could do this, but it will only work for very idle workload, eg, the workload is completely idle. If workload dispatches IO sporadically, this will likely not work. The average think time is more precise for predication. Thanks, Shaohua