aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-10-08 12:04:49 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-10-08 12:04:49 +0200
commit7e9d4eeea163658d2ea99d15dfd340bcbe7c1a69 (patch)
treed15f8d4b2b760418ef78014198c56e02268f63f9 /lib
parent1fc5b3bb6d4dcaa5a1e54e3f60434c8623e8e274 (diff)
Remove maximum queue backlog guestimation.
Partially revers 2b7df394057c013fd042b85a4d5fd0104ba4a9be. Making the queue fill the entire RAM had some unintended side effects that need further investigation. For now, revert back to the old behaviour. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib')
-rw-r--r--lib/common/writer.c26
1 files changed, 0 insertions, 26 deletions
diff --git a/lib/common/writer.c b/lib/common/writer.c
index cfa22de..a4b764a 100644
--- a/lib/common/writer.c
+++ b/lib/common/writer.c
@@ -19,29 +19,11 @@ static size_t os_get_num_jobs(void)
nprocs = get_nprocs_conf();
return nprocs < 1 ? 1 : nprocs;
}
-
-static size_t os_get_max_ram(void)
-{
- struct sysinfo info;
-
- if (sysinfo(&info)) {
- perror("sysinfo");
- return 0;
- }
-
- return info.totalram;
-}
#else
static size_t os_get_num_jobs(void)
{
return 1;
}
-
-static size_t os_get_max_ram(void)
-{
- (void)cfg;
- return 0;
-}
#endif
static int padd_sqfs(sqfs_file_t *file, sqfs_u64 size, size_t blocksize)
@@ -75,20 +57,12 @@ fail_errno:
void sqfs_writer_cfg_init(sqfs_writer_cfg_t *cfg)
{
- size_t max_ram;
-
memset(cfg, 0, sizeof(*cfg));
cfg->num_jobs = os_get_num_jobs();
cfg->block_size = SQFS_DEFAULT_BLOCK_SIZE;
cfg->devblksize = SQFS_DEVBLK_SIZE;
cfg->comp_id = compressor_get_default();
-
- max_ram = os_get_max_ram();
- cfg->max_backlog = (max_ram / 2) / cfg->block_size;
-
- if (cfg->max_backlog < 1)
- cfg->max_backlog = 10 * cfg->num_jobs;
}
int sqfs_writer_init(sqfs_writer_t *sqfs, const sqfs_writer_cfg_t *wrcfg)