From: "Maciej W. Rozycki" <macro@codesourcery.com>
To: Luis Machado <lgustavo@codesourcery.com>
Cc: Pedro Alves <palves@redhat.com>,
"gdb@sourceware.org" <gdb@sourceware.org>,
Tom Tromey <tromey@redhat.com>
Subject: Re: Unreliable BFD caching heuristic
Date: Mon, 25 Nov 2013 18:08:00 -0000 [thread overview]
Message-ID: <alpine.DEB.1.10.1311251750220.21686@tp.orcam.me.uk> (raw)
In-Reply-To: <52938CB2.8080700@codesourcery.com>
On Mon, 25 Nov 2013, Luis Machado wrote:
> > Compare st_ino/st_dev, and don't share if the system doesn't
> > provide meaningful bfd_stat data?
> >
> > symfile.c:separate_debug_file_exists does this already,
> > and then does a CRC check if all else fails. Not sure
> > whether the CRC part would be a good idea here.
> >
>
> I don't think the inode and device information are portable enough for us to
> use.
>
> The file CRC seems more appropriate in terms of portability, but we need to
> open the bfd, check the CRC and (maybe) close it if we find a cached entry.
> Sounds like a potential performance drawback, but it is more reliable IMO.
>
> We can't rely on the timestamp due to some filesystems having 1 second or 2
> seconds resolution. That doesn't seem enough.
The system clock may also have a 1 second resolution only (although these
are quite rare indeed these days) and a timestamp can be interfered with
(unless we check ctime too, but then some filesystems don't store it).
Calculating a CRC of the whole file may be unacceptably slow with large
executablees and slower targets, and may therefore defeat the very purpose
of BFD caching. If we were going down that path, then may I suggest
revisiting my original proposal to calculate a CRC or some other hash
value instead of raw ELF file/program/section headers (as available) that
we need to access anyway (and if cached in BFD, i.e. previously accessed,
then chances are to have them in the buffer cache already).
Maciej
next prev parent reply other threads:[~2013-11-25 18:08 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-21 17:39 Luis Machado
2013-11-21 17:58 ` Pedro Alves
2013-11-21 21:58 ` Tom Tromey
2013-11-23 12:14 ` Phi Debian
2013-11-25 17:45 ` Luis Machado
2013-11-25 18:07 ` Pedro Alves
2013-11-25 18:08 ` Maciej W. Rozycki [this message]
2013-11-25 18:21 ` Pedro Alves
2013-12-02 15:42 ` Tom Tromey
2013-12-03 15:28 ` Luis Machado
[not found] ` <CAC=yr6DRDsRLStnDNZW_2=0vOQY-oJHd55_nLUeb8Qetxo=yXw@mail.gmail.com>
2013-12-04 0:01 ` Luis Machado
2013-12-04 3:47 ` Eli Zaretskii
2013-12-04 15:54 ` Tom Tromey
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=alpine.DEB.1.10.1311251750220.21686@tp.orcam.me.uk \
--to=macro@codesourcery.com \
--cc=gdb@sourceware.org \
--cc=lgustavo@codesourcery.com \
--cc=palves@redhat.com \
--cc=tromey@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