Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1oXnZa-00052D-6Z for mharc-grub-devel@gnu.org; Mon, 12 Sep 2022 13:50:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54526) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oXnZR-0004zS-EA for grub-devel@gnu.org; Mon, 12 Sep 2022 13:50:11 -0400 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]:34537) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oXnZO-0000yk-4W for grub-devel@gnu.org; Mon, 12 Sep 2022 13:50:07 -0400 Received: by mail-pj1-x1032.google.com with SMTP id a5-20020a17090aa50500b002008eeb040eso4576464pjq.1 for ; Mon, 12 Sep 2022 10:50:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date; bh=Sr4eIqUy5dxzc+H6DaDM3196Caehu2LY9V1FarhtB10=; b=McoRrkHe7w+wmk9aUWoyamH7FVfAiFn4w01ceQkhMRG49O0cy7XTcl0G6//4qUVT4y zhe+IXW1yC4tBSlA+is759xwAvNkQchEmzJh+lhwzMam78l1/SlfMTN1inPHQGDoeayC 8iF9wrubFIHIZEUFH3DvPM7F7RPrMKsyk0K96Rbn/7fkykVOr6Ov3YHEslqZ5Q2Tzm4I XjBShA3/B98FkQ2nNJ852qwhD44bPyCBM9HDGZsNkDQ2MIXG/yLqG02+JSGd45vcbFT6 LFoxFazsgU6batgCECxav5kyfMOoKnQ8lNn3wxsgB+bADlJg9RL5mBw9CHLLqhrniiWl +kzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date; bh=Sr4eIqUy5dxzc+H6DaDM3196Caehu2LY9V1FarhtB10=; b=eL+RDGQGiBggNGW2U1N055qhqhXtPQcCw/xMi3fl4UTygL4WWgfeZIAxgTyzYl+zqI TeWtgu6RWsxFQv/OcvJ1IVOr0t0f8gmlCrVV1RxNJWwuYFEqvwuEckjXbKimcuVS6Sat RiqE0L3OYY+R3kLQPgH7h0WItkADowq4P4kmLjCVSvkraaBXd2OgdAvW8EMoScF2DYxe s/59BkeBDHTUv26FIgJ90qar4VCX/ZijIoD0Ut+nNHK9MVSHIUaS/LZkIXWTbwZyT7C/ GiBWfsP86lYXrDCDCCKSJwinL3Kx4uUeY2Uia2nEOegoxaqCskKiWNbeZ34HpFo2nsM0 ZIHA== X-Gm-Message-State: ACgBeo1BrFzht2uMQoS2dvKHiQZbaS2bgy3gfd/3oUjdS9iEyyE4yviS 5jlHQO2PEwy2EJtZtxH8zLxuok0ZjXrXDQ== X-Google-Smtp-Source: AA6agR4OuqG5W8wbN/cloGS6hhmyg380qksgGykXeMecxDB/8/tU41oDxB9L5B0QNEUHsZrEqbL+Yg== X-Received: by 2002:a17:903:2289:b0:177:ab99:9f9 with SMTP id b9-20020a170903228900b00177ab9909f9mr25393720plh.78.1663005004490; Mon, 12 Sep 2022 10:50:04 -0700 (PDT) Received: from localhost.localdomain (ec2-13-113-80-70.ap-northeast-1.compute.amazonaws.com. [13.113.80.70]) by smtp.gmail.com with ESMTPSA id z189-20020a6233c6000000b0054087e1aea4sm6058569pfz.15.2022.09.12.10.50.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Sep 2022 10:50:04 -0700 (PDT) From: Zhang Boyang To: grub-devel@gnu.org Cc: jim945@mail.ru, glin@suse.com, dkiper@net-space.pl, dja@axtens.net, ps@pks.im, droidbittin@gmail.com, heinrich.schuchardt@canonical.com, langner.marcel@myiq.de, marcan@marcan.st Subject: [PATCH v2 0/1] Fix slow loading problem introduced by 887f98f0d Date: Tue, 13 Sep 2022 01:49:51 +0800 Message-Id: <20220912174952.3046-1-zhangboyang.id@gmail.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::1032; envelope-from=zhangboyang.id@gmail.com; helo=mail-pj1-x1032.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Sep 2022 17:50:11 -0000 Hi, This patch should probably fix the slow loading problem introduced by 887f98f0db43 (mm: Allow dynamically requesting additional memory regions). Although I'm not against increasing default heap size, simply increasing heap size may not fully fix the problem. I think the root cause is disk caches are always invalidated when almost every malloc() after default heap size is exhausted. However, I havn't reproduced the problem, so I haven't tested my patch. I would appreciate if someone can test this patch. Changes in V2: Use GRUB_MM_HEAP_GROW constant instead of hardcoding 0x100000. Renamed "rsize" to "grow". Check "grow" against sanity limits. Best Regards, Zhang Boyang