Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp820413rwd; Thu, 25 May 2023 04:35:38 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6vfpP2CuLM1b58mYHqHL+39aG0Zd8EXvh+qeqvN+ljlfsZXFXzfwuj3EozrbFuJdo8NUcT X-Received: by 2002:a17:90a:d806:b0:253:49d7:ce19 with SMTP id a6-20020a17090ad80600b0025349d7ce19mr1418157pjv.18.1685014538499; Thu, 25 May 2023 04:35:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685014538; cv=none; d=google.com; s=arc-20160816; b=exnGRA5KqMTG0jNEFYcUJqyhynZXARXHU0PEzOsx3QBr4SaV7CSktREUxMdEYjGyV/ Kd48zi3Gk30Zz0/2qTfxoI3RbR7jXGjj13iAyMe/tRrLudWOtQ2MS5RajZE86IvUiwVP hjj+XLtrYZzPiF8rX+zMlufKcYhZ6yK/DuPm2lspEOHRqPCcqcdB6EnVBio2GaZJAuTa YK+tcPdEzViZytHZfkmKSvlAu5Tu62cZSUtwel2DsLGKmT8RG0HedyWY2jkoSig/ScPI VBMKckZjUTujarVmr7F2/CbmJETTyUzVFnHt6cCzjeyehyXxhB9xCw1mKwx2/D5XYAe2 2Ipg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=7uIBMHx24pT6r8DIYAJx2ZeLBmpIyqe1cOoxMpsClRM=; b=CCGxBwBKsCDuft7UlxcMHXiNT651+yf43/nnF33TQZd9Mz3PesI4DhF7dGMHte2kX6 krZf7pEpCqLssS8eVSxUbrxflB2p9ivAkH5uv6g/lSTHPulGP5qWAtKASbDafq6bF3ef IyXw8sv98HCzjoKch6fbSTJvLpyo/vRE5IQ1mXnPduByQM+EDouwCedW9B/0y9HVWhYr 6zz1KqLh7t6n+pVB1GCjicWbXp6TJZ3DTdbQAdZoaAk0uDJ8cr5+caNzM8u+ORpNl2y3 maYbmCnffNe8c3jE/QtQ6JK/N4AuzZBgpzT2sWx6u7KMzowWwNIjw8JOz3Ige+kBy4ma 7MnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=iTpay6GH; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 5-20020a17090a1a4500b00252cf7d9c42si3505214pjl.50.2023.05.25.04.35.26; Thu, 25 May 2023 04:35:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-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=@ibm.com header.s=pp1 header.b=iTpay6GH; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241012AbjEYLeQ (ORCPT + 99 others); Thu, 25 May 2023 07:34:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55906 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240400AbjEYLdn (ORCPT ); Thu, 25 May 2023 07:33:43 -0400 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E3AC191; Thu, 25 May 2023 04:33:42 -0700 (PDT) Received: from pps.filterd (m0353722.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34PBE8gb009140; Thu, 25 May 2023 11:33:32 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=7uIBMHx24pT6r8DIYAJx2ZeLBmpIyqe1cOoxMpsClRM=; b=iTpay6GHmdnzaTyKc3wrqXc16Ozph/PMZOKVL41EcuXgYLRF4Yb5DNbsqdIfRlbkwUcJ 0HTsXSdoYbTnnyD5fLTyVjP33L4V44um94Ep6W+0Jvot+NRYksUiJnuTd/8r2BYcRPOt 9LTFup9mAyAvST6oMnF6YGyulJ4iIc7h804kkS6R5d9Q5dch9osJBtfnb5sjpIocgZZq VBa8+MFnDiuqi3mlciZn9WjgRGSVT7IRsKuc8+eoRv2A9n0MGw8waMDUbxzjFhslbznP hQ5B0+CC7fG8ih3a9GNlqUwYuSe3Otc4fN8sbKv9XK9wR26h6OsPk//2VKo7K/qkR9F+ kA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3qt6m6rf0p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 25 May 2023 11:33:32 +0000 Received: from m0353722.ppops.net (m0353722.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 34PBFTbX012584; Thu, 25 May 2023 11:33:31 GMT Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3qt6m6rf03-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 25 May 2023 11:33:31 +0000 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 34P5UXTu026858; Thu, 25 May 2023 11:33:29 GMT Received: from smtprelay07.fra02v.mail.ibm.com ([9.218.2.229]) by ppma03ams.nl.ibm.com (PPS) with ESMTPS id 3qppcuadwk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 25 May 2023 11:33:29 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay07.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 34PBXRxZ61931824 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 25 May 2023 11:33:27 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1009F2004B; Thu, 25 May 2023 11:33:27 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 032A120043; Thu, 25 May 2023 11:33:25 +0000 (GMT) Received: from li-bb2b2a4c-3307-11b2-a85c-8fa5c3a69313.in.ibm.com (unknown [9.109.253.169]) by smtpav01.fra02v.mail.ibm.com (Postfix) with ESMTP; Thu, 25 May 2023 11:33:24 +0000 (GMT) From: Ojaswin Mujoo To: linux-ext4@vger.kernel.org, "Theodore Ts'o" Cc: Ritesh Harjani , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Jan Kara , Kemeng Shi , Ritesh Harjani Subject: [PATCH 07/13] ext4: Add counter to track successful allocation of goal length Date: Thu, 25 May 2023 17:03:01 +0530 Message-Id: <51cc5ea958b734057a8b31289f6973edec8ab3e4.1685009579.git.ojaswin@linux.ibm.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: yCZBgmC6zuyKrv8uhpzcrXQaa3xUarr- X-Proofpoint-GUID: hJ4AIUpxwJRqSQTsZSbMlhkkAiE2sP1g X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26 definitions=2023-05-25_06,2023-05-24_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 bulkscore=0 lowpriorityscore=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 impostorscore=0 mlxlogscore=999 priorityscore=1501 malwarescore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305250092 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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-ext4@vger.kernel.org Track number of allocations where the length of blocks allocated is equal to the length of goal blocks (post normalization). This metric could be useful if making changes to the allocator logic in the future as it could give us visibility into how often do we trim our requests. PS: ac_b_ex.fe_len might get modified due to preallocation efforts and hence we use ac_f_ex.fe_len instead since we want to compare how much the allocator was able to actually find. Signed-off-by: Ojaswin Mujoo Reviewed-by: Ritesh Harjani (IBM) Reviewed-by: Jan Kara --- fs/ext4/ext4.h | 1 + fs/ext4/mballoc.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index 7b460a31ac82..8bb1edcd2dda 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h @@ -1556,6 +1556,7 @@ struct ext4_sb_info { atomic_t s_bal_cX_ex_scanned[EXT4_MB_NUM_CRS]; /* total extents scanned */ atomic_t s_bal_groups_scanned; /* number of groups scanned */ atomic_t s_bal_goals; /* goal hits */ + atomic_t s_bal_len_goals; /* len goal hits */ atomic_t s_bal_breaks; /* too long searches */ atomic_t s_bal_2orders; /* 2^order hits */ atomic_t s_bal_cr0_bad_suggestions; diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index 98d93d2c5401..8786aa0dd57a 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c @@ -2962,6 +2962,7 @@ int ext4_seq_mb_stats_show(struct seq_file *seq, void *offset) atomic64_read(&sbi->s_bal_cX_failed[CR3])); seq_printf(seq, "\textents_scanned: %u\n", atomic_read(&sbi->s_bal_ex_scanned)); seq_printf(seq, "\t\tgoal_hits: %u\n", atomic_read(&sbi->s_bal_goals)); + seq_printf(seq, "\t\tlen_goal_hits: %u\n", atomic_read(&sbi->s_bal_len_goals)); seq_printf(seq, "\t\t2^n_hits: %u\n", atomic_read(&sbi->s_bal_2orders)); seq_printf(seq, "\t\tbreaks: %u\n", atomic_read(&sbi->s_bal_breaks)); seq_printf(seq, "\t\tlost: %u\n", atomic_read(&sbi->s_mb_lost_chunks)); @@ -4407,6 +4408,8 @@ static void ext4_mb_collect_stats(struct ext4_allocation_context *ac) if (ac->ac_g_ex.fe_start == ac->ac_b_ex.fe_start && ac->ac_g_ex.fe_group == ac->ac_b_ex.fe_group) atomic_inc(&sbi->s_bal_goals); + if (ac->ac_f_ex.fe_len == ac->ac_g_ex.fe_len) + atomic_inc(&sbi->s_bal_len_goals); if (ac->ac_found > sbi->s_mb_max_to_scan) atomic_inc(&sbi->s_bal_breaks); } -- 2.31.1