From nobody Mon Jan 13 19:23:29 2025 X-Original-To: dev-commits-src-all@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 4YX2H61GCtz5kjNH; Mon, 13 Jan 2025 19:23:30 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YX2H60GYbz3VvM; Mon, 13 Jan 2025 19:23:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736796210; 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=tV+l5cTHG4xfuO1q8qMSR74fPyGlUqgsSbW37LIHNt4=; b=Mz6+vzjqVrW55ondpopd9W2gCFfA9UV7D9Ld0iv6t3MM1zAGgsbsGJ23aL0kQ8awqIKMZV 6PkCsDjCnnsh1VgDZFePOuPE4/jBtVUjZr0KIkwrNWOGsDjqOR7ksGSMf73D6Q3IwKo837 72pAlR5wUgtjriXUCkBB0sMA4ldTXR6BQbWoUIPZmIbIs5A2Ej/xDX7i8CDpwCY7/YRx7U AtsmZkgne5DwLU3ZHY3B8Dq5Vow0d/up6QqwnL6NPRM4sZj9LD8v0XRZoODPE314jbN8Ir ORAZFsv53ifIJfQFZRB74eVyD9ZhLzJM+ykBf0aSzU6UZUrZR38RhJX5xAH1qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736796210; 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=tV+l5cTHG4xfuO1q8qMSR74fPyGlUqgsSbW37LIHNt4=; b=skJFbkHAn5XDnE+7qTmUwKFWT6fWu8sno17lSK2gUwvIt3m0l0QhBZoZRFb9W92W97Gi39 cmRMpVQHgyMwDnpuOKG1BrGhcgF6d9stlIx8gvNXZJBriU7I3o4uhhG1QJVuCF6dv1Q8t+ CrgbJt5IjNWEtPJWLFyWSGPGMKADMU5ks45w1awVYkp0j1cQFqN4RfHte0O/FwVHnEvQIY sHt8GiLpg4gZGb6V7+grLtbSaFhfyq7tSNhMyE+RQYIANunYCtbZWkXrp0yeShAKRALHft YlR07uCV9ros4nxHhVwjAsi9RoK1USVpfiq3mTWX0KZ47Tw37W6AZfwfNrpBwg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736796210; a=rsa-sha256; cv=none; b=tE/2PtNd+uTfjBf2lAM6j4uEvGe0dOu/r6x3nSwQVlBwMzYgOnZmbivY35uCLqzq5ja74z EPCGZIRsZBDjXaMmjx4B4VqVEMWa2F9eQx+YMDwEZNrsg32a9WUEWiH74nt/mw9BORCEsi mROW8VS6CUG1IGRP1uP/UeyZnIEHytKxOsMEh8zF1aftV2ihkJyB56g6G7Lnvr4i/bRfvZ 3O5IvqnTBHo7MTWDV0jTuyGj9QC/KtyS4QrWWGCSx/ezI+u6DlqxlW5niljuboXezYZtPg 4F826IL/sLPJ8CggvTjc3rQ5Lk5aKpeDczPrLt7J3xS2qUftO3TUCrfKE0bOoQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4YX2H56m32zjTN; Mon, 13 Jan 2025 19:23:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50DJNTcv039230; Mon, 13 Jan 2025 19:23:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50DJNTjZ039227; Mon, 13 Jan 2025 19:23:29 GMT (envelope-from git) Date: Mon, 13 Jan 2025 19:23:29 GMT Message-Id: <202501131923.50DJNTjZ039227@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: a57a2c01aacc - main - ffs_blkpref_ufsX(): do not iterate over startcg twice List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a57a2c01aacc5e2a29fa33d50aecc516e37cecd0 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=a57a2c01aacc5e2a29fa33d50aecc516e37cecd0 commit a57a2c01aacc5e2a29fa33d50aecc516e37cecd0 Author: Konstantin Belousov AuthorDate: 2025-01-05 23:00:10 +0000 Commit: Konstantin Belousov CommitDate: 2025-01-13 19:22:44 +0000 ffs_blkpref_ufsX(): do not iterate over startcg twice Tested by: pho Reviewed by: mckusick Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D48378 --- sys/ufs/ffs/ffs_alloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c index 713dcf1ca97a..01bfdb85c2e6 100644 --- a/sys/ufs/ffs/ffs_alloc.c +++ b/sys/ufs/ffs/ffs_alloc.c @@ -1496,7 +1496,7 @@ ffs_blkpref_ufs1(struct inode *ip, fs->fs_cgrotor = cg; return (cgdata(fs, cg)); } - for (cg = 0; cg <= startcg; cg++) + for (cg = 0; cg < startcg; cg++) if (fs->fs_cs(fs, cg).cs_nbfree >= avgbfree) { fs->fs_cgrotor = cg; return (cgdata(fs, cg)); @@ -1608,7 +1608,7 @@ ffs_blkpref_ufs2(struct inode *ip, fs->fs_cgrotor = cg; return (cgdata(fs, cg)); } - for (cg = 0; cg <= startcg; cg++) + for (cg = 0; cg < startcg; cg++) if (fs->fs_cs(fs, cg).cs_nbfree >= avgbfree) { fs->fs_cgrotor = cg; return (cgdata(fs, cg));