Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp811205rwb; Mon, 26 Sep 2022 06:13:57 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7BXbjcgpOY/Lb0E5k65o3DG1UPYP8fgK1Ph4xnrfRaZSHjzR/yMB9waXfj8y0Oe+35QBN5 X-Received: by 2002:a05:6402:f07:b0:450:bf95:59e9 with SMTP id i7-20020a0564020f0700b00450bf9559e9mr22496566eda.46.1664198037509; Mon, 26 Sep 2022 06:13:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664198037; cv=none; d=google.com; s=arc-20160816; b=bSAPqY/1xJ8BCFBaOlFmPVBse9tfP2xDxUHmiFuz/88GD1DxACsbpjEHuv5gG+q5Wa UXt6JMUEEGA7R29V4ivryx8WiLSjdrrond7jT91nqHC5sF2twxA2M3NNuqf/5VHdlC1m n6QydABiQpNrHfxYf73dHEVPIobbz6HZDEugkT4OdWhEoAepxKssEccs7gP+whw6I6qs 4tkwnEYSwvr5L/quuXOauIUtpq8yhbBzHyPNxYpm+RDynwwdOgIzRf0nsl97tpjbhRUt Bas5gDJv/GYvUX2bfAdNqB7yFGx0WPrlJBNK/F34d5xGPI8xNjUQFaAbmsHHhUftyBB8 vZSQ== 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=0bRbUj6vpCvOVbnidCREajNdRJgYDitOTUIKtTg5/v8=; b=tGv/bWgW0w3qcQa/w/8HKYncTf+UsBXPzRh/C644AwzxQGdywnhuoQm/sni5g24wPU 4lX243P2X3L74LCOi6c/sh+QO2fGLCH5G6KPRwoS/o1Klhvm8lIRBNwMW2rTpUaPeSib ZpNiesRKm2Hu5D1zMQK0rkiO/cDDrBYiMd/eNLygOnLwIhVafePiY5yN5FigBfk7fgLe TJc5MmSVHiqtzs431v80gY3Rl90emkoyv2eTe9xIrMxaaEgFGXXd1tL6Ojfkx9Bl1558 4OllFBXNfmQZFz/sC6hVErx1kV+HJArbzKg1ktNfQUCWYqIMMCuwAvdTgNXSP+Ad9/cG 4BpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qLoNKR9t; 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 ne35-20020a1709077ba300b007814ff4ce25si16583722ejc.285.2022.09.26.06.13.24; Mon, 26 Sep 2022 06:13:57 -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=qLoNKR9t; 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 S236722AbiIZKvs (ORCPT + 99 others); Mon, 26 Sep 2022 06:51:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236774AbiIZKtU (ORCPT ); Mon, 26 Sep 2022 06:49:20 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A98FC57E2B; Mon, 26 Sep 2022 03:26:40 -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 4A40DB8055F; Mon, 26 Sep 2022 10:26:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AA3E5C433C1; Mon, 26 Sep 2022 10:26:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664187998; bh=PO5Rmq/GPp6MyTXqGurVuNZqX+1cSG0VYjpuri+lVPc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qLoNKR9tRt02gb2rsu7FWOUQoNS3bElpWP35c6NTIbRV8AM7yF+FlEaDOvKpgyWIm DvrQZsOqkc/S8eqFq1YLl94r/oj0nB22Fu+5HTNxa7KkR/3cxjWA/I77Xd8d6dA6Hp whAG6Kv0VHAaUXMktsKPEbn3O0La8hmvkUKjTgCw= 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.4 103/120] ext4: make directory inode spreading reflect flexbg size Date: Mon, 26 Sep 2022 12:12:16 +0200 Message-Id: <20220926100754.757833170@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220926100750.519221159@linuxfoundation.org> References: <20220926100750.519221159@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=unavailable 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 @@ -500,7 +500,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;