public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: Milian Wolff <mail@milianw.de>
To: Aaron Merey <amerey@redhat.com>
Cc: Mark Wielaard <mark@klomp.org>, elfutils-devel@sourceware.org
Subject: Re: caching failed lookups of debuginfo?
Date: Sat, 09 Apr 2022 00:23:32 +0200	[thread overview]
Message-ID: <274959185.zvkkRjgryB@milian-workstation> (raw)
In-Reply-To: <2180828.1FMjDaRedj@milian-workstation>

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

On Freitag, 8. April 2022 23:56:15 CEST Milian Wolff wrote:

<snip>

> Which in turn points at the code that does cache cleanup in
> `debuginfod_query_server`. I now used `rr` to record such a bogus run and I
> clearly see that `(time(NULL) - st.st_mtime <= cache_miss)` is false and it
> goes into the unlink case.
> 
> I'll try to debug this further now - I definitely do not wait 600s inbetween
> these runs here...

I compiled elfutils with debug output, and here's what I can see when I run 
`debuginfod-find`:

time(NULL) = 1649455510
st.st_mtime = 1649448650
delta = 6860
cache_miss = 600

The longer I wait, the bigger the delta becomes - i.e. for every second I 
wait, the `delta` increases by one.

And I think I know where this comes from:

```
# first we stat the target cache path
if (stat(target_cache_path, &st) == 0
  {

  # then we pass _the same st_ to
  debuginfod_config_cache(cache_miss_path, cache_miss_default_s, &st)

  # which internally will do 
  stat(config_path, st)

  # then we check the time delta
  time(NULL) - st.st_mtime <= cache_miss
```

I.e. when we check the time delta, we only take the time stamp of the 
`config_path` into account - the time stamp of the `target_cache_path` is 
ignored.

I mount my filesystems with relatime (old advise for ssd's, probably not 
relevant anymore?). I guess that's the issue then?

Can we change the above code to store the `st.st_mtime` for 
`target_cache_path` and use that for comparison purposes? That fixes the issue 
for my case. If this is acceptable, I'll provide a patch.

Thanks
-- 
Milian Wolff
mail@milianw.de
http://milianw.de

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  parent reply	other threads:[~2022-04-08 22:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-08 19:58 Milian Wolff
2022-04-08 20:05 ` Frank Ch. Eigler
2022-04-08 20:45   ` Milian Wolff
2022-04-08 20:59     ` Mark Wielaard
2022-04-08 21:08       ` Milian Wolff
2022-04-08 21:34         ` Aaron Merey
2022-04-08 21:56           ` Milian Wolff
2022-04-08 22:21             ` Mark Wielaard
2022-04-08 22:23             ` Milian Wolff [this message]
2022-04-08 22:40               ` Mark Wielaard
2022-04-08 22:54                 ` Aaron Merey

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=274959185.zvkkRjgryB@milian-workstation \
    --to=mail@milianw.de \
    --cc=amerey@redhat.com \
    --cc=elfutils-devel@sourceware.org \
    --cc=mark@klomp.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).