From nobody Sun May 1 17:27:39 2022 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id DD9A71ABAA4A; Sun, 1 May 2022 17:27:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KrtTS3T9cz4rTK; Sun, 1 May 2022 17:27:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651426060; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2uVlF9Y/bJi59MespZ7dGuL0fmS/2+aIwCCVZ96h4z4=; b=nBGeeVXDTJWuOsvoxAKPlL7kVyPjj9h7Em9mZYYusDrDVO9URuadspBsTxu7fYd6Pvxj6p JurDVBGdDXQ0cOjme7zQeGsIbWUr8A2+0QpUUk/5h9puWEvj4CCxZo0UK61+TA9ZDoXP3r tCAY7sEHcuP1yJRdSSi1vePU84a4Ufu00RI2C9deOfrCRxtb4le1KCT1Qv9eY9Qcm6++fa K6g9F7O98l9bJhHI25pgyq8IP0vx6n2poekPAt4qBdE45qp9lIK0GZ4GgfstwmO6y7b2aU q4Ae/2yywgotIncKxi0eKPaJGvBmnGJpZctVim1AwjwtP1KBu1Z7ec2vfVIDSA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2091A19AFA; Sun, 1 May 2022 17:27:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 241HRdN4062011; Sun, 1 May 2022 17:27:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 241HRd8m062010; Sun, 1 May 2022 17:27:39 GMT (envelope-from git) Date: Sun, 1 May 2022 17:27:39 GMT Message-Id: <202205011727.241HRd8m062010@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: d592c0db8ba7 - main - cam: add hw.cam.iosched.read_bias List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d592c0db8ba773c143eeea28610288f800fa651a Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651426060; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2uVlF9Y/bJi59MespZ7dGuL0fmS/2+aIwCCVZ96h4z4=; b=kJ4WB/QF782Us8j3Qvxs6l1iod59VwnRBQz52G3zQkKnk6PCmnJiID+2jm/cAOU+8NTiz2 EfFzJBWRjm8F8sLrwfxtCg//nyyNKTDy8cvVU2NA1U48ndH5HE6Ui/rxeQseTmETtBHFQh z2FrJiHGuj51dzsMkk+b4lLHeOy90UGL861H02BNMucN1nvkQjL/U23/UAS9B0nVrmXPXt R4T6wDJ4I7wc0uIcciNAJp6crP3Kj4CBezLQCFLtZNeiMfhFJvUGyBY1m6T5qYGEob4xT2 /I4YIigrU3qk6XgqOpLiDBpqrUUxdqB1yyCaBS5VWtDxbwfuEwa6t9dBzQvDKQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1651426060; a=rsa-sha256; cv=none; b=O8vNNQPIr8hYAHecKQE2vFSa+8z3i/xVW0KOMjBj7cd7j5XXL5XepiCeO/eMFiD8xrASMM zohrqfQEl15IX53cGIhzYrIKqjYlnM5zDiy172qeRrmPlHZpmBzde/scpjBIoH08uLH25G reWKbwNG+fYizR1nhCY500cAT1y7fhZMvr0Zte+4rmKMsbesEOhhwQywodXb/toxZJJKE6 ZE5edzSyr3d4UN1xdZpbloO2iudGO30a//bTO0BoNhErrDM9Mnbj9kCtyKSMjZxROagv7z btFiDHgb+unN1OptjY2/FDNAkZRDjDYAMYJXNLFll2xV4BpfzpJYCFTRVMY/qg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=d592c0db8ba773c143eeea28610288f800fa651a commit d592c0db8ba773c143eeea28610288f800fa651a Author: Warner Losh AuthorDate: 2022-05-01 17:18:27 +0000 Commit: Warner Losh CommitDate: 2022-05-01 17:27:34 +0000 cam: add hw.cam.iosched.read_bias Allow a global setting for the read_bias for the dynamic io scheduler. This allows global policy to be set, in addition to the existing per-drive policy. kern.cam.iosched.read_bias is a new tunable. Sponsored by: Netflix Reviewed by: chs Differential Revision: https://reviews.freebsd.org/D34365 --- sys/cam/cam_iosched.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/sys/cam/cam_iosched.c b/sys/cam/cam_iosched.c index 21a948b69c69..c1e11419856b 100644 --- a/sys/cam/cam_iosched.c +++ b/sys/cam/cam_iosched.c @@ -139,6 +139,15 @@ SYSCTL_INT(_kern_cam_iosched, OID_AUTO, buckets, CTLFLAG_RD, &lat_buckets, LAT_BUCKETS, "Total number of latency buckets published"); +/* + * Read bias: how many reads do we favor before scheduling a write + * when we have a choice. + */ +static int default_read_bias = 0; +SYSCTL_INT(_kern_cam_iosched, OID_AUTO, read_bias, CTLFLAG_RWTUN, + &default_read_bias, 0, + "Default read bias for new devices."); + struct iop_stats; struct cam_iosched_softc; @@ -1149,7 +1158,7 @@ cam_iosched_init(struct cam_iosched_softc **iscp, struct cam_periph *periph) #ifdef CAM_IOSCHED_DYNAMIC if (do_dynamic_iosched) { bioq_init(&(*iscp)->write_queue); - (*iscp)->read_bias = 0; + (*iscp)->read_bias = default_read_bias; (*iscp)->current_read_bias = 0; (*iscp)->quanta = min(hz, 200); cam_iosched_iop_stats_init(*iscp, &(*iscp)->read_stats); @@ -1234,7 +1243,7 @@ void cam_iosched_sysctl_init(struct cam_iosched_softc *isc, SYSCTL_ADD_INT(ctx, n, OID_AUTO, "read_bias", CTLFLAG_RW, - &isc->read_bias, 0, + &isc->read_bias, default_read_bias, "How biased towards read should we be independent of limits"); SYSCTL_ADD_PROC(ctx, n,