public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mark@klomp.org>
To: elfutils-devel@sourceware.org
Subject: Optimize debuginfod-client cache lookup/cleanup a little
Date: Tue, 10 May 2022 00:57:20 +0200	[thread overview]
Message-ID: <20220509225723.96902-1-mark@klomp.org> (raw)

Hi,

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

Cheers,

Mark

             reply	other threads:[~2022-05-09 22:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-09 22:57 Mark Wielaard [this message]
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 ` Optimize debuginfod-client cache lookup/cleanup a little Mark Wielaard

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=20220509225723.96902-1-mark@klomp.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).