From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 110177 invoked by alias); 19 Aug 2015 13:07:28 -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 110168 invoked by uid 89); 19 Aug 2015 13:07:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 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 13:07:25 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 0A75919CBD1; Wed, 19 Aug 2015 13:07:23 +0000 (UTC) Received: from blade.nx (ovpn-116-91.ams2.redhat.com [10.36.116.91]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t7JD7MrP026139; Wed, 19 Aug 2015 09:07:23 -0400 Received: by blade.nx (Postfix, from userid 1000) id DFD64262FAE; Wed, 19 Aug 2015 14:07:21 +0100 (BST) Date: Wed, 19 Aug 2015 13:07:00 -0000 From: Gary Benson To: Pedro Alves Cc: gdb-patches@sourceware.org, Sandra Loosemore , Joel Brobecker , Doug Evans , Jan Kratochvil , =?iso-8859-1?Q?Andr=E9_P=F6nitz?= , Paul Koning Subject: [pushed] Prelimit number of bytes to read in "vFile:pread:" Message-ID: <20150819130721.GA11701@blade.nx> References: <55D3DB83.4050204@redhat.com> <1439980862-21305-1-git-send-email-gbenson@redhat.com> <55D46C09.5050407@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55D46C09.5050407@redhat.com> X-IsSubscribed: yes X-SW-Source: 2015-08/txt/msg00510.txt.bz2 Pedro Alves wrote: > 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. Pushed to both. Thanks, Gary -- http://gbenson.net/