Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754020AbcJDRIm (ORCPT ); Tue, 4 Oct 2016 13:08:42 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:54664 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753935AbcJDRIk (ORCPT ); Tue, 4 Oct 2016 13:08:40 -0400 Date: Tue, 4 Oct 2016 10:08:13 -0700 From: Shaohua Li To: Vivek Goyal CC: , , , , , Subject: Re: [PATCH V3 00/11] block-throttle: add .high limit Message-ID: <20161004170812.GA73678@anikkar-mbp.local.dhcp.thefacebook.com> References: <20161004132805.GB28808@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20161004132805.GB28808@redhat.com> User-Agent: Mutt/1.6.1 (2016-04-27) X-Originating-IP: [2620:10d:c090:180::9298] X-ClientProxiedBy: DB6PR0601CA0037.eurprd06.prod.outlook.com (10.169.209.23) To SN1PR15MB0413.namprd15.prod.outlook.com (10.163.205.147) X-MS-Office365-Filtering-Correlation-Id: 5a47dcc7-547c-44c0-ed08-08d3ec791201 X-Microsoft-Exchange-Diagnostics: 1;SN1PR15MB0413;2:t777l9clLCp1rvarREOmBsLrpIGPfsJQFlpU1qs3r+WiOBjECpVw0NMC8K1VcPTMfo5wvsuGvudICH6gXHTtqDHzlP40iXudpgrEeixZZxowkDNwVVWpJU2vLZQbm743uevZnL8GZwGeWT6OrjGXq85yMFFBBC7uuZp8kLBhEnSdgDZYdWePyX7SKH/dKfpN;3:ZqI6Q3V44FAFyQNx1DLDVB1sR5fSVug6bOL80SQWKils7VRIPGNEkcYZnMBEf9d3Y22qElV2RjU1P9HXjGClVW4xY/hEZP7XcwzpNtgb1Gol6gNaF3kWaiydIyt6aCDU X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SN1PR15MB0413; X-Microsoft-Exchange-Diagnostics: 1;SN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AgmW0fgkTykHqUUJMb9Bt9PcU1WLYnN/dwhomJfEsxGE2Orwj2MKpISHtEVMVqfMqU7CFBz9znQYzr0pHnsG5MrEDGyHrBCBv5jife3IMSe+y2TEfAtMGKlvYsXdncC6ar1JsWlK7xoTFqQzn9ay0ULc=;4:9hxvkVlm0kN3MOxlN1jAShL9nc2n2j1D0bFzdXrAWPisRBBzNWt9H9XMrhDWQd/98FFceCBFMbP5L3rGJDqIU5VUT/0HobzQrRdZ15B86BEOMHNwvdB0tLLPJwG4iIaTEUjpYbQy6OoRaLXQQOv2JC/mmKNW/15J+hcj3sjGUrxNsRc2BJaeQAeAQqQjWmlVYHzquXAby04/MK+gQUIdppufUwyb74JZCCilS7TAIwHXypQ2M6ZwiCL4fmhn7gfZI77b6bB+R3Hhhcr5dMtp296nTjov2XiSGRCme4YpobkFEuoHxN2OPZfC0La5Lnr1Ob7OkLAgyq+rgOce5ocz6B3kMaZlE009D/rxeGjg+CSpQX/fGypXgwhb4Obqnczp/Y+4BvxVR+Lalur9J3xmY2KFH1RuNGM6M1gbZN+p3nBgQ0Wm9HturjmSSf5GcnLl X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(278428928389397); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040176)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046);SRVR:SN1PR15MB0413;BCL:0;PCL:0;RULEID:;SRVR:SN1PR15MB0413; X-Forefront-PRVS: 00851CA28B X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(6009001)(7916002)(189002)(199003)(24454002)(50466002)(105586002)(46406003)(92566002)(19580395003)(33656002)(42186005)(110136003)(8676002)(47776003)(98436002)(97756001)(97736004)(7846002)(189998001)(81156014)(305945005)(7736002)(68736007)(81166006)(4001350100001)(6116002)(23726003)(77096005)(6916009)(9686002)(106356001)(5660300001)(50986999)(6666003)(83506001)(76176999)(54356999)(1076002)(4326007)(2906002)(101416001)(86362001)(2950100002)(586003)(18370500001)(142923001)(3826002);DIR:OUT;SFP:1102;SCL:1;SRVR:SN1PR15MB0413;H:anikkar-mbp.local.dhcp.thefacebook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;SN1PR15MB0413;23:b2uHFJS6gh3wkNLXoB+htbT3qh2uDdc1wCpt6UFsB?= =?us-ascii?Q?SLkf2444XJKtr/hzGxYZrVFj/1TTcD+iBCuYO0zKXGtYu97ZEOBrQxSBrRFZ?= =?us-ascii?Q?z5Pdp34+Xe0hRVPxiv8mIJoflFsL8UW9zHiK2AN38pVkFk4AcPDnMw6DxVb4?= =?us-ascii?Q?qZeNu+eRob72xYPzN2vvN0TJz1Su1lN9rkbpXqQr00bBxI4bVvG4EYDKyMT7?= =?us-ascii?Q?RPv6Nf1H9yQKk331GNLSZ9TdKesMuiDlJqIKSpDVCDHPioQEHTJ0QTvBKlr3?= =?us-ascii?Q?xO4z8BCUvnkNfCqBWnxu6tOb84/ZB3STmCskW6W/To+r/r+csdNQdNVMnBsW?= =?us-ascii?Q?uMu2YZ2CPu/13bH647u9y2J47HEXTO+CpVmc+80LAXS0V+0tsrpsOuWZRt0W?= =?us-ascii?Q?GaaHzkPwygnAI1OdAgWaNSqa6ZEL7y0cgCbpa6BRv60iV8pHfZOO9Hp2SXsR?= =?us-ascii?Q?HNY30Dlszg+k3GLaUrX/q17PGizFsorlX1zPj0XVHL7ulgq0FfV/NSmy3H3A?= =?us-ascii?Q?FUYgVXWmQBnC9huTtsZcD80EkHwNKL/EIfZTeIGsa6w2P6NneEn8Eoz1feaF?= =?us-ascii?Q?SDUCPxMRUxu51IqG9uVtp55Vj10p1fhOKG8vu+f/BBXn+FlaKpWmWH7QxMd8?= =?us-ascii?Q?mw/9D7RcD8M8DgWfw7tGx+nfGlevoiMvts9c9MlMneeZURX+r9bGxbzHBSTj?= =?us-ascii?Q?tsErJzn5CPGXans/G90MsiJdV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vDinXJ89v2bom7WblvlJoTmF+Rp8iP7/L+leXXvKyf2KQ1wQtPW4l+FQ==;24:a5fO9NdWeHfHy7pk/tJ7MKAiFKy1vFIOyhIfROmlCYGTJeUgn3trSqY1Y96IqPeR+mAYwpobSVaeF+Mn2K81i31Ra17Omo1emFdacTRgifk=;7:SNIWpyrc4gNQJolD5/SJGBcoi0kp9m0l07IIdNhLc3bJj3E35nC8GJovlF/Xl52/Bbd7b9dgM1VmHkeGl9dnkt1VOJ1cd4MhiWgUpZ6yFUBWIG15yBGGqmWevWMA8OF70LG8ggmPp3+rBYhgAUF1pipf8d72JtEMRONk6lCiYM7H/Q4Vwuedag6J6g9PzMWHuJF3Kyv5zvjQle4TBvXigF+QrWla0KfeDP34MJ+Y2N65DyKDgs3LMuYxYXPBlJkQ2cv4czMyGhQ5xgMJOCivYcn2QRSdruNbl7IXJCLdFCcYlZdX+QrJHxKX2Cz+kdjg SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;SN1PR15MB0413;20:bdKNYYCGzWwkG/3iOlNQeZUDVA4FmXQ8uaJJMf0i/sIyBUG6HKi4Iuz9gFG5eCdyQ7JhvANKkEkpwL3t2dAa3JPAjC/YFs7gKETe7pO0poA/PBQ19KiFusx5nyfA68JNjBpRMUv2HcOdK962mzF8uC3LDy1EmFajaUk2L3uSVwA= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2016 17:08:29.8780 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR15MB0413 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-10-04_06:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3828 Lines: 81 Hi, On Tue, Oct 04, 2016 at 09:28:05AM -0400, Vivek Goyal wrote: > On Mon, Oct 03, 2016 at 02:20:19PM -0700, Shaohua Li wrote: > > Hi, > > > > The background is we don't have an ioscheduler for blk-mq yet, so we can't > > prioritize processes/cgroups. > > So this is an interim solution till we have ioscheduler for blk-mq? This is still a generic solution to prioritize workloads. > > This patch set tries to add basic arbitration > > between cgroups with blk-throttle. It adds a new limit io.high for > > blk-throttle. It's only for cgroup2. > > > > io.max is a hard limit throttling. cgroups with a max limit never dispatch more > > IO than their max limit. While io.high is a best effort throttling. cgroups > > with high limit can run above their high limit at appropriate time. > > Specifically, if all cgroups reach their high limit, all cgroups can run above > > their high limit. If any cgroup runs under its high limit, all other cgroups > > will run according to their high limit. > > Hi Shaohua, > > I still don't understand why we should not implement a weight based > proportional IO mechanism and how this mechanism is better than proportional IO . > > Agreed that we have issues with proportional IO and we don't have good > solutions for these problems. But I can't see that how this mechanism > will overcome these problems either. No, I never declare this mechanism is better than proportional IO. The problem with proportional IO is we don't have a mechanism to measure IO cost, which is the core for proportional. This mechanism only prioritizes IO. It's not as useful as proportional, but works for a lot of scenarios. > > IIRC, biggest issue with proportional IO was that a low prio group might > fill up the device queue with plenty of IO requests and later when high > prio cgroup comes, it will still experience latencies anyway. And solution > to the problem probably would be to get some awareness in device about > priority of request and map weights to those priority. That way higher > prio requests get prioritized. > > Or run device at lower queue depth. That will improve latencies but migth > reduce overall throughput. Yep, this is the hardest part. It really depends on the tradeoff between throughput and latency. Running device at low queue depth sounds working, but the sacrifice is extremely high for modern SSD. Small size IO throughput has a range from several MB/s to several GB/s depending on queue depth. If run device at lower queue depth, the sacrific is big enough to make device sharing no sense. > Or thorottle number of buffered writes (as Jens's writeback throttling) > patches were doing. Buffered writes seem to be biggest culprit for > increased latencies and being able to control these should help. big size read can significantly increase latency too. Please note latency isn't the only factor applications care about. non-interactive workloads don't care about single IO latency, throughput or amortized latency is more important for such workloads. > ioprio/weight based proportional IO mechanism is much more generic and > much easier to configure for any kind of storage. io.high is absolute > limit and makes it much harder to configure. One needs to know a lot > about underlying volume/device's bandwidth (which varies a lot anyway > based on workload). > IMHO, we seem to be trying to cater to one specific use case using > this mechanism. Something ioprio/weight based will be much more > generic and we should explore implementing that along with building > notion of ioprio in devices. When these two work together, we might > be able to see good results. Just software mechanism alone might not > be enough. Agree, proportional IO mechanism is easier to configure. The problem we can't build it without hardware support. Thanks, Shaohua