From nobody Thu Dec 18 04:13:59 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 E7BE3C32771 for ; Mon, 26 Sep 2022 11:11:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237481AbiIZLLP (ORCPT ); Mon, 26 Sep 2022 07:11:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237792AbiIZLJi (ORCPT ); Mon, 26 Sep 2022 07:09:38 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3355856BBF; Mon, 26 Sep 2022 03:35:21 -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 ams.source.kernel.org (Postfix) with ESMTPS id 03926B80915; Mon, 26 Sep 2022 10:33:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 349B3C433D7; Mon, 26 Sep 2022 10:33:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664188412; bh=YU5ZVW+vaaa0D5a/Gtln8E0+5y95LhWnRWKcQDa7Mfw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lmsY6lA4zcgyJ0scuuiwY05KoN8+ZGz4biCqx02YeAAAz6soCdgO4gpCXD3xhQDFj wZPG4IeyPc9Qn8xpLTTlGfmtGua+GQ85lVlrO/WpRdMQs4z5ZMzXKUTWk5v3nXh1bL 3lrD7r60CeVRWiMtmNd6UPhTHuo5ipdsvdQVK4rU= 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.10 141/141] ext4: make directory inode spreading reflect flexbg size Date: Mon, 26 Sep 2022 12:12:47 +0200 Message-Id: <20220926100759.579489997@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220926100754.639112000@linuxfoundation.org> References: <20220926100754.639112000@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 @@ -508,7 +508,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;