From nobody Mon Feb 9 01:30:01 2026 Received: from mail-pg1-f172.google.com (mail-pg1-f172.google.com [209.85.215.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 70B5A30C627 for ; Fri, 14 Nov 2025 23:54:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763164491; cv=none; b=GghvyN4Gise1ed0sCvzjQGi4W0sMUxUGweY8si2FVOm9GBGvPx/Cwjj3Ew3elHjYa8aQRHe3S8OLwbzXhqvlL5oC+PBT4u7wh9kVLbVeIIGbr0GE91uh7S80EXowoS1p+uNJNZrk89MoOlen75oIbRLPCnw/34cSKiXtIq0d8LQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763164491; c=relaxed/simple; bh=eZmo6/5xCexjplSdLKsWrnqHmeMVHTordQIE+X1VxUo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=d41f8kFkSnElZ7qIy9k+C7XOhSYBPRWob6qg3I1IMzvzDR8xK8E2pev5tNovei/Uab/Y6ezHQBCY7fL9AyUlEbhZf1ee1Zv4yTgU46DbYLqEhS+d3ICTvT0KN48xOqe0XYtgoJBYP1euQlPUKrKkFT1Sc6y1sLwJEafG0ckyRvU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=HXRR9iCD; arc=none smtp.client-ip=209.85.215.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="HXRR9iCD" Received: by mail-pg1-f172.google.com with SMTP id 41be03b00d2f7-bc0d7255434so1561610a12.0 for ; Fri, 14 Nov 2025 15:54:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1763164489; x=1763769289; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=A4f5r+TGOOPde/WLtRUa45GVIxXbdn1Vo4b55yI0gt4=; b=HXRR9iCD4ENjXznIuoGTr8IHj75+6u5IHRhUrtib9y946Xg5VIN5NRPwxxI/fCVPg6 V/F1L73PrHf/vD83VcnkkpY0FOxSsEUtXYY0ZEsa0Ip6cnFo8aWIugXUEhnqzrZZ6VOX yvsICP43bAt7HJqMG9DikG1YDf35gqBpq7Dmw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763164489; x=1763769289; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=A4f5r+TGOOPde/WLtRUa45GVIxXbdn1Vo4b55yI0gt4=; b=kVLQqks1jLUEz47RDza0n52dEtI1C7+5jSlog716W/aF+NxvKzvkivxW1ptQ0OA3B/ X4UqAjjGPNbIbbO9DggILddydhdqVivVYcsZEAs6yNu6UB8jMfGTqkjj0q4lcaaUTMK1 hzIru8pi9Uw6zhDFfschutrjjIqklzDqfHlxV4iAIrGfyRo9PX0ZBVDQU1nJrrSuS2NS Q4Mf1Tsni+/lIaRu2AyP80g6IgGhbHhoa1Qqm50QJY1VzztlRBaefUHjyK4cyEgrkeR1 b2GCdyiNJdXjsi96yl4R9dHzhVPk6t/rMkWd0+qYIF9tcwhCoOz/RMhzvf1LxE2D8Y3V m9kw== X-Forwarded-Encrypted: i=1; AJvYcCWcgTa75pnJaladYnHCcZFxGJsOtDfwDDfUE/O3+PJy4Xmxc1t7WsI6QqceMltr5vk9aC4RlvQ/j4IwJ9Y=@vger.kernel.org X-Gm-Message-State: AOJu0YzmZWbtf9Zc/lpkLeYKxAvg3rofNxm87NGfyvUzsBOAPpUYw7wd VZ1G5bajxPmOoyeAr/+lN/33fAAw43q9Y3NPDWZ8Ij7jYD8A6hir+5ZNEZa1XJnb5w== X-Gm-Gg: ASbGncvRYgr5Vg24Y+GjfBVlavlm0AHFEFUPdEqCSIb3DIw0aE1vk6CROCBEzfBMb3q OSBb/cwCARyFApCpyxnYOX1nsdL9G7H7S4c0nRhRoz1Cy9F3S8zyOvGBmEkfgJ5Ak3eoF2/q6+k ZDX0PgxD/UR9m6hno9o7qksME1ZpbeLoQ2BoewW/tuVul7MQYLE8QvvxfsiumT6WWR77vukvkyd 2EM8HWj7fGOoinrygS6Ul0IQUapZnJy/+0wPE4TUhh4QY8et1nmo3o3J+yU2Fr0hlcaWoaS9B0+ CVPwJWccfL/Jy12AA4RvjGxvo8uVtEuuVN0qTfH/LhmV77ydQcklSEwMewxf1JGF8pVwTcVV2s5 LIn6cMzEK708V7WMZrM9WEsjdhAelE2VHsQ0XsMV0XWZLxtS9fhvgjJcoksCFxKWa9m23dwa81m kfcDR2tqnF7icsU9Un9YJnAwm1ym/uW/2PYGnQ9zYim7q2JHFEyL4EwqeW89L9LElT0RH4bk5CA 8uaEGYrmQ== X-Google-Smtp-Source: AGHT+IFtwwfARtE+LZgjm4XpePNHmAw5KTc8Gn91NyCPCwHKkcDkm5Smf3lVi3mzi3s6gN/2LN1I7g== X-Received: by 2002:a05:693c:40dc:b0:2a4:3593:4679 with SMTP id 5a478bee46e88-2a4abd973e6mr2295298eec.21.1763164488752; Fri, 14 Nov 2025 15:54:48 -0800 (PST) Received: from khazhy-linux.svl.corp.google.com ([2a00:79e0:2e5b:9:bb76:6725:868a:78e5]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2a49db7a753sm14114818eec.6.2025.11.14.15.54.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Nov 2025 15:54:48 -0800 (PST) From: Khazhismel Kumykov X-Google-Original-From: Khazhismel Kumykov To: Tejun Heo , Josef Bacik , Jens Axboe Cc: cgroups@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Guenter Roeck , Yu Kuai , Khazhismel Kumykov Subject: [PATCH v2 1/3] block/blk-throttle: Fix throttle slice time for SSDs Date: Fri, 14 Nov 2025 15:54:32 -0800 Message-ID: <20251114235434.2168072-2-khazhy@google.com> X-Mailer: git-send-email 2.52.0.rc1.455.g30608eb744-goog In-Reply-To: <20251114235434.2168072-1-khazhy@google.com> References: <20251114235434.2168072-1-khazhy@google.com> 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 Content-Type: text/plain; charset="utf-8" From: Guenter Roeck Commit d61fcfa4bb18 ("blk-throttle: choose a small throtl_slice for SSD") introduced device type specific throttle slices if BLK_DEV_THROTTLING_LOW was enabled. Commit bf20ab538c81 ("blk-throttle: remove CONFIG_BLK_DEV_THROTTLING_LOW") removed support for BLK_DEV_THROTTLING_LOW, but left the device type specific throttle slices in place. This effectively changed throttling behavior on systems with SSD which now use a different and non-configurable slice time compared to non-SSD devices. Practical impact is that throughput tests with low configured throttle values (65536 bps) experience less than expected throughput on SSDs, presumably due to rounding errors associated with the small throttle slice time used for those devices. The same tests pass when setting the throttle values to 65536 * 4 =3D 262144 bps. The original code sets the throttle slice time to DFL_THROTL_SLICE_HD if CONFIG_BLK_DEV_THROTTLING_LOW is disabled. Restore that code to fix the problem. With that, DFL_THROTL_SLICE_SSD is no longer necessary. Revert to the original code and re-introduce DFL_THROTL_SLICE to replace both DFL_THROTL_SLICE_HD and DFL_THROTL_SLICE_SSD. This effectively reverts commit d61fcfa4bb18 ("blk-throttle: choose a small throtl_slice for SSD"). While at it, also remove MAX_THROTL_SLICE since it is not used anymore. Fixes: bf20ab538c81 ("blk-throttle: remove CONFIG_BLK_DEV_THROTTLING_LOW") Cc: Yu Kuai Cc: Tejun Heo Signed-off-by: Guenter Roeck Signed-off-by: Khazhismel Kumykov Reviewed-by: Yu Kuai --- block/blk-throttle.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/block/blk-throttle.c b/block/blk-throttle.c index 2c5b64b1a724..c19d052a8f2f 100644 --- a/block/blk-throttle.c +++ b/block/blk-throttle.c @@ -22,9 +22,7 @@ #define THROTL_QUANTUM 32 =20 /* Throttling is performed over a slice and after that slice is renewed */ -#define DFL_THROTL_SLICE_HD (HZ / 10) -#define DFL_THROTL_SLICE_SSD (HZ / 50) -#define MAX_THROTL_SLICE (HZ) +#define DFL_THROTL_SLICE (HZ / 10) =20 /* A workqueue to queue throttle related work */ static struct workqueue_struct *kthrotld_workqueue; @@ -1341,10 +1339,7 @@ static int blk_throtl_init(struct gendisk *disk) goto out; } =20 - if (blk_queue_nonrot(q)) - td->throtl_slice =3D DFL_THROTL_SLICE_SSD; - else - td->throtl_slice =3D DFL_THROTL_SLICE_HD; + td->throtl_slice =3D DFL_THROTL_SLICE; td->track_bio_latency =3D !queue_is_mq(q); if (!td->track_bio_latency) blk_stat_enable_accounting(q); --=20 2.52.0.rc1.455.g30608eb744-goog