From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3384 invoked by alias); 19 Aug 2015 11:44:15 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 3373 invoked by uid 89); 19 Aug 2015 11:44:14 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 19 Aug 2015 11:44:14 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id DE120A9A; Wed, 19 Aug 2015 11:44:12 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t7JBi9XK000532; Wed, 19 Aug 2015 07:44:10 -0400 Message-ID: <55D46C09.5050407@redhat.com> Date: Wed, 19 Aug 2015 11:44:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Gary Benson , gdb-patches@sourceware.org CC: Sandra Loosemore , Joel Brobecker , Doug Evans , Jan Kratochvil , =?windows-1252?Q?Andr=E9_P=F6nitz?= , Paul Koning Subject: Re: [PATCH] Prelimit number of bytes to read in "vFile:pread:" References: <55D3DB83.4050204@redhat.com> <1439980862-21305-1-git-send-email-gbenson@redhat.com> In-Reply-To: <1439980862-21305-1-git-send-email-gbenson@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2015-08/txt/msg00507.txt.bz2 On 08/19/2015 11:41 AM, Gary Benson wrote: > Pedro Alves wrote: >> The fact that Gary's chunk size limiting patch made things much >> faster on the nios2 board is still mysterious to me. I'd expect the >> slowness to be latency bound, given the request/response nature of >> the RSP, but then I'd expect that more chunking would slow things >> down, not speed it up. > > I think I figured this out... > > While handling "vFile:pread:" packets, gdbserver would read the > number of bytes requested regardless of whether this would fit > into the reply packet. gdbserver would then return a packet's > worth of data and discard the remainder. When accessing large > binaries GDB (via BFD) routinely makes large "vFile:pread:" > requests, resulting in gdbserver allocating large unnecessary > buffers and reading some portions of the file many times over. > > This commit causes gdbserver to limit the number of bytes to be > read to a sensible maximum prior to allocating buffers and reading > data. > > Built and regtested on RHEL 6.6 x86_64. > > May I push this to HEAD and to the branch? OK. Thanks, Pedro Alves