public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: Noah Sanci <nsanci@redhat.com>
To: elfutils-devel@sourceware.org
Subject: [Bug debuginfod/29098] set default prefetch limits to >0
Date: Mon, 9 May 2022 14:28:35 -0400	[thread overview]
Message-ID: <CAJXA7qjz1k5T+gs8XUPiu6LZ03-9E86ErPFdA7fEgWtbzMaSLw@mail.gmail.com> (raw)

[-- 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


             reply	other threads:[~2022-05-09 18:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-09 18:28 Noah Sanci [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJXA7qjz1k5T+gs8XUPiu6LZ03-9E86ErPFdA7fEgWtbzMaSLw@mail.gmail.com \
    --to=nsanci@redhat.com \
    --cc=elfutils-devel@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).