Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Don Breazeal <donb@codesourcery.com>,
	gdb-patches@sourceware.org,        qiyaoltc@gmail.com
Subject: Re: [PATCH v2] Optimize memory_xfer_partial for remote
Date: Fri, 24 Jun 2016 22:23:00 -0000	[thread overview]
Message-ID: <0e16a8d3-0fc6-2b1f-c5aa-799ec91d4e0d@redhat.com> (raw)
In-Reply-To: <1466803274-62026-1-git-send-email-donb@codesourcery.com>

On 06/24/2016 10:21 PM, Don Breazeal wrote:
> 
> and with commit hash: 67c059c29e1fb0cdeacdd2005f955514d8d1fb34
> 

Write:

 ... with commit 67c059c29e1f ("Improve performance of large restore
 commands") ...

so the reader has a clue what the commit is about without having
to check.


> gdb/ChangeLog:
> 2016-06-24  Don Breazeal  <donb@codesourcery.com>
> 
> 	* remote.c (remote_get_memory_xfer_limit): New function.
> 	* target-delegates.c (delegate_get_memory_xfer_limit,
> 	debug_get_memory_xfer_limit, install_delegators,
> 	install_dummy_methods, init_debug_target): New functions
> 	and target_ops initialization from regenerating the file.

The standard practice is to just say:

 	* target-delegates.c: Regenerate.

> 	* target.c (default_get_memory_xfer_limit): New function and
> 	forward declaration.
> 	(memory_xfer_partial): Call target_ops.to_get_memory_xfer_limit.
> 	* target.h (struct target_ops)<to_get_memory_xfer_limit>: New
> 	member.

Space between ")<".

> 
> diff --git a/gdb/remote.c b/gdb/remote.c
> index 501f3c6..03c7ab7 100644
> --- a/gdb/remote.c
> +++ b/gdb/remote.c
> @@ -10160,6 +10160,12 @@ remote_xfer_partial (struct target_ops *ops, enum target_object object,
>    return TARGET_XFER_OK;
>  }
>  
> +static ULONGEST
> +remote_get_memory_xfer_limit (struct target_ops *ops)

Intro comment, something like "Implementation of ... method.".

>  
> +/* The default implementation for the to_get_memory_xfer_limit method.
> +   The hard-coded limit here was determined to be a reasonable default
> +   that eliminated exponential slowdown on very large transfers without
> +   unduly compromising performance on smaller transfers.  */

Where's this coming from?  Is this new experimentation you did,
or are you talking about Anton's patch?

> @@ -1301,8 +1314,9 @@ memory_xfer_partial (struct target_ops *ops, enum target_object object,
>  	 by memory_xfer_partial_1.  We will continually malloc
>  	 and free a copy of the entire write request for breakpoint
>  	 shadow handling even though we only end up writing a small
> -	 subset of it.  Cap writes to 4KB to mitigate this.  */
> -      len = min (4096, len);
> +	 subset of it.  Cap writes to a limit specified by the target
> +	 to mitigate this.  */
> +      len = min (ops->to_get_memory_xfer_limit (ops), len);
>  

Does this still work if remote is not the top-most target?

E.g., what happens if you do "record" to push a record_statum
target on top?  Do we get the 4KB default limit, or the
remote limit?

Thanks,
Pedro Alves


  reply	other threads:[~2016-06-24 22:23 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-03 19:02 [PATCH] " Don Breazeal
2016-06-20 15:31 ` [PING] " Don Breazeal
2016-06-20 19:25 ` Pedro Alves
2016-06-21 10:15   ` Yao Qi
2016-06-24 21:21   ` [PATCH v2] " Don Breazeal
2016-06-24 22:23     ` Pedro Alves [this message]
2016-06-27 20:23       ` Don Breazeal
2016-06-30 17:06         ` Pedro Alves
2016-06-30 17:45           ` Don Breazeal
2016-06-30 18:40             ` Pedro Alves
2016-06-30 22:40               ` [PATCH v3] " Don Breazeal
2016-06-30 23:44                 ` Pedro Alves
2016-07-01 18:24                   ` [pushed] " Don Breazeal

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=0e16a8d3-0fc6-2b1f-c5aa-799ec91d4e0d@redhat.com \
    --to=palves@redhat.com \
    --cc=donb@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=qiyaoltc@gmail.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