-
-
Notifications
You must be signed in to change notification settings - Fork 604
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This patch optimizes RAM utilization of bootfs by eliminating unnecessary copy of data. It does so by pointing created file nodes to existing data offset in memory which is part of area where kernel is copied after decompression. In essence we add new flag rn_owns_buf to RAMFS ramfs_node to track if we can actually free memory whenever it happens. By default rn_owns_buf is set to true but new function ramfs_set_file_data called from unpack_bootfs() sets it to false. The savings of RAM are equal to the size of build/release/bootfs.bin which means we save around 700K with ZFS images, 0 with ROSF and as much as application code size with RAMFS where the improvement is most significant especially with Java images. Please note that file data referenced by nodes created during unpack_bootfs() would point to wherever bootfs.bin data is in the uncompressed kernel area which means it is most likely not aligned which possibly means slower access. This could be improved by making individual files aligned in bootfs.bin. Fixes #977 Signed-off-by: Waldemar Kozaczuk <jwkozaczuk@gmail.com> Message-Id: <20180823225354.7535-1-jwkozaczuk@gmail.com>
- Loading branch information
Showing
3 changed files
with
49 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters