Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Doug Evans <dje@google.com>
To: Pedro Alves <pedro@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA] Use data cache for stack accesses
Date: Wed, 26 Aug 2009 16:36:00 -0000	[thread overview]
Message-ID: <e394668d0908260929s2264835el8d481a596a8cf104@mail.gmail.com> (raw)
In-Reply-To: <200908251944.45977.pedro@codesourcery.com>

On Tue, Aug 25, 2009 at 11:44 AM, Pedro Alves<pedro@codesourcery.com> wrote:
> On Tuesday 25 August 2009 01:48:30, Doug Evans wrote:
>> On Thu, Aug 20, 2009 at 11:00 PM, Doug Evans<dje@google.com> wrote:
>> > On Wed, Jul 8, 2009 at 1:46 PM, Pedro Alves<pedro@codesourcery.com> wrote:
>> >> On Wednesday 08 July 2009 21:08:00, Jacob Potter write:
>
>> >> What if we do this within dcache itself, similarly
>> >> to get_thread_regcache?  That would be probably in [dcache_xfer_partial].
>> >
>> > It seems that given that we can temporarily change inferiors without
>> > giving subsystems notice of the change, and given vfork, then we need
>> > to have intelligence in dcache to handle this (and then it's not clear
>> > if we should keep one dcache per inferior).
>> >
>> > How about having memory_xfer_partial notify dcache of every
>> > write/read, and then dcache could keep just one copy of the cache and
>> > flush it appropriately?
>
>> Something like this?
>
> Eh, that's exactly what I meant by 'similarly to get_thread_regcache'.
> (Ulrich rewritten it since somewhat to keep more than one more than
> one regcache live at once).
>
> A few small nits: Please fix up a few missing
> double-space-after-period instances, and here,
>
>> +  if (inf
>> +      && readbuf == NULL
>
> both inf and readbuf are pointers, so please either make both
> subpredicates compare with NULL or neither.  Hmm, actually, I'm not
> sure  why you still need to check the inferior for nullness
> in this version?

It wasn't clear to me whether TRTTD was check inf for NULL either, but
the code can only be used if there is an inferior so I left it in.

> I think that the cache should be flushed with
> "set stack-cache off" -> "set stack-cache on", you never
> know what happened between these two commands, so you end up
> with a stale cache.

Righto.

> If write_memory|stack tries to write to [foo,bar), and that
> operation fails for some reason somewhere between foo and bar, I
> think that the cache between somewhere and bar shouldn't be
> updated with the new values.  Is it?

Indeed.  I recall looking at this but I'll go back and check.

> I worry about new stale cache issues in non-stop mode.
> [...]
> It appears that (at least in non-stop or if any thread is running)
> the cache should only be live for the duration of an "high level
> operation" --- that is, for a "backtrace", or a "print", etc.
> Did you consider this?

It wasn't clear how to handle non-stop/etc. mode so I left that for
the next iteration.
If only having the data live across a high level operation works for
you, it works for me.

> Did you post number showing off the improvements from
> having the cache on?  E.g., when doing foo, with cache off,
> I get NNN memory reads, while with cache off, we get only
> nnn reads.  I'd be curious to have some backing behind
> "This improves remote performance significantly".

For a typical gdb/gdbserver connection here a backtrace of 256 levels
went from 48 seconds (average over 6 tries) to 4 seconds (average over
6 tries).


  reply	other threads:[~2009-08-26 16:29 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-08 20:49 Jacob Potter
2009-07-08 20:51 ` Pedro Alves
2009-07-08 20:58   ` Pedro Alves
2009-07-08 23:46   ` Daniel Jacobowitz
2009-07-09  3:06     ` Pedro Alves
2009-07-10  9:34       ` Pedro Alves
2009-07-10  8:45     ` Jacob Potter
2009-07-10 14:19       ` Pedro Alves
2009-07-13 19:25         ` Jacob Potter
2009-08-21  6:25   ` Doug Evans
2009-08-25  3:00     ` Doug Evans
2009-08-25 18:55       ` Pedro Alves
2009-08-26 16:36         ` Doug Evans [this message]
2009-08-26 22:45           ` Pedro Alves
2009-08-27  0:46             ` Doug Evans
2009-08-27  3:11               ` Doug Evans
2009-08-29  5:16             ` Doug Evans
2009-08-29 18:28               ` Doug Evans
2009-08-29 20:25               ` Pedro Alves
2009-09-02 20:43       ` Tom Tromey
2009-09-03 15:38         ` Doug Evans
2009-09-03 19:38           ` Tom Tromey
2009-09-03 19:45           ` Daniel Jacobowitz
2009-07-09 12:20 ` Eli Zaretskii

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=e394668d0908260929s2264835el8d481a596a8cf104@mail.gmail.com \
    --to=dje@google.com \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@codesourcery.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