PR29098: debuginfod - set default prefetch cache size to >0
authorNoah Sanci <nsanci@redhat.com>
Mon, 9 May 2022 17:15:04 +0000 (13:15 -0400)
committerFrank Ch. Eigler <fche@redhat.com>
Mon, 9 May 2022 23:30:07 +0000 (19:30 -0400)
Added default value to fdcache_prefetch_mds and fdcache_prefetch_fds.
Defaults to one half of corresponging fdcache's values.

Signed-off-by: Noah Sanci <nsanci@redhat.com>
foo

debuginfod/ChangeLog
debuginfod/debuginfod.cxx

index 619ebd8..026908c 100644 (file)
@@ -1,3 +1,7 @@
+2022-05-09  Noah Sanci  <nsanci@redhat.com>
+
+       * debuginfod.cxx (main): Set nonzero defaults for fdcache.
+
 2022-05-04  Frank Ch. Eigler <fche@redhat.com>
            Mark Wielaard  <mark@klomp.org>
 
index 4aaf41c..fde4e19 100644 (file)
@@ -3826,6 +3826,13 @@ main (int argc, char *argv[])
       error (EXIT_FAILURE, 0,
              "unexpected argument: %s", argv[remaining]);
 
+  // Make the prefetch cache spaces a fraction of the main fdcache if
+  // unspecified.
+  if (fdcache_prefetch_fds == 0)
+    fdcache_prefetch_fds = fdcache_fds / 2;
+  if (fdcache_prefetch_mbs == 0)
+    fdcache_prefetch_mbs = fdcache_mbs / 2;
+
   if (scan_archives.size()==0 && !scan_files && source_paths.size()>0)
     obatched(clog) << "warning: without -F -R -U -Z, ignoring PATHs" << endl;