From nobody Sat Jul 25 06:09:14 2026 Received: from out-178.mta0.migadu.com (out-178.mta0.migadu.com [91.218.175.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DB89131B838 for ; Fri, 17 Jul 2026 06:02:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784268183; cv=none; b=Uc8AGH3jCRqvXy7D0faZpZ3GKK75RXk+dZd5L1ncbBeka7aOy7cejT1Z2zej7bScnl3u43BFM3Soarc44hNAS8F4h/seZqGXu6Onht9iBsiec0UvFMwKxbDX/HP9cOgyNhMKlyTuVDfzC3fIzP0WdCLn3Aj3ip9mH5XHwDhdE/U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784268183; c=relaxed/simple; bh=4bc6S5C6yC6MEtBr0JmUnzulBhHWRvVu/Fu3+OIZPb4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZsXnV2gAGxMtXMeIQQS9++tANxx4YFuxvUh2Rx95FVHNFvrHyuLvYdJCQ4UG/u0SVvd/WGKHZxd7tI0e9QXBD8QGZIoUBGkC52dNi3FVkoC0aLdMBoNroI3BXJOyMMLqlOG+NPpqbdz4sDQBONVdbXBnrcwATJaZ1B/8AU01mwc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=k0/nk8Uy; arc=none smtp.client-ip=91.218.175.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="k0/nk8Uy" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1784268175; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=U9iSZ3eirkta0qM7JPu7dHM5Fy1BbTSQrFYTTGjqWiY=; b=k0/nk8UyKYLE6EtQ4qE8EHhPNMqHOi5EOYyGBG76Kf0yDilXIOSUC+oijrtCaoDwqUaXdG YkK0r+S4+zTWYTqX/LG70z3CUqBArFRYyIYfDAjCa/2OtvNpvQJ3O5zo1qspSNaCJPx1XX pKo0qF9sNHNDIZUVaP7Und30BpE7HTA= From: Tao Cui To: Tejun Heo Cc: Johannes Weiner , =?UTF-8?q?Michal=20Koutn=C3=BD?= , Jonathan Corbet , Josef Bacik , Jens Axboe , cgroups@vger.kernel.org, linux-doc@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, cuitao@kylinos.cn, cui.tao@linux.dev Subject: [PATCH v2 1/2] Docs/admin-guide/cgroup-v2: document io.latency rotational vs non-rotational behavior Date: Fri, 17 Jul 2026 14:02:24 +0800 Message-ID: <20260717060225.2019764-2-cui.tao@linux.dev> In-Reply-To: <20260717060225.2019764-1-cui.tao@linux.dev> References: <20260717060225.2019764-1-cui.tao@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" From: Tao Cui io.latency is documented only in terms of average latency and the avg_lat stat, which matches rotational devices. On non-rotational devices a group misses its target when 10% or more of the IOs in the window individually exceed it, and io.stat reports missed/total rather than avg_lat/win. Describe both cases: how a miss is detected, note that the avg_lat tuning guidance is rotational-only, and update the io.stat field list (mark avg_lat/win as rotational-only, document missed/total). Signed-off-by: Tao Cui Acked-by: Michal Koutn=C3=BD --- Documentation/admin-guide/cgroup-v2.rst | 49 ++++++++++++++++++------- 1 file changed, 35 insertions(+), 14 deletions(-) diff --git a/Documentation/admin-guide/cgroup-v2.rst b/Documentation/admin-= guide/cgroup-v2.rst index 0df15a672cf3..4386365ef180 100644 --- a/Documentation/admin-guide/cgroup-v2.rst +++ b/Documentation/admin-guide/cgroup-v2.rst @@ -2260,9 +2260,12 @@ IO Latency ~~~~~~~~~~ =20 This is a cgroup v2 controller for IO workload protection. You provide a = group -with a latency target, and if the average latency exceeds that target the -controller will throttle any peers that have a lower latency target than t= he -protected workload. +with a latency target, and if the group misses its target the controller w= ill +throttle any peers that have a lower latency target than the protected +workload. How a miss is detected depends on the device: on rotational dev= ices +the average latency over the window must exceed the target, while on +non-rotational devices a miss is counted when 10% or more of the IOs in the +window individually exceed the target. =20 The limits are only applied at the peer level in the hierarchy. This mean= s that in the diagram below, only groups A, B, and C will influence each other, a= nd @@ -2279,10 +2282,12 @@ So the ideal way to configure this is to set io.lat= ency in groups A, B, and C. Generally you do not want to set a value lower than the latency your device supports. Experiment to find the value that works best for your workload. Start at higher than the expected latency for your device and, with -blkcg_debug_stats enabled, watch the avg_lat value in io.stat for your -workload group to get an idea of the latency you see during normal operati= on. -Use the avg_lat value as a basis for your real setting, setting at 10-15% -higher than the value in io.stat. +blkcg_debug_stats enabled, observe io.stat for your workload group to get = an +idea of the latency you see during normal operation. On rotational device= s, +use the avg_lat value as a basis for your real setting, setting it 10-15% +higher. On non-rotational devices io.stat reports no average latency; set +the target based on your device and use the missed/total fields to verify = it +is being met. =20 How IO Latency Throttling Works ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -2324,19 +2329,35 @@ IO Latency Interface Files the blkcg_debug_stats module parameter is enabled (it is disabled by default). =20 + The reported latency fields depend on the device. Rotational devices + report avg_lat and win; non-rotational devices report missed and total + instead. missed and total are live counters for the current window and + may change between reads. + depth This is the current queue depth for the group. =20 avg_lat - This is an exponential moving average with a decay rate of 1/exp - bound by the sampling interval. The decay rate interval can be - calculated by multiplying the win value in io.stat by the - corresponding number of samples based on the win value. + (Rotational devices only.) This is an exponential moving + average with a decay rate of 1/exp bound by the sampling + interval. The decay rate interval can be calculated by + multiplying the win value in io.stat by the corresponding number + of samples based on the win value. =20 win - The sampling window size in milliseconds. This is the minimum - duration of time between evaluation events. Windows only elapse - with IO activity. Idle periods extend the most recent window. + (Rotational devices only.) The sampling window size in + milliseconds. This is the minimum duration of time between + evaluation events. Windows only elapse with IO activity. Idle + periods extend the most recent window. + + missed + (Non-rotational devices only.) The number of IOs in the + current window whose latency exceeded the target. + + total + (Non-rotational devices only.) The total number of IOs + accounted in the current window. A group is considered to be + missing its target once missed reaches 10% of total. =20 IO Priority ~~~~~~~~~~~ --=20 2.43.0 From nobody Sat Jul 25 06:09:14 2026 Received: from out-184.mta0.migadu.com (out-184.mta0.migadu.com [91.218.175.184]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BC96C39FCC4; Fri, 17 Jul 2026 06:03:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.184 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784268183; cv=none; b=mvho1COHHx7dhSXDc2fBCAs/QFDlQLfMGqLxzB0i+iKr/1+TkXuv5xFihIPGtAyhk+FdhOoostpWN0+Kf+YOzXxhYcgnNMJjzGS/e6pQXRvLR+IQlhmYUPd13msxi3/KXHRrV84y2Nnw6rvZA7zuwd5Dgv3iRXKGv44uh2kq9nI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784268183; c=relaxed/simple; bh=FJkACmF9ctC/kC3im3SVj1O3ysPVeLhC0+2JRpi7B/U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=C24oYrecxNerSEOE8mqkluadisXxx4ERJU5BtsOkXoxGd0qkSeLy56j2awNCYQHFqEZhn7+d4mBcgMRYVDc0JgUdHg54FBLmLc4wNXV36RVkhqSKMPURYBEbmla/jYQW0cHvgmKYvYcCnZIVCcrMOiOJMFrysQlaz1iq9n1F/IY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=n7jOqPhb; arc=none smtp.client-ip=91.218.175.184 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="n7jOqPhb" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1784268179; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UoDPzUhIkglFscp2IezsZ4tuLclQXM4zODv4qy31gM0=; b=n7jOqPhbxxS+b4rnzRX98TuTdDiahcfGm15UA5g1Bs/alSLXmMUAuqRdZ+hMilfYJHaGnJ jWOeiqLMxSlwf/0T7m6SU1b6ET9phvlVj9LjZi1xC3zdm2RHCT7LlH6iLDv/XtHiOKep2t FNQ8+82rbmVE8yUYIwKZrPleddkvyZg= From: Tao Cui To: Tejun Heo Cc: Johannes Weiner , =?UTF-8?q?Michal=20Koutn=C3=BD?= , Jonathan Corbet , Josef Bacik , Jens Axboe , cgroups@vger.kernel.org, linux-doc@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, cuitao@kylinos.cn, cui.tao@linux.dev Subject: [PATCH v2 2/2] Docs/admin-guide/cgroup-v2: fix delay_nsec unit in io.latency doc Date: Fri, 17 Jul 2026 14:02:25 +0800 Message-ID: <20260717060225.2019764-3-cui.tao@linux.dev> In-Reply-To: <20260717060225.2019764-1-cui.tao@linux.dev> References: <20260717060225.2019764-1-cui.tao@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" From: Tao Cui The io.latency doc says the io.stat delay field counts microseconds. The field is delay_nsec and is reported in nanoseconds. Refer to it by its real name and correct the unit. Signed-off-by: Tao Cui Acked-by: Michal Koutn=C3=BD --- Documentation/admin-guide/cgroup-v2.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation/admin-guide/cgroup-v2.rst b/Documentation/admin-= guide/cgroup-v2.rst index 4386365ef180..755c2a1942ef 100644 --- a/Documentation/admin-guide/cgroup-v2.rst +++ b/Documentation/admin-guide/cgroup-v2.rst @@ -2305,9 +2305,9 @@ This throttling takes 2 forms: throttled without possibly adversely affecting higher priority groups. = This includes swapping and metadata IO. These types of IO are allowed to occ= ur normally, however they are "charged" to the originating group. If the - originating group is being throttled you will see the use_delay and delay - fields in io.stat increase. The delay value is how many microseconds th= at are - being added to any process that runs in this group. Because this number= can + originating group is being throttled you will see the use_delay and dela= y_nsec + fields in io.stat increase. The delay_nsec value is how many nanosecond= s that + are being added to any process that runs in this group. Because this nu= mber can grow quite large if there is a lot of swapping or metadata IO occurring = we limit the individual delay events to 1 second at a time. =20 --=20 2.43.0