public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mark@klomp.org>
To: elfutils-devel@sourceware.org
Subject: Re: Optimize debuginfod-client cache lookup/cleanup a little
Date: Sun, 15 May 2022 00:36:09 +0200	[thread overview]
Message-ID: <YoAu2QqXh2l+Fico@wildebeest.org> (raw)
In-Reply-To: <20220509225723.96902-1-mark@klomp.org>

Hi,

On Tue, May 10, 2022 at 12:57:20AM +0200, Mark Wielaard wrote:
> debuginfod-client would try to create the cache config files twice,
> once through debuginfod_init_cache, which was always called before the
> debuginfod_clean_cache check. Which called debuginfod_config_cache
> which also tried to create the config files when they didn't exist
> yet. debuginfod_config_cache however had a small bug that meant it
> would not provide a valid struct stat if the config file didn't exist
> yet. The first patch fixes that:
> 
> [PATCH 1/3] debuginfod: Make sure debuginfod_config_cache always returns valid stat
> 
> Then the second patch removes debuginfod_init_cache which saves two
> stat calls (but introduces a new mkdir call).
> 
> [PATCH 2/3] debuginfod: Remove debuginfod_init_cache
> 
> Finally as soon as debuginfod_clean_cache commits to clean the cache
> dir we immediately update the mtime of the interval config file so
> other threads will not try to simultaniously also try to clean up the
> cache dir. Because that is just duplicate work.
> 
> [PATCH 3/3] debuginfod: update mtime of interval_path as early as possible

Frank said off-list that he didn't see anything wrong with these
patches. So I pushed thse 3 patches.

12 points!

Mark


      parent reply	other threads:[~2022-05-14 22:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-09 22:57 Mark Wielaard
2022-05-09 22:57 ` [PATCH 1/3] debuginfod: Make sure debuginfod_config_cache always returns valid stat Mark Wielaard
2022-05-09 22:57 ` [PATCH 2/3] debuginfod: Remove debuginfod_init_cache Mark Wielaard
2022-05-09 22:57 ` [PATCH 3/3] debuginfod: update mtime of interval_path as early as possible Mark Wielaard
2022-05-14 22:36 ` Mark Wielaard [this message]

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=YoAu2QqXh2l+Fico@wildebeest.org \
    --to=mark@klomp.org \
    --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).