Images 💾

Last commit ⭐

commit 44a2157e2ea6a7e397d6512cca36610b21290f9b
Author:     brody-qq <brody.47.qq@gmail.com>
AuthorDate: Sun Jul 14 05:31:17 2024 +0100
Commit:     Nico Weber <thakis@chromium.org>
CommitDate: Fri Aug 30 22:22:13 2024 +0200

    Kernel/Ext2FS: Reduce allocations in compute_block_list_impl()
    
    In Ext2FSInode::compute_block_list_impl(), each call to
    process_block_array() creates a new ByteBuffer, which leads to a
    kmalloc() call. The ByteBuffer is then discarded when
    process_block_array() exits, leading to a kfree() call.
    
    This leads to repeated kmalloc() and kfree() calls as ByteBuffers are
    created and destroyed each time process_block_array() is called.
    
    This commit makes it so that only 1 ByteBuffer is created for each level
    of inode indirect block (so only 3 ByteBuffers are created at most).
    These ByteBuffers are re-used on each call to process_block_array().
    
    This reduces the number of kmalloc() and kfree() calls during
    compute_block_list_impl(), especially for larger files.