Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp795090rwb; Mon, 26 Sep 2022 06:04:33 -0700 (PDT) X-Google-Smtp-Source: AMsMyM61fJB5UL73dDk74Zc8AwC+18ffykOM02Ffe9rYjriJXHvO6oSFwga+WrQhJWTN1sABUDSR X-Received: by 2002:a05:6a00:22d6:b0:543:7003:21ab with SMTP id f22-20020a056a0022d600b00543700321abmr23461763pfj.54.1664197473206; Mon, 26 Sep 2022 06:04:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664197473; cv=none; d=google.com; s=arc-20160816; b=vDFkOFDZYEwIxScoWPFcBq+Uellhw9OjM1gWd8wK91mf4uzzVT0+FifDxe/bYeyQ6T MuGsya95Lg+AEfaeD3uuQU7t8O73gO+hFR/hCG/ISx1qOg1/DgBeXjSH6k2hyGSpgwb6 kUm40VvxsJgFna+2bKLE/Lr/SfUpNC5QDmLQNgURHwyUpQEMlEKBxthJpUK/wlV8yQWm ciPpoNAb4WnKocun8yUjgP0SnlyErCOT0eN4phezJnDPdFQp8FjEbC9rfeiifjsynuf5 Z3ItOLj0qTdrOqcr66Rm7YLC92Yz9Vhz2bHM3Kg+i4at5J8R4//0NVNsG+eMSTCxV3Dm t0dA== 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=lzbKnMCjWWaYv+/H9kr0CdDgcIwM5859p/LWfCoLWLw=; b=zErJAKTZa5gM4LIloi7NAXwFSmW9OgAXrWSlGzfgpN6qoYQnoDxmXZWftPpJ1FGL7K j9HqaqjGj6cLLemUvEof+0LqKoC7XPBHQZnzEy+IA5WoYkAPEosM8l8oGh32VkwG0ymX D9Gp2IAqnBwbbKjKLrzL09oGGZNH6AgnE+XJohU3aBTOB3yUERtxz7909vwXN1W51QvP MJQm7TMZr4Fod5tWXJk3cpEuMrgOFXOxZVyga7fLvu87yI8ic+tHEMefnURfl9jcPyU9 v9TWkgmECokJeyct1E8X9LvnkjiFpxZbTgXBTWKKUw5iAm3cW0tEDFdr8USytui/iFax UdlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HGhFBKme; 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 g30-20020a63521e000000b0042ff6b15129si19440908pgb.2.2022.09.26.06.04.18; Mon, 26 Sep 2022 06:04:33 -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=HGhFBKme; 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 S235895AbiIZKfY (ORCPT + 99 others); Mon, 26 Sep 2022 06:35:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235840AbiIZKdM (ORCPT ); Mon, 26 Sep 2022 06:33:12 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E57A449B51; Mon, 26 Sep 2022 03:20:29 -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 CE92A60B60; Mon, 26 Sep 2022 10:20:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C434CC433C1; Mon, 26 Sep 2022 10:20:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664187618; bh=olcYasHuW7BIezTv9Mi3hwjM/yjhD8t6eRgTA7tM4sU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HGhFBKmepNeOn6Pfss/nHnlVZ09w2W8+3LVRP498kKB0LJXHmMfQXt3NdCKJilzR6 rY1GkzYggcf9H7STJyRe2f/M8SEb85sMkcF2Exbu4maoqvZDx8fU1DYzr5d/RixDqJ IuJu8K/f087LhnENsReCGk4ZRAMwNNFOzrtSKAsk= 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 4.19 57/58] ext4: make directory inode spreading reflect flexbg size Date: Mon, 26 Sep 2022 12:12:16 +0200 Message-Id: <20220926100743.569623445@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220926100741.430882406@linuxfoundation.org> References: <20220926100741.430882406@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 @@ -505,7 +505,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;