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

Hi -

> +  // 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;
> +    }

Yeah, something like that.  It turns out that space for the prefetch
cache is not used at all if RPM (and don't forget about other archive
types!) is not in effect.  So it's harmless to set those defaults
unconditionally.  How about a simpler:

     if ( fdcache_prefetch_fds == 0 )
       fdcache_prefetch_fds = fdcache_fds * .5;
     if ( fdcache_prefetch_mbs == 0 )
       fdcache_prefetch_mbs = fdcache_mbs * .5;

- FChE


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

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-09 18:28 Noah Sanci
2022-05-09 18:35 ` Frank Ch. Eigler [this message]
     [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=20220509183520.GE20072@redhat.com \
    --to=fche@redhat.com \
    --cc=elfutils-devel@sourceware.org \
    --cc=nsanci@redhat.com \
    /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).