Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp6038186ybe; Tue, 10 Sep 2019 12:32:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqxQHZW03b5YYRlaLKkbdMO1npylFZ3dvbk8rdNo+AX/YjbzC6nkPAIcuect5E7qbJfZNoBf X-Received: by 2002:a17:906:5299:: with SMTP id c25mr9861257ejm.64.1568143950003; Tue, 10 Sep 2019 12:32:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568143949; cv=none; d=google.com; s=arc-20160816; b=G+PYFxaI2Pwp0HntXCasFCuY6Hwfsq1IGIzMcSdKN9h+uR2fTAtSaAgPbXFsFBPNKQ 2i8e8d7tIGQ5dF5P2tR04tl17GzWDGIr8EcJpwueIsO8GAdjAwJtYSyvFo5wgMtK8vDL HvXmNrwSsZ/62Kj3a72wBaaSBRBxgaWdI2RA0nud+VhqV/zYBcM1kcCnfWiJ/5b+OtrC OI732URV8qP/vt8zz1ohKGEzKjuRTzVd2Xyb1fCJwH59pmtotwmrVdqZ3c3W1R8qmn1k 97HIiRIN/UAbDD1Z++yw4JBS7EzUKqOSm6DVEawe51/lJr9KHXCpXuYQrwwNqZ72LPcL IPZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=gmihbRTTguhKuF5poqPrKOZtRuKZ2B/FVhu85kYPomo=; b=QIDTOl4KW7/a5DmnCbkr1UjSBKrC7cgYsAessjrywiTo6vKNaF50byXRrWOJQC+C0K ZJ/z5qMYsTRkQ7OHY7ESG+WBGFkAfyeSEgmKNnEucMwjeATDFLREnyRAaip5aJHZWhr4 z5W4MgNXWHsrDoaL5AT5DAOEhknrAbKC7stXL2oGsk/F5q2Y66hNsRVoJEbx4gQNtvhG 5lnjQL5OKkK6S2flAYGFLjGgyG3qsWABd62z/eOPaPrcoaitLb83SdHMt8WqEicydNfz aOOnliKwnyeJc+50/4+2gfUbAKVDJ92k6MQjxKbGEKHvqeo6Fqfng9WJlP4714z9QwKC ccNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=eFEJ0DHd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id jo11si10163019ejb.51.2019.09.10.12.32.06; Tue, 10 Sep 2019 12:32:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=eFEJ0DHd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727831AbfIJScJ (ORCPT + 99 others); Tue, 10 Sep 2019 14:32:09 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:46274 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725875AbfIJScI (ORCPT ); Tue, 10 Sep 2019 14:32:08 -0400 Received: by mail-pl1-f194.google.com with SMTP id t1so8976744plq.13 for ; Tue, 10 Sep 2019 11:32:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=gmihbRTTguhKuF5poqPrKOZtRuKZ2B/FVhu85kYPomo=; b=eFEJ0DHdQ+gOjr08che3M4Ms36pQZ/j0IezL7oi03HQnX2YjfG1S+nNKpcLRqLGWtQ PPxCQw+rHkJOyVpzA+WrbkIWHKwEQwYWJoThRT+YJ+Z3FLxkwzRk/gUSR4mBaYxPs/A3 ZHHHb/+KW51o1rmGeub/erimGc9yzYv0SnByD5rdzoyIJ7PwZNxKm4n1vCbrVDwpCWvS sAbC06jkTUKjyfwSL8GcQMX4lTVlRzbXbCyowRdrk/eNaJMSv2bHcL8+UjIkLfgVeR0a eK1lxBcNMUCi4/G5rr+vfxQG/ioz4oWUm9RgMCHhKh1G9K44i828u1woNK4lOf65DSik a8Bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=gmihbRTTguhKuF5poqPrKOZtRuKZ2B/FVhu85kYPomo=; b=sR1DVh5SPHzcmVaaPw7KDislbQ20eH1yAFcY06Ab41y6KApdXA3MFMtSGYE6Ny79/P CRZfeGkumfu2S+k4HhjZrrS9H7x7ic5LwSN651XJys53FlQ/VNmq6/lwWKNMu7XsrilK Q4swkj+1vLGaQOOfs13dpoEteVz6+zO+3oQYvex5UhAY2yneSXDiWq2R8QH+TxgDQmFW BuYJcQMHeISXfjsNh1SYNdIIyEHSlK1Vf8/5ssrNeWOjFd0OQVkBv5wHxA+KJ09wCs9H kjbucwtS30rJJHxddJ3njduPW3UyM86g4q76/H0bL84k5yb9aaUC/PH+7OhtqCVPsASC Y8yw== X-Gm-Message-State: APjAAAUwH1I7dShoxh/nMSVl52Ueu973tKz3/T/0+t1Z2rui//dy0jIc GmiIAKQwLYhiwHfiHCh3LrXMvA== X-Received: by 2002:a17:902:b086:: with SMTP id p6mr32047305plr.315.1568140326506; Tue, 10 Sep 2019 11:32:06 -0700 (PDT) Received: from ?IPv6:2600:380:b456:5481:2ce0:140c:7117:4b2a? ([2600:380:b456:5481:2ce0:140c:7117:4b2a]) by smtp.gmail.com with ESMTPSA id b20sm22735360pff.158.2019.09.10.11.32.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Sep 2019 11:32:05 -0700 (PDT) Subject: Re: [PATCHSET block/for-next] blk-iocost: Implement absolute debt handling To: Tejun Heo Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@vger.kernel.org, cgroups@vger.kernel.org, newella@fb.com References: <20190904194556.2984857-1-tj@kernel.org> From: Jens Axboe Message-ID: <1d8b7394-09bc-63ef-5bb7-de0f2ff2c75a@kernel.dk> Date: Tue, 10 Sep 2019 12:32:02 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190904194556.2984857-1-tj@kernel.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/4/19 1:45 PM, Tejun Heo wrote: > Currently, when a given cgroup doesn't have enough budget, a forced or > merged bio will advance the cgroup's vtime by the cost calculated > according to the hierarchical weight at the time of issue. Once vtime > is advanced, how the cgroup's weight changes doesn't matter. It has > to wait until global vtime catches up with the cgroup's. > > This means that the cost is calculated based on the hweight at the > time of issuing but may later be paid at the wrong hweight. This, for > example, can lead to a scenario like the following. > > 1. A cgroup with a very low hweight runs out of budget. > > 2. A storm of swap-out happens on it. All of them are scaled > according to the current low hweight and charged to vtime pushing > it to a far future. > > 3. All other cgroups go idle and now the above cgroup has access to > the whole device. However, because vtime is already wound using > the past low hweight, what its current hweight is doesn't matter > until global vtime catches up to the local vtime. > > 4. As a result, either vrate gets ramped up extremely or the IOs stall > while the underlying device is idle. > > This patchset fixes the behavior by accounting the cost of forced or > merged bios in absolute vtime rather than cgroup-relative. This > allows the cgroup to pay back the debt with whatever actual budget it > has each period removing the hweight discrepancy. > > Note that !forced bios' costs are already accounted in absolute vtime. > This patchset puts forced charges on the same ground. > > This patchset contains the following five patches and is on top of the > current linux-block.git for-next 35e7ae82f62b ("Merge branch > 'for-5.4/block' into for-next"). > > 0001-blk-iocost-Account-force-charged-overage-in-absolute.patch > 0002-blk-iocost-Don-t-let-merges-push-vtime-into-the-futu.patch > 0003-iocost_monitor-Always-use-strings-for-json-values.patch > 0004-iocost_monitor-Report-more-info-with-higher-accuracy.patch > 0005-iocost_monitor-Report-debt.patch > > 0001-0002 implement absolute debt handling. 0003-0005 improve the > monitoring script and add debt reporting. Applied, thanks. -- Jens Axboe