Received: from eggs.gnu.org ([208.118.235.92]:60224) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UcAwG-0003Jc-Ok for qemu-devel@nongnu.org; Tue, 14 May 2013 04:50:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UcAwD-0001TW-R7 for qemu-devel@nongnu.org; Tue, 14 May 2013 04:50:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56923) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UcAwD-0001TQ-JA for qemu-devel@nongnu.org; Tue, 14 May 2013 04:50:25 -0400 Date: Tue, 14 May 2013 16:50:19 +0800 From: Fam Zheng Message-ID: <20130514085019.GA2027@fam-laptop.nay.redhat.com> References: <1368498390-20738-1-git-send-email-famz@redhat.com> <20130514082253.GG3632@stefanha-thinkpad.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130514082253.GG3632@stefanha-thinkpad.redhat.com> Subject: Re: [Qemu-devel] [PATCH v2 00/11] curl: fix curl read List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: kwolf@redhat.com, jcody@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com On Tue, 05/14 10:22, Stefan Hajnoczi wrote: > On Tue, May 14, 2013 at 10:26:19AM +0800, Fam Zheng wrote: > > - CURLDataCache holds the user data read from libcurl, it is in a list > > ordered by access, the used cache is moved to list head on access, so > > the tail element is freed first. BDRVCURLState.cache_quota is the > > threshold to start freeing cache. > > Can you explain the need for a cache? > > The guest kernel already does readahead if it wants to. It can be tuned > from inside the guest if performance doesn't meet expectations. The > block/curl.c-specific cache cannot be tuned from the guest. > It's prefetch. If we send request for every read request, there'll be too much overhead for protocal transactions. I just name it CURLDataCache. Guest may have multiple sequencial reads, so I used a list of it. If you think this is reasonable, I'll update the commit messages on this. -- Fam