From nobody Tue Dec 16 04:37:57 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 65910C07E9D for ; Mon, 26 Sep 2022 12:02:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239273AbiIZMCw (ORCPT ); Mon, 26 Sep 2022 08:02:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239521AbiIZL7H (ORCPT ); Mon, 26 Sep 2022 07:59:07 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D64CE58DED; Mon, 26 Sep 2022 03:53:05 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1C56460C41; Mon, 26 Sep 2022 10:51:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 27AC9C433C1; Mon, 26 Sep 2022 10:51:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664189506; bh=4mYWBhP/Z3ougimx06u882IxvUodzoAatzPIsgpPIIg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sC41mBgrC7Kqg/hZoJopDpIb3AJjaiRp0aJYOzKXqTZtcMOoSIHwKRYf3dptqkdeW JgblJdhi99e3UtJDPi8BowoYtD02/8+Ef6rphNuM+AO2ciBQFBLRAuQY7tji63cOce hhJKgFzf+2Zv0hHIl4uPQPdx96HCFl8D8t/SQSIw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stefan Wahren , Ojaswin Mujoo , stable@kernel.org, Jan Kara , Theodore Tso Subject: [PATCH 5.19 204/207] ext4: make directory inode spreading reflect flexbg size Date: Mon, 26 Sep 2022 12:13:13 +0200 Message-Id: <20220926100815.741129917@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220926100806.522017616@linuxfoundation.org> References: <20220926100806.522017616@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Jan Kara commit 613c5a85898d1cd44e68f28d65eccf64a8ace9cf upstream. Currently the Orlov inode allocator searches for free inodes for a directory only in flex block groups with at most inodes_per_group/16 more directory inodes than average per flex block group. However with growing size of flex block group this becomes unnecessarily strict. Scale allowed difference from average directory count per flex block group with flex block group size as we do with other metrics. Tested-by: Stefan Wahren Tested-by: Ojaswin Mujoo Cc: stable@kernel.org Link: https://lore.kernel.org/all/0d81a7c2-46b7-6010-62a4-3e6cfc1628d6@i2se= .com/ Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20220908092136.11770-3-jack@suse.cz Signed-off-by: Theodore Ts'o Signed-off-by: Greg Kroah-Hartman --- fs/ext4/ialloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/ext4/ialloc.c +++ b/fs/ext4/ialloc.c @@ -510,7 +510,7 @@ static int find_group_orlov(struct super goto fallback; } =20 - max_dirs =3D ndirs / ngroups + inodes_per_group / 16; + max_dirs =3D ndirs / ngroups + inodes_per_group*flex_size / 16; min_inodes =3D avefreei - inodes_per_group*flex_size / 4; if (min_inodes < 1) min_inodes =3D 1;