Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1663308rwb; Mon, 7 Nov 2022 04:29:09 -0800 (PST) X-Google-Smtp-Source: AMsMyM4v9Px3krdWitj7lEEmr/pnek0bHdwizrpY8Op0IhbUy1mzRlEEIeXhB9ZZVXj7JXve+sb8 X-Received: by 2002:a17:902:d2c9:b0:186:afd7:56d5 with SMTP id n9-20020a170902d2c900b00186afd756d5mr49209249plc.2.1667824149280; Mon, 07 Nov 2022 04:29:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667824149; cv=none; d=google.com; s=arc-20160816; b=Xp3qoHTmYhA5DuLSNXiFtviD0xMqraecdAktPKf95LYdUfPV+lu8fOiPWZbjq3ci2X QiNVrefEXoWKsAu5fzOjI4zR+7KOPenWFrcL3ZpC7wU+j2cJoKt0eDpQ5kyddfh9bbHc FAc9l6zMX+wLI7UH6y352ejcL+/np9u5h2JM4Dhza8n9AYD4xUxhcIH7pVe/a3ieZI5C swj44RGHuChRqW/S1Hu+GRx06XD6grk0gSYw7zaM30jol+5689XqCRQX9iSns4xFn3iA BjTmVB7cakPw3whaaOP2p06xvXqCOr8248hDKRXw+mg16eNeBj4Wh0rTq9tmon9Umw6e nHZA== 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=QtXmD/lEl778OTe8VYWxOkNds5J1K1V5LHDiok1FnYM=; b=T6rWMAcYhDEoQKvsa+Ewp+TfjvIxOxgYk00Ud4/w5arSGEm7p8BV2rcfqKpwDFopJU SBsU+hW6E2ixsfDpJuyCelz/wdtqa42Z/U4tFqgoZHbwUFoCpAZvE6W+oWyeoYH0Jsz6 Dp4x+XHqyUSPiJSXZq3lBIRQJRxG0qkMH7Mg8zStHethEAUw0hNQeN34Oyofuw15QxD9 9o9BKcyy7ggCFuynqpbqNLn/RzHJ++DuK7lBhEMCfqFKgvN+fqQ5AeOJaDWL/en4dN4v kY+KK0OCIkHqV7lwsMYEZfpEZNfeB1bs472UjJuIZaIk3PVSmp8ZnrmPMBtkGgMs7ShY Oe7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Kxz3xD7W; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x11-20020a170902b40b00b00187073496b4si8863888plr.136.2022.11.07.04.28.56; Mon, 07 Nov 2022 04:29:09 -0800 (PST) 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=@gmail.com header.s=20210112 header.b=Kxz3xD7W; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232265AbiKGM23 (ORCPT + 99 others); Mon, 7 Nov 2022 07:28:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232244AbiKGM2Q (ORCPT ); Mon, 7 Nov 2022 07:28:16 -0500 Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E5742140F6 for ; Mon, 7 Nov 2022 04:28:15 -0800 (PST) Received: by mail-pj1-x102f.google.com with SMTP id e7-20020a17090a77c700b00216928a3917so9572266pjs.4 for ; Mon, 07 Nov 2022 04:28:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=QtXmD/lEl778OTe8VYWxOkNds5J1K1V5LHDiok1FnYM=; b=Kxz3xD7WwfSPZlUxKcITjoSiSeITQJR1+THK00JSuyp8C0PDmoUtY8lmQZ1UBTKMAP cXk0Zh6wiExpaQRCbtQV5Sr0WPeyQTAvR3D9GZAdJ6wUBBDs73CQvNADbKWMB2r/QlGR e0JzDPuLS5LaCUa1vE8f35HrysYflm/m73DSttJYRSZY1ZVDBf3W4ILlbySGSUlkY50e enebH91FAdIb8XR+UALwXoasbN+BFFDImvecZePXruNO3DI2pc6xgI/cKs2b8FDUHcJY G2sEyDLimbDdO49ClfyWGGIy+Fyyo9GeDCMSzFDWZUAtXAjryHHBE/kAvkEqd9njRHv6 tOCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QtXmD/lEl778OTe8VYWxOkNds5J1K1V5LHDiok1FnYM=; b=i+AsLz2+IWiRRgoJ2kH+DAhBNFs/npUwG4UydxnIHAeA08WtrXPd5VNzw8XVsYOFgG dEmJfOD/j54EVSbSOWnl4up93bL0l9skMRKs8dZcW/9mOqXg1iNK+Abqhb/RWx49dO5U qDiwSirChIUiBhQDveTMTZLa6y8UjRybWvrATevCtGxbtOFJ2W39R2hmS5wb49Ftn5fn kN5ItM3zY9b1TYQThmA8TYuBRqkYbhcNf0WBICZhp2R0YAmOfoL0VRxERhZ5C/H2Lrnk a0kkrBgOg3YccCiQcmFs2a5JXnvjp8AmVGPiOyw588opeBEh59gzI0xlDViaqVZ8aAOE frcQ== X-Gm-Message-State: ACrzQf1OOvbJkvJ6jAbMz6HYrPZTuUuPyPrlyrCK7U7oTCgLQUek79+e Z1ya9zOEEqojFgLG+hhOuX0= X-Received: by 2002:a17:90b:264e:b0:212:d06f:35ad with SMTP id pa14-20020a17090b264e00b00212d06f35admr52612000pjb.2.1667824095649; Mon, 07 Nov 2022 04:28:15 -0800 (PST) Received: from localhost ([2406:7400:63:f20b:312d:45b2:85c1:c486]) by smtp.gmail.com with ESMTPSA id s23-20020a632157000000b0046ec0ef4a7esm4113356pgm.78.2022.11.07.04.28.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Nov 2022 04:28:15 -0800 (PST) From: "Ritesh Harjani (IBM)" To: Theodore Ts'o Cc: linux-ext4@vger.kernel.org, Harshad Shirwadkar , Wang Shilong , Andreas Dilger , Li Xi , Ritesh Harjani Subject: [RFCv1 58/72] e2fsck: make default smallest RA size to 1M Date: Mon, 7 Nov 2022 17:51:46 +0530 Message-Id: X-Mailer: git-send-email 2.37.3 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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-ext4@vger.kernel.org From: Wang Shilong If we have a smaller inodes per group, default ra size could be very small(etc 128KiB), this hurts performances. Tune above 128K to 1M, i see pass1 time drop down from 677.12 seconds to 246 secons with 32 threads. Signed-off-by: Wang Shilong Signed-off-by: Ritesh Harjani (IBM) --- e2fsck/readahead.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/e2fsck/readahead.c b/e2fsck/readahead.c index 38d4ec42..40b73664 100644 --- a/e2fsck/readahead.c +++ b/e2fsck/readahead.c @@ -234,6 +234,8 @@ int e2fsck_can_readahead(ext2_filsys fs) return err != EXT2_ET_OP_NOT_SUPPORTED; } +#define MIN_DEFAULT_RA (1024 * 1024) + unsigned long long e2fsck_guess_readahead(ext2_filsys fs) { unsigned long long guess; @@ -245,6 +247,8 @@ unsigned long long e2fsck_guess_readahead(ext2_filsys fs) * in e2fsck runtime. */ guess = 2ULL * fs->blocksize * fs->inode_blocks_per_group; + if (guess < MIN_DEFAULT_RA) + guess = MIN_DEFAULT_RA; /* Disable RA if it'd use more 1/50th of RAM. */ if (get_memory_size() > (guess * 50)) -- 2.37.3