public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
* [Bug debuginfod/29098] set default prefetch limits to >0
@ 2022-05-09 18:28 Noah Sanci
  2022-05-09 18:35 ` Frank Ch. Eigler
  0 siblings, 1 reply; 3+ messages in thread
From: Noah Sanci @ 2022-05-09 18:28 UTC (permalink / raw)
  To: elfutils-devel

[-- Attachment #1: Type: text/plain, Size: 413 bytes --]

debuginfod/debuginfod.cxx:
- Added default value to fdcache_prefetch_mds and
  fdcache_prefetch_fds when -R is specified. Defaults   to one half of
  fdcache's values for those respective   variables. These values are only set
  when -R is specified

Note: the ratio of prefetch:fdcache file descriptors and MBs
          is set to 1:2 since the fdcache seems to be used less
          than the standard fdcache.

[-- Attachment #2: 0001-PR29098-debuginfod-set-default-prefetch-limits-to-0.patch --]
[-- Type: text/x-patch, Size: 1531 bytes --]

From caa420f97225c5cc31c3fa0650cc7e25af3b4e91 Mon Sep 17 00:00:00 2001
From: Noah Sanci <nsanci@redhat.com>
Date: Mon, 9 May 2022 13:15:04 -0400
Subject: [PATCH] PR29098: debuginfod - set default prefetch limits to >0
 debuginfod/debuginfod.cxx: - Added default value to fdcache_prefetch_mds and 
  fdcache_prefetch_fds when -R is specified. Defaults   to one half of
 fdcache's values for those respective   variables. These values are only set
 when -R is specified

Signed-off-by: Noah Sanci <nsanci@redhat.com>
---
 debuginfod/debuginfod.cxx | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/debuginfod/debuginfod.cxx b/debuginfod/debuginfod.cxx
index 4aaf41c0..b2fb2afb 100644
--- a/debuginfod/debuginfod.cxx
+++ b/debuginfod/debuginfod.cxx
@@ -3826,6 +3826,18 @@ main (int argc, char *argv[])
       error (EXIT_FAILURE, 0,
              "unexpected argument: %s", argv[remaining]);
 
+  // Make the prefetch cache spaces smaller than the normal
+  // fd cache if rpm scanning is on. This is to not waste memory
+  // since the prefetch cache isn't used when -R isn't specified
+  // Set to 1/2 arbitrarily
+  if ( scan_archives[".rpm"] == "cat" )
+    {
+      if ( fdcache_prefetch_fds == 0 )
+        fdcache_prefetch_fds = fdcache_fds * .5;
+      if ( fdcache_prefetch_mbs == 0 )
+        fdcache_prefetch_mbs = fdcache_mbs * .5;
+    }
+
   if (scan_archives.size()==0 && !scan_files && source_paths.size()>0)
     obatched(clog) << "warning: without -F -R -U -Z, ignoring PATHs" << endl;
 
-- 
2.31.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-05-09 23:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-09 18:28 [Bug debuginfod/29098] set default prefetch limits to >0 Noah Sanci
2022-05-09 18:35 ` Frank Ch. Eigler
     [not found]   ` <CAJXA7qj0U=+1_N2Gbvr6LvxTKmCZe5n3-mh1zEqTTwc+jRVO9g@mail.gmail.com>
2022-05-09 23:40     ` Frank Ch. Eigler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).