Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp812741rwb; Mon, 26 Sep 2022 06:14:57 -0700 (PDT) X-Google-Smtp-Source: AMsMyM79ngUZknE+ifgko5zJLir9PIR0TXsrGYtrUGljQYOt7g86+ZJXRQ4b5D477adnftEDfMB4 X-Received: by 2002:a17:907:c09:b0:781:ea21:3f69 with SMTP id ga9-20020a1709070c0900b00781ea213f69mr17261854ejc.413.1664198096913; Mon, 26 Sep 2022 06:14:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664198096; cv=none; d=google.com; s=arc-20160816; b=v2jj6dJQXtNpav4HiQTPzmVcR6VhUlVXWSVZlEq9HBs/zC516QjflJl7Iwv/OBhEqZ 1P81LCJuCI/0PYmjiyhXhoXSvCivtEWyNE0xYu+/IIYzAFueW9q8bfFq3yztrbZBQe6o Y1uUc5qKc1W6KAsFcng5bcLT0T5WYSmMsvFAv1DPdvcNsuTinixtvPIc7L6eL2rinAIM 37WSJCjlkEdwjTn0YoV7cjdwZgDPLvE3tfAte7t/dyXAZYpXqnIMeB6SmHVEkEpenfPc vtRUmKhuw2ikdWdSnA3SCxJfZkzaJrhqDhneOX/A3H9xdc7VZn4mrh3M1/idHIsormX/ u2rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Us9cGpKvQWRjVeTTdUviX6GNICj+nfmolDY5GiflUvw=; b=tMczFTdGkOV132ZgNnFKDy/U39xmHWC58advtafFeD6oP4hGIrhru2iHOyYOkDuJoX 0yKusHCy5mQkKcrt9lg5SykmVbYZ/p6CQLyDrpePjcgfvcHALTcgZukVmEuVjif214Sf t1Ac2S4Vs+k66qv+TMPrdWRib1anBhqxOE9EOksJ3IjRcb6Lb/vfA0ri+t2R+qUC8Cs/ hvC3erwDvqDhCPbXBUO+389Hl2+aty8su2MXeqBMIMvYxUjpRmmD/C6LA5xYrGvN1nZ9 AS/fImDuN7DCKkg9WpY2iHhO9m9DDh8p6lttqvmuoRNvz6MlAniI2zc1a/rSTMrc/cvK 6h/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=sC41mBgr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bf18-20020a0564021a5200b004575a5c88cbsi1477095edb.32.2022.09.26.06.14.31; Mon, 26 Sep 2022 06:14:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=sC41mBgr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239263AbiIZMCt (ORCPT + 99 others); Mon, 26 Sep 2022 08:02:49 -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-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; } - max_dirs = ndirs / ngroups + inodes_per_group / 16; + max_dirs = ndirs / ngroups + inodes_per_group*flex_size / 16; min_inodes = avefreei - inodes_per_group*flex_size / 4; if (min_inodes < 1) min_inodes = 1;